1
1
Fork 0

Consolidate directory ensurance into user config

This commit is contained in:
Jaculabilis 2020-12-29 18:53:50 -08:00
parent 3dd512a3ed
commit 59142cf240
1 changed files with 3 additions and 7 deletions

View File

@ -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" ];