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.
This commit is contained in:
Robert Helgesson 2017-11-09 17:14:37 +01:00
parent 54043df8fb
commit f52ec0df7c
No known key found for this signature in database
GPG key ID: C3DB11069E65DC86

View file

@ -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 []);