diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-04-19 14:57:25 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-04-19 14:57:25 +0200 |
commit | 0ca211d4ec600fa7b3cc701e4997cd1e8d38ebdc (patch) | |
tree | 4f9b09ca5d55e44710f020bcf6621daa4fd6b73a /nixpkgs/nixos/modules/system/boot/systemd-lib.nix | |
parent | 1c2ef52230ed2c8b2529c47ce6a857bdde46c7c7 (diff) | |
parent | b61999e4ad60c351b4da63ae3ff43aae3c0bbdfb (diff) |
Merge commit 'b61999e4ad60c351b4da63ae3ff43aae3c0bbdfb'
Diffstat (limited to 'nixpkgs/nixos/modules/system/boot/systemd-lib.nix')
-rw-r--r-- | nixpkgs/nixos/modules/system/boot/systemd-lib.nix | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/nixpkgs/nixos/modules/system/boot/systemd-lib.nix b/nixpkgs/nixos/modules/system/boot/systemd-lib.nix index a3360291586..fa109394fed 100644 --- a/nixpkgs/nixos/modules/system/boot/systemd-lib.nix +++ b/nixpkgs/nixos/modules/system/boot/systemd-lib.nix @@ -114,7 +114,9 @@ in rec { (if isList value then value else [value])) as)); - generateUnits = type: units: upstreamUnits: upstreamWants: + generateUnits = generateUnits' true; + + generateUnits' = allowCollisions: type: units: upstreamUnits: upstreamWants: pkgs.runCommand "${type}-units" { preferLocalBuild = true; allowSubstitutes = false; @@ -182,8 +184,13 @@ in rec { if [ "$(readlink -f $i/$fn)" = /dev/null ]; then ln -sfn /dev/null $out/$fn else - mkdir -p $out/$fn.d - ln -s $i/$fn $out/$fn.d/overrides.conf + ${if allowCollisions then '' + mkdir -p $out/$fn.d + ln -s $i/$fn $out/$fn.d/overrides.conf + '' else '' + echo "Found multiple derivations configuring $fn!" + exit 1 + ''} fi else ln -fs $i/$fn $out/ |