mirror of
https://github.com/foo-dogsquared/nixos-config.git
synced 2025-02-07 06:19:00 +00:00
services/archivebox: add dedicated service user and group
This commit is contained in:
parent
cee845a94b
commit
8b812a34c9
@ -58,6 +58,9 @@ let
|
|||||||
| archivebox add ${lib.concatStringsSep " " value.extraArgs}
|
| archivebox add ${lib.concatStringsSep " " value.extraArgs}
|
||||||
'';
|
'';
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
User = "archivebox";
|
||||||
|
Group = "archivebox";
|
||||||
|
|
||||||
LockPersonality = true;
|
LockPersonality = true;
|
||||||
NoNewPrivileges = true;
|
NoNewPrivileges = true;
|
||||||
PrivateTmp = true;
|
PrivateTmp = true;
|
||||||
@ -158,6 +161,12 @@ in
|
|||||||
{
|
{
|
||||||
systemd.services = lib.mapAttrs' mkJobService cfg.jobs;
|
systemd.services = lib.mapAttrs' mkJobService cfg.jobs;
|
||||||
systemd.timers = lib.mapAttrs' mkTimerUnit cfg.jobs;
|
systemd.timers = lib.mapAttrs' mkTimerUnit cfg.jobs;
|
||||||
|
|
||||||
|
users.users.archivebox = {
|
||||||
|
group = config.users.groups.archivebox.name;
|
||||||
|
isNormalUser = true;
|
||||||
|
home = "/var/lib/archivebox";
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
(lib.mkIf cfg.webserver.enable {
|
(lib.mkIf cfg.webserver.enable {
|
||||||
@ -167,6 +176,8 @@ in
|
|||||||
documentation = [ "https://docs.archivebox.io/" ];
|
documentation = [ "https://docs.archivebox.io/" ];
|
||||||
wantedBy = [ "graphical-session.target" ];
|
wantedBy = [ "graphical-session.target" ];
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
|
User = "archivebox";
|
||||||
|
Group = "archivebox";
|
||||||
ExecStart = "${pkgs.archivebox}/bin/archivebox server localhost:${
|
ExecStart = "${pkgs.archivebox}/bin/archivebox server localhost:${
|
||||||
toString cfg.webserver.port
|
toString cfg.webserver.port
|
||||||
}";
|
}";
|
||||||
|
Loading…
Reference in New Issue
Block a user