mirror of
https://github.com/nix-community/home-manager.git
synced 2026-01-12 01:59:37 +08:00
mkFirefoxModule: userchrome support derivations (#6844)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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}
|
||||
'';
|
||||
}
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user