mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +01:00
systemd: remove filename hack
This commit is contained in:
parent
f6900f0689
commit
8d360c5a57
2 changed files with 9 additions and 10 deletions
|
@ -237,13 +237,7 @@ in
|
||||||
# i.e., if the executable bit of the source is the same we
|
# i.e., if the executable bit of the source is the same we
|
||||||
# expect for the target. Otherwise, we copy the file and
|
# expect for the target. Otherwise, we copy the file and
|
||||||
# set the executable bit to the expected value.
|
# set the executable bit to the expected value.
|
||||||
#
|
if [[ $executable == inherit || $isExecutable == $executable ]]; then
|
||||||
# Note, as a special case we always copy systemd units
|
|
||||||
# because it derives the unit name from the ultimate link
|
|
||||||
# target, which may be a store path with the hash
|
|
||||||
# included.
|
|
||||||
if [[ ($executable == inherit || $isExecutable == $executable) \
|
|
||||||
&& $relTarget != *"/systemd/user/"* ]]; then
|
|
||||||
ln -s "$source" "$target"
|
ln -s "$source" "$target"
|
||||||
else
|
else
|
||||||
cp "$source" "$target"
|
cp "$source" "$target"
|
||||||
|
|
|
@ -24,16 +24,21 @@ let
|
||||||
|
|
||||||
buildService = style: name: serviceCfg:
|
buildService = style: name: serviceCfg:
|
||||||
let
|
let
|
||||||
source = pkgs.writeText "${name}.${style}" (toSystemdIni serviceCfg);
|
filename = "${name}.${style}";
|
||||||
|
|
||||||
|
# Needed because systemd derives unit names from the ultimate
|
||||||
|
# link target.
|
||||||
|
source = pkgs.writeTextDir filename (toSystemdIni serviceCfg)
|
||||||
|
+ "/" + filename;
|
||||||
|
|
||||||
wantedBy = target:
|
wantedBy = target:
|
||||||
{
|
{
|
||||||
name = "systemd/user/${target}.wants/${name}.${style}";
|
name = "systemd/user/${target}.wants/${filename}";
|
||||||
value = { inherit source; };
|
value = { inherit source; };
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
singleton {
|
singleton {
|
||||||
name = "systemd/user/${name}.${style}";
|
name = "systemd/user/${filename}";
|
||||||
value = { inherit source; };
|
value = { inherit source; };
|
||||||
}
|
}
|
||||||
++
|
++
|
||||||
|
|
Loading…
Reference in a new issue