mirror of
https://github.com/oddlama/nix-config.git
synced 2025-10-10 23:00:39 +02:00
feat: "bake-in" firefox env vars
This commit is contained in:
parent
cbdc3b7bff
commit
6af1950f53
1 changed files with 24 additions and 3 deletions
|
@ -1,13 +1,34 @@
|
||||||
{
|
{
|
||||||
programs.firefox.enable = true;
|
lib,
|
||||||
home.sessionVariables = {
|
pkgs,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
|
inherit (lib) concatStringsSep escapeShellArg mapAttrsToList;
|
||||||
|
env = {
|
||||||
MOZ_WEBRENDER = 1;
|
MOZ_WEBRENDER = 1;
|
||||||
# For a better scrolling implementation and touch support.
|
# For a better scrolling implementation and touch support.
|
||||||
# Be sure to also disable "Use smooth scrolling" in about:preferences
|
# Be sure to also disable "Use smooth scrolling" in about:preferences
|
||||||
MOZ_USE_XINPUT2 = 1;
|
MOZ_USE_XINPUT2 = 1;
|
||||||
# To allow vaapi access for hardware acceleration
|
# Required for hardware video decoding.
|
||||||
|
# See https://github.com/elFarto/nvidia-vaapi-driver?tab=readme-ov-file#firefox
|
||||||
MOZ_DISABLE_RDD_SANDBOX = 1;
|
MOZ_DISABLE_RDD_SANDBOX = 1;
|
||||||
|
LIBVA_DRIVER_NAME = "nvidia";
|
||||||
|
NVD_BACKEND = "direct";
|
||||||
};
|
};
|
||||||
|
envStr = concatStringsSep " " (mapAttrsToList (n: v: "${n}=${escapeShellArg v}") env);
|
||||||
|
in {
|
||||||
|
programs.firefox.enable = true;
|
||||||
|
programs.firefox.package = pkgs.firefox.overrideAttrs (old: {
|
||||||
|
buildCommand =
|
||||||
|
old.buildCommand
|
||||||
|
+ ''
|
||||||
|
substituteInPlace $out/bin/firefox \
|
||||||
|
--replace "exec -a" ${escapeShellArg envStr}" exec -a"
|
||||||
|
'';
|
||||||
|
});
|
||||||
|
|
||||||
|
# TODO userChrome
|
||||||
|
# TODO settings if they can coexist with non declarative stuff
|
||||||
|
|
||||||
home.persistence."/state".directories = [
|
home.persistence."/state".directories = [
|
||||||
"Downloads"
|
"Downloads"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue