From f198c4060806706203420c6951b136a42a44d750 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 12 Mar 2014 18:40:28 +0100 Subject: [PATCH] Don't depend on the text of disabled units This prevents pulling in unnecessary dependencies. --- nixos/modules/system/boot/systemd.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index e9d25479378..3b4e06e3ad6 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -11,14 +11,18 @@ let systemd = cfg.package; makeUnit = name: unit: - pkgs.runCommand "unit" { preferLocalBuild = true; inherit (unit) text; } - (if !unit.enable then '' - mkdir -p $out - ln -s /dev/null $out/${name} - '' else '' - mkdir -p $out - echo -n "$text" > $out/${name} - ''); + if unit.enable then + pkgs.runCommand "unit" { preferLocalBuild = true; inherit (unit) text; } + '' + mkdir -p $out + echo -n "$text" > $out/${name} + '' + else + pkgs.runCommand "unit" { preferLocalBuild = true; } + '' + mkdir -p $out + ln -s /dev/null $out/${name} + ''; upstreamUnits = [ # Targets.