nixos/aria2: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
This commit is contained in:
parent
b6bfb874ec
commit
e85d03e52b
|
@ -102,22 +102,19 @@ in
|
||||||
|
|
||||||
users.groups.aria2.gid = config.ids.gids.aria2;
|
users.groups.aria2.gid = config.ids.gids.aria2;
|
||||||
|
|
||||||
|
systemd.tmpfiles.rules = [
|
||||||
|
"d '${homeDir}' 0770 aria2 aria2 - -"
|
||||||
|
"d '${config.services.aria2.downloadDir}' 0770 aria2 aria2 - -"
|
||||||
|
];
|
||||||
|
|
||||||
systemd.services.aria2 = {
|
systemd.services.aria2 = {
|
||||||
description = "aria2 Service";
|
description = "aria2 Service";
|
||||||
after = [ "local-fs.target" "network.target" ];
|
after = [ "local-fs.target" "network.target" ];
|
||||||
wantedBy = [ "multi-user.target" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
preStart = ''
|
preStart = ''
|
||||||
mkdir -m 0770 -p "${homeDir}"
|
|
||||||
chown aria2:aria2 "${homeDir}"
|
|
||||||
if [[ ! -d "${config.services.aria2.downloadDir}" ]]
|
|
||||||
then
|
|
||||||
mkdir -m 0770 -p "${config.services.aria2.downloadDir}"
|
|
||||||
chown aria2:aria2 "${config.services.aria2.downloadDir}"
|
|
||||||
fi
|
|
||||||
if [[ ! -e "${sessionFile}" ]]
|
if [[ ! -e "${sessionFile}" ]]
|
||||||
then
|
then
|
||||||
touch "${sessionFile}"
|
touch "${sessionFile}"
|
||||||
chown aria2:aria2 "${sessionFile}"
|
|
||||||
fi
|
fi
|
||||||
cp -f "${settingsFile}" "${settingsDir}/aria2.conf"
|
cp -f "${settingsFile}" "${settingsDir}/aria2.conf"
|
||||||
'';
|
'';
|
||||||
|
@ -128,7 +125,6 @@ in
|
||||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
User = "aria2";
|
User = "aria2";
|
||||||
Group = "aria2";
|
Group = "aria2";
|
||||||
PermissionsStartOnly = true;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue