mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
environment.etc: provide proper error message when source is missing
This commit is contained in:
parent
d83fd3ae59
commit
8e3ae405ab
1 changed files with 5 additions and 1 deletions
|
@ -7,6 +7,7 @@ with lib;
|
|||
let
|
||||
|
||||
fileName = file: last (splitString "/" file);
|
||||
mkDefaultIf = cond: value: mkIf cond (mkDefault value);
|
||||
|
||||
drv = mkTextDerivation (fileName name) config.text;
|
||||
|
||||
|
@ -51,7 +52,10 @@ in
|
|||
|
||||
config = {
|
||||
|
||||
source = mkIf (config.text != "") (mkDefault drv);
|
||||
source = mkMerge
|
||||
[ (mkDefaultIf (config.text != "") drv)
|
||||
(mkDefaultIf (config.text == "") (abort "environment.etc.${name}.text is empty but no source was defined."))
|
||||
];
|
||||
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue