forked from mirrors/nixpkgs
Don't depend on the text of disabled units
This prevents pulling in unnecessary dependencies.
This commit is contained in:
parent
207c881df9
commit
f198c40608
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue