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