set credentials oneshots to stop after launch

This commit is contained in:
Noah Masur 2022-10-14 01:35:14 +00:00
parent c2d0037bab
commit a17a048d9d
2 changed files with 2 additions and 8 deletions

View File

@ -74,10 +74,7 @@ in {
systemd.services.transmission-creds = { systemd.services.transmission-creds = {
requiredBy = [ "transmission.service" ]; requiredBy = [ "transmission.service" ];
before = [ "transmission.service" ]; before = [ "transmission.service" ];
serviceConfig = { serviceConfig = { Type = "oneshot"; };
Type = "oneshot";
RemainAfterExit = true;
};
script = '' script = ''
if [ ! -f "${credentialsFile}" ]; then if [ ! -f "${credentialsFile}" ]; then
mkdir --parents ${builtins.dirOf credentialsFile} mkdir --parents ${builtins.dirOf credentialsFile}

View File

@ -46,10 +46,7 @@
wantedBy = [ "wireguard-wg0.service" ]; wantedBy = [ "wireguard-wg0.service" ];
requiredBy = [ "wireguard-wg0.service" ]; requiredBy = [ "wireguard-wg0.service" ];
before = [ "wireguard-wg0.service" ]; before = [ "wireguard-wg0.service" ];
serviceConfig = { serviceConfig = { Type = "oneshot"; };
Type = "oneshot";
RemainAfterExit = true;
};
script = let script = let
encryptedPrivateKey = config.networking.wireguard.encryptedPrivateKey; encryptedPrivateKey = config.networking.wireguard.encryptedPrivateKey;
privateKeyFile = privateKeyFile =