firefox with nixGL and vertical tabs

This commit is contained in:
Freya Murphy 2024-11-09 18:16:54 -05:00
parent 131ba51723
commit 18751dd6a4
Signed by: freya
GPG key ID: 9FBC6FFD6D2DBF17
5 changed files with 105 additions and 4 deletions

View file

@ -1,5 +1,20 @@
{ {
"nodes": { "nodes": {
"flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@ -21,6 +36,28 @@
"type": "github" "type": "github"
} }
}, },
"nixgl": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1730651795, "lastModified": 1730651795,
@ -40,6 +77,7 @@
"root": { "root": {
"inputs": { "inputs": {
"home-manager": "home-manager", "home-manager": "home-manager",
"nixgl": "nixgl",
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
} }
} }

View file

@ -8,23 +8,39 @@
# home manager # home manager
home-manager.url = "github:nix-community/home-manager/release-24.05"; home-manager.url = "github:nix-community/home-manager/release-24.05";
home-manager.inputs.nixpkgs.follows = "nixpkgs"; home-manager.inputs.nixpkgs.follows = "nixpkgs";
# nixgl
nixgl.url = "github:nix-community/nixGL/310f8e49a149e4c9ea52f1adf70cdc768ec53f8a";
nixgl.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { outputs = {
self, self,
nixpkgs, nixpkgs,
home-manager, home-manager,
nixgl,
... ...
} @ inputs: let } @ inputs: let
inherit (self) outputs; inherit (self) outputs;
system = "x86_64-linux"; system = "x86_64-linux";
pkgs = nixpkgs.legacyPackages.${system}; pkgs = nixpkgs.legacyPackages.${system};
overlays = [
nixgl.overlay
];
in { in {
homeConfigurations."freya" = homeConfigurations."freya" =
home-manager.lib.homeManagerConfiguration { home-manager.lib.homeManagerConfiguration {
inherit pkgs; inherit pkgs;
extraSpecialArgs = {inherit inputs outputs;}; extraSpecialArgs = {inherit inputs outputs;};
modules = [./home.nix]; modules = [
{nixpkgs.overlays = overlays;}
./home.nix
{
_module.args = {
inherit nixgl;
};
}
];
}; };
}; };
} }

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { { config, pkgs, nixgl, ... }: {
imports = [ imports = [
./programs ./programs
@ -19,6 +19,8 @@
starship starship
discord discord
thunderbird thunderbird
nixgl.packages.${pkgs.system}.nixGLIntel
nixgl.packages.${pkgs.system}.nixVulkanIntel
]; ];
}; };

View file

@ -1,4 +1,4 @@
{ config, pkgs, ... }: { pkgs, nixgl, ... }:
let let
lock-false = { lock-false = {
Value = false; Value = false;
@ -8,11 +8,14 @@
Value = true; Value = true;
Status = "locked"; Status = "locked";
}; };
nixGL = import ./nixGL.nix { inherit pkgs nixgl; };
in in
{ {
programs.firefox = { programs.firefox = {
enable = true; enable = true;
package = (nixGL pkgs.firefox);
policies = { policies = {
EnableTrackingProtection = { EnableTrackingProtection = {
Value = true; Value = true;
@ -230,7 +233,7 @@
"media.eme.enabled" = lock-true; "media.eme.enabled" = lock-true;
# tabs # tabs
"browser.tabs.inTitlebar" = { "browser.tabs.inTitlebar" = {
Value = 1; Value = 0;
Status = "locked"; Status = "locked";
}; };
"browser.tabs.warnOnClose" = lock-true; "browser.tabs.warnOnClose" = lock-true;
@ -251,6 +254,15 @@
"browser.safebrowsing.downloads.enabled" = lock-true; "browser.safebrowsing.downloads.enabled" = lock-true;
"browser.safebrowsing.downloads.remote.block_uncommon" = lock-false; "browser.safebrowsing.downloads.remote.block_uncommon" = lock-false;
"browser.safebrowsing.downloads.remote.block_potentially_unwanted" = lock-false; "browser.safebrowsing.downloads.remote.block_potentially_unwanted" = lock-false;
# sidebar
"sidebar.revamp" = lock-true;
"sidebar.verticalTabs" = lock-true;
"sidebar.main.tools" = {
Value = "";
Status = "locked";
};
"browser.tabs.closeTabByDblclick" = lock-true;
"ui.key.menuAccessKeyFocuses" = lock-false;
}; };
}; };
@ -278,6 +290,8 @@
}; };
}; };
userChrome = '' userChrome = ''
#sidebar-header { display:none !important; }
#sidebar-search-container { display:none !important; }
#firefox-view-button { #firefox-view-button {
visibility: collapse; visibility: collapse;
} }

View file

@ -0,0 +1,31 @@
{ pkgs, nixgl, ... }:
let
nixGL = "${nixgl.packages.${pkgs.system}.nixGLIntel}/bin/nixGLIntel";
in
pkg:
(pkg.overrideAttrs (old: {
name = "nixGL-${pkg.name}";
buildCommand = ''
set -eo pipefail
${
# Heavily inspired by https://stackoverflow.com/a/68523368/6259505
pkgs.lib.concatStringsSep "\n" (map (outputName: ''
echo "Copying output ${outputName}"
set -x
cp -rs --no-preserve=mode "${pkg.${outputName}}" "''$${outputName}"
set +x
'') (old.outputs or [ "out" ]))}
rm -rf $out/bin/*
shopt -s nullglob # Prevent loop from running if no files
for file in ${pkg.out}/bin/*; do
echo "#!${pkgs.bash}/bin/bash" > "$out/bin/$(basename $file)"
echo "exec -a \"\$0\" ${nixGL} $file \"\$@\"" >> "$out/bin/$(basename $file)"
chmod +x "$out/bin/$(basename $file)"
done
shopt -u nullglob # Revert nullglob back to its normal default state
'';
}))