mkFirefoxModule: userchrome support derivations (#6844)

This commit is contained in:
Austin Horstman
2025-04-18 17:57:48 -07:00
committed by GitHub
parent 67f60ebce8
commit 991a480472
2 changed files with 19 additions and 2 deletions

View File

@@ -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;

View File

@@ -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}
'';
}
);