Consolidate directory ensurance into user config
This commit is contained in:
parent
3dd512a3ed
commit
59142cf240
|
@ -52,6 +52,8 @@ in
|
|||
users.users.inquisitor = {
|
||||
description = "Inquisitor service user";
|
||||
isSystemUser = true;
|
||||
home = "/var/lib/inquisitor";
|
||||
createHome = true;
|
||||
packages = [ inquisitor ];
|
||||
};
|
||||
|
||||
|
@ -60,18 +62,12 @@ in
|
|||
|
||||
# Set up the inquisitor service
|
||||
systemd.services.inquisitor =
|
||||
let
|
||||
inquisitorSetup = pkgs.writeShellScriptBin "setup.sh" ''
|
||||
${pkgs.coreutils}/bin/mkdir -p /var/lib/inquisitor &&
|
||||
${pkgs.coreutils}/bin/chown inquisitor /var/lib/inquisitor
|
||||
'';
|
||||
in {
|
||||
{
|
||||
description = "Inquisitor server";
|
||||
script = "${inquisitorRun}/bin/run.sh";
|
||||
serviceConfig = {
|
||||
User = "inquisitor";
|
||||
Type = "simple";
|
||||
ExecStartPre = "+${inquisitorSetup}/bin/setup.sh";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network.target" ];
|
||||
|
|
Loading…
Reference in New Issue