diff --git a/modules/programs/firefox/mkFirefoxModule.nix b/modules/programs/firefox/mkFirefoxModule.nix index 74639dc7..07df1cf4 100644 --- a/modules/programs/firefox/mkFirefoxModule.nix +++ b/modules/programs/firefox/mkFirefoxModule.nix @@ -870,12 +870,12 @@ in _: profile: let chromePath = - if ((i: lib.isPath i && lib.pathIsDirectory i) profile.userChrome) then + if ((i: (lib.isPath i && lib.pathIsDirectory i) || lib.isDerivation i) profile.userChrome) then "chrome" else "chrome/userChrome.css"; sourcePath = - if ((i: lib.isPath i && lib.types.path.check i) profile.userChrome) then + if ((i: (lib.isPath i && lib.types.path.check i) || lib.isDerivation i) profile.userChrome) then profile.userChrome else null; diff --git a/tests/modules/programs/firefox/profiles/userchrome/default.nix b/tests/modules/programs/firefox/profiles/userchrome/default.nix index e016a210..02c68219 100644 --- a/tests/modules/programs/firefox/profiles/userchrome/default.nix +++ b/tests/modules/programs/firefox/profiles/userchrome/default.nix @@ -38,6 +38,17 @@ in id = 3; userChrome = ./chrome; }; + derivation = { + id = 4; + userChrome = config.lib.test.mkStubPackage { + name = "wavefox"; + buildScript = '' + mkdir -p $out + ln -s ${./chrome/userChrome.css} $out/userChrome.css + echo test > $out/README.md + ''; + }; + }; }; } // { @@ -65,6 +76,12 @@ in assertFileContent \ home-files/${cfg.configPath}/folder/chrome/userChrome.css \ ${./chrome/userChrome.css} + + assertFileExists \ + home-files/${cfg.configPath}/derivation/chrome/README.md + assertFileContent \ + home-files/${cfg.configPath}/derivation/chrome/userChrome.css \ + ${./chrome/userChrome.css} ''; } );