diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 2a7985ded66..18dbed17a97 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -10,15 +10,19 @@ let systemd = cfg.package; + makeUnit = name: unit: + let + pathSafeName = lib.replaceChars ["@"] ["-"] name; + in if unit.enable then - pkgs.runCommand "unit-${name}" { preferLocalBuild = true; inherit (unit) text; } + pkgs.runCommand "unit-${pathSafeName}" { preferLocalBuild = true; inherit (unit) text; } '' mkdir -p $out echo -n "$text" > $out/${shellEscape name} '' else - pkgs.runCommand "unit-${name}-disabled" { preferLocalBuild = true; } + pkgs.runCommand "unit-${pathSafeName}-disabled" { preferLocalBuild = true; } '' mkdir -p $out ln -s /dev/null $out/${shellEscape name}