nixos/netbox: add services to redis group conditionally
This only makes sense when there is a local redis group, and then we can scope the group membership to the service instead of the whole user.
This commit is contained in:
@@ -81,6 +81,7 @@ let
|
||||
lib.cli.toCommandLineShellGNU { } {
|
||||
preserve-environment = true;
|
||||
user = "netbox";
|
||||
supp-group = if cfg.redis.createLocally then config.services.redis.servers.netbox.group else null;
|
||||
}
|
||||
} -- ${finalPackage}/bin/netbox "$@";;
|
||||
"netbox")
|
||||
@@ -608,6 +609,9 @@ in
|
||||
RestartSec = 30;
|
||||
Slice = "system-netbox.slice";
|
||||
EnvironmentFile = cfg.environmentFiles;
|
||||
SupplementaryGroups = lib.optionals cfg.redis.createLocally [
|
||||
config.services.redis.servers.netbox.group
|
||||
];
|
||||
|
||||
AmbientCapabilities = [ "" ];
|
||||
CapabilityBoundingSet = [ "" ];
|
||||
@@ -775,7 +779,6 @@ in
|
||||
group = "netbox";
|
||||
};
|
||||
users.groups.netbox = { };
|
||||
users.groups."${config.services.redis.servers.netbox.user}".members = [ "netbox" ];
|
||||
}
|
||||
|
||||
(lib.mkIf cfg.nginx.enable {
|
||||
|
||||
Reference in New Issue
Block a user