mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 01:13:05 +00:00
Merge pull request #165532 from Infinisil/syncplay-password
This commit is contained in:
commit
fda16bfd32
@ -61,6 +61,15 @@ in
|
|||||||
Group to use when running Syncplay.
|
Group to use when running Syncplay.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
passwordFile = mkOption {
|
||||||
|
type = types.nullOr types.path;
|
||||||
|
default = null;
|
||||||
|
description = ''
|
||||||
|
Path to the file that contains the server password. If
|
||||||
|
<literal>null</literal>, the server doesn't require a password.
|
||||||
|
'';
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -71,10 +80,17 @@ in
|
|||||||
after = [ "network-online.target" ];
|
after = [ "network-online.target" ];
|
||||||
|
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
ExecStart = "${pkgs.syncplay}/bin/syncplay-server ${escapeShellArgs cmdArgs}";
|
|
||||||
User = cfg.user;
|
User = cfg.user;
|
||||||
Group = cfg.group;
|
Group = cfg.group;
|
||||||
|
LoadCredential = lib.mkIf (cfg.passwordFile != null) "password:${cfg.passwordFile}";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
script = ''
|
||||||
|
${lib.optionalString (cfg.passwordFile != null) ''
|
||||||
|
export SYNCPLAY_PASSWORD=$(cat "''${CREDENTIALS_DIRECTORY}/password")
|
||||||
|
''}
|
||||||
|
exec ${pkgs.syncplay}/bin/syncplay-server ${escapeShellArgs cmdArgs}
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user