From f52ec0df7c00a2d3938091f3d72641d023385878 Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Thu, 9 Nov 2017 17:14:37 +0100 Subject: [PATCH] systemd: force copying of unit files This is done by exploiting the fact that home files will be copied if the executable bit of the source file and the target file is different. This should be considered a hack until some nicer solution is found. --- modules/systemd.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/systemd.nix b/modules/systemd.nix index 8ee2db659..939dc832c 100644 --- a/modules/systemd.nix +++ b/modules/systemd.nix @@ -24,17 +24,17 @@ let buildService = style: name: serviceCfg: let - source = pkgs.writeText "${name}.${style}" (toSystemdIni serviceCfg); + source = pkgs.writeScript "${name}.${style}" (toSystemdIni serviceCfg); wantedBy = target: { name = "systemd/user/${target}.wants/${name}.${style}"; - value = { inherit source; }; + value = { inherit source; executable = false; }; }; in singleton { name = "systemd/user/${name}.${style}"; - value = { inherit source; }; + value = { inherit source; executable = false; }; } ++ map wantedBy (serviceCfg.Install.WantedBy or []);