This commit is contained in:
Peder Bergebakken Sundt 2023-08-27 01:05:41 +02:00
parent 34134cd81c
commit 63eb73afbf

View File

@ -86,29 +86,26 @@
}; };
}; };
config = { config = {
systemd.services.grzegorz = lib.mkIf cfg.enable { services.cage.enable = true;
description = "grzegorz"; services.cage.program = pkgs.writeShellScript "grzegorz-kiosk" ''
wantedBy = [ "default.target" ]; cd $(mktemp -d)
serviceConfig = { ${(lib.escapeShellArgs [
User = "grzegorz";
Group = "grzegorz";
DynamicUser = true;
#StateDirectory = "grzegorz";
#CacheDirectory = "grzegorz";
ExecStart = lib.escapeShellArgs [
"${pkgs.cage}/bin/cage"
"--"
"${cfg.package}/bin/grzegorz-run" "${cfg.package}/bin/grzegorz-run"
"--host" cfg.listenAddr "--host" cfg.listenAddr
"--port" cfg.listenPort "--port" cfg.listenPort
]; ])}
Restart = "on-failure"; '';
services.cage.user = "grzegorz";
users.users."grzegorz".isNormalUser = true;
system.activationScripts = {
base-dirs = {
text = ''
mkdir -p /nix/var/nix/profiles/per-user/grzegorz
'';
deps = [];
}; };
}; };
}; };
}; };
}; };
} }