2023-06-06 14:53:08 +02:00
|
|
|
{ config, lib, pkgs, ... }:
|
2022-03-05 19:25:21 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.netbox;
|
2022-12-20 10:19:42 +01:00
|
|
|
pythonFmt = pkgs.formats.pythonVars {};
|
2022-03-05 19:25:21 +01:00
|
|
|
staticDir = cfg.dataDir + "/static";
|
2022-12-20 10:19:42 +01:00
|
|
|
|
|
|
|
settingsFile = pythonFmt.generate "netbox-settings.py" cfg.settings;
|
|
|
|
extraConfigFile = pkgs.writeTextFile {
|
|
|
|
name = "netbox-extraConfig.py";
|
|
|
|
text = cfg.extraConfig;
|
2022-03-05 19:25:21 +01:00
|
|
|
};
|
2022-12-20 10:19:42 +01:00
|
|
|
configFile = pkgs.concatText "configuration.py" [ settingsFile extraConfigFile ];
|
|
|
|
|
2023-03-14 20:23:50 +01:00
|
|
|
pkg = (cfg.package.overrideAttrs (old: {
|
2022-03-05 19:25:21 +01:00
|
|
|
installPhase = old.installPhase + ''
|
|
|
|
ln -s ${configFile} $out/opt/netbox/netbox/netbox/configuration.py
|
2023-07-31 14:38:26 +02:00
|
|
|
'' + lib.optionalString cfg.enableLdap ''
|
2022-11-07 13:58:22 +01:00
|
|
|
ln -s ${cfg.ldapConfigPath} $out/opt/netbox/netbox/netbox/ldap_config.py
|
2022-03-05 19:25:21 +01:00
|
|
|
'';
|
|
|
|
})).override {
|
2022-11-07 13:58:22 +01:00
|
|
|
inherit (cfg) plugins;
|
2022-03-05 19:25:21 +01:00
|
|
|
};
|
|
|
|
netboxManageScript = with pkgs; (writeScriptBin "netbox-manage" ''
|
|
|
|
#!${stdenv.shell}
|
|
|
|
export PYTHONPATH=${pkg.pythonPath}
|
|
|
|
sudo -u netbox ${pkg}/bin/netbox "$@"
|
|
|
|
'');
|
|
|
|
|
|
|
|
in {
|
|
|
|
options.services.netbox = {
|
2023-07-31 14:38:26 +02:00
|
|
|
enable = lib.mkOption {
|
2022-03-05 19:25:21 +01:00
|
|
|
type = lib.types.bool;
|
|
|
|
default = false;
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Enable Netbox.
|
|
|
|
|
|
|
|
This module requires a reverse proxy that serves `/static` separately.
|
|
|
|
See this [example](https://github.com/netbox-community/netbox/blob/develop/contrib/nginx.conf/) on how to configure this.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2022-12-20 10:19:42 +01:00
|
|
|
settings = lib.mkOption {
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Configuration options to set in `configuration.py`.
|
|
|
|
See the [documentation](https://docs.netbox.dev/en/stable/configuration/) for more possible options.
|
|
|
|
'';
|
|
|
|
|
|
|
|
default = { };
|
|
|
|
|
|
|
|
type = lib.types.submodule {
|
|
|
|
freeformType = pythonFmt.type;
|
|
|
|
|
|
|
|
options = {
|
|
|
|
ALLOWED_HOSTS = lib.mkOption {
|
|
|
|
type = with lib.types; listOf str;
|
|
|
|
default = ["*"];
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
A list of valid fully-qualified domain names (FQDNs) and/or IP
|
|
|
|
addresses that can be used to reach the NetBox service.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
listenAddress = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
2022-03-05 19:25:21 +01:00
|
|
|
default = "[::1]";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Address the server will listen on.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
package = lib.mkOption {
|
|
|
|
type = lib.types.package;
|
2023-09-24 10:07:28 +02:00
|
|
|
default =
|
|
|
|
if lib.versionAtLeast config.system.stateVersion "23.11"
|
|
|
|
then pkgs.netbox_3_6
|
|
|
|
else if lib.versionAtLeast config.system.stateVersion "23.05"
|
|
|
|
then pkgs.netbox_3_5
|
|
|
|
else pkgs.netbox_3_3;
|
2023-07-31 14:38:26 +02:00
|
|
|
defaultText = lib.literalExpression ''
|
2023-09-24 10:07:28 +02:00
|
|
|
if lib.versionAtLeast config.system.stateVersion "23.11"
|
|
|
|
then pkgs.netbox_3_6
|
|
|
|
else if lib.versionAtLeast config.system.stateVersion "23.05"
|
|
|
|
then pkgs.netbox_3_5
|
|
|
|
else pkgs.netbox_3_3;
|
2023-03-14 20:23:50 +01:00
|
|
|
'';
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
NetBox package to use.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
port = lib.mkOption {
|
|
|
|
type = lib.types.port;
|
2022-03-05 19:25:21 +01:00
|
|
|
default = 8001;
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Port the server will listen on.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
plugins = lib.mkOption {
|
|
|
|
type = with lib.types; functionTo (listOf package);
|
2022-03-05 19:25:21 +01:00
|
|
|
default = _: [];
|
2023-07-31 14:38:26 +02:00
|
|
|
defaultText = lib.literalExpression ''
|
2022-03-05 19:25:21 +01:00
|
|
|
python3Packages: with python3Packages; [];
|
|
|
|
'';
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
List of plugin packages to install.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
dataDir = lib.mkOption {
|
|
|
|
type = lib.types.str;
|
2022-03-05 19:25:21 +01:00
|
|
|
default = "/var/lib/netbox";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Storage path of netbox.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
secretKeyFile = lib.mkOption {
|
|
|
|
type = lib.types.path;
|
2022-03-05 19:25:21 +01:00
|
|
|
description = lib.mdDoc ''
|
|
|
|
Path to a file containing the secret key.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
extraConfig = lib.mkOption {
|
|
|
|
type = lib.types.lines;
|
2022-03-05 19:25:21 +01:00
|
|
|
default = "";
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Additional lines of configuration appended to the `configuration.py`.
|
2022-12-20 10:19:42 +01:00
|
|
|
See the [documentation](https://docs.netbox.dev/en/stable/configuration/) for more possible options.
|
2022-03-05 19:25:21 +01:00
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
enableLdap = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
2022-03-05 19:25:21 +01:00
|
|
|
default = false;
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
Enable LDAP-Authentication for Netbox.
|
|
|
|
|
|
|
|
This requires a configuration file being pass through `ldapConfigPath`.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
ldapConfigPath = lib.mkOption {
|
|
|
|
type = lib.types.path;
|
2022-03-05 19:25:21 +01:00
|
|
|
default = "";
|
|
|
|
description = lib.mdDoc ''
|
2022-12-18 01:31:14 +01:00
|
|
|
Path to the Configuration-File for LDAP-Authentication, will be loaded as `ldap_config.py`.
|
2022-03-05 19:25:21 +01:00
|
|
|
See the [documentation](https://netbox.readthedocs.io/en/stable/installation/6-ldap/#configuration) for possible options.
|
|
|
|
'';
|
2022-12-20 10:19:42 +01:00
|
|
|
example = ''
|
|
|
|
import ldap
|
|
|
|
from django_auth_ldap.config import LDAPSearch, PosixGroupType
|
|
|
|
|
|
|
|
AUTH_LDAP_SERVER_URI = "ldaps://ldap.example.com/"
|
|
|
|
|
|
|
|
AUTH_LDAP_USER_SEARCH = LDAPSearch(
|
|
|
|
"ou=accounts,ou=posix,dc=example,dc=com",
|
|
|
|
ldap.SCOPE_SUBTREE,
|
|
|
|
"(uid=%(user)s)",
|
|
|
|
)
|
|
|
|
|
|
|
|
AUTH_LDAP_GROUP_SEARCH = LDAPSearch(
|
|
|
|
"ou=groups,ou=posix,dc=example,dc=com",
|
|
|
|
ldap.SCOPE_SUBTREE,
|
|
|
|
"(objectClass=posixGroup)",
|
|
|
|
)
|
|
|
|
AUTH_LDAP_GROUP_TYPE = PosixGroupType()
|
|
|
|
|
|
|
|
# Mirror LDAP group assignments.
|
|
|
|
AUTH_LDAP_MIRROR_GROUPS = True
|
|
|
|
|
|
|
|
# For more granular permissions, we can map LDAP groups to Django groups.
|
|
|
|
AUTH_LDAP_FIND_GROUP_PERMS = True
|
|
|
|
'';
|
2022-03-05 19:25:21 +01:00
|
|
|
};
|
2023-08-25 16:30:32 +02:00
|
|
|
keycloakClientSecret = lib.mkOption {
|
|
|
|
type = with lib.types; nullOr path;
|
|
|
|
default = null;
|
|
|
|
description = lib.mdDoc ''
|
|
|
|
File that contains the keycloak client secret.
|
|
|
|
'';
|
|
|
|
};
|
2022-03-05 19:25:21 +01:00
|
|
|
};
|
|
|
|
|
2023-07-31 14:38:26 +02:00
|
|
|
config = lib.mkIf cfg.enable {
|
2022-12-20 10:19:42 +01:00
|
|
|
services.netbox = {
|
2023-07-31 14:38:26 +02:00
|
|
|
plugins = lib.mkIf cfg.enableLdap (ps: [ ps.django-auth-ldap ]);
|
2022-12-20 10:19:42 +01:00
|
|
|
settings = {
|
|
|
|
STATIC_ROOT = staticDir;
|
|
|
|
MEDIA_ROOT = "${cfg.dataDir}/media";
|
|
|
|
REPORTS_ROOT = "${cfg.dataDir}/reports";
|
|
|
|
SCRIPTS_ROOT = "${cfg.dataDir}/scripts";
|
|
|
|
|
2023-07-31 14:39:08 +02:00
|
|
|
GIT_PATH = "${pkgs.gitMinimal}/bin/git";
|
|
|
|
|
2022-12-20 10:19:42 +01:00
|
|
|
DATABASE = {
|
|
|
|
NAME = "netbox";
|
|
|
|
USER = "netbox";
|
|
|
|
HOST = "/run/postgresql";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Redis database settings. Redis is used for caching and for queuing
|
|
|
|
# background tasks such as webhook events. A separate configuration
|
|
|
|
# exists for each. Full connection details are required in both
|
|
|
|
# sections, and it is strongly recommended to use two separate database
|
|
|
|
# IDs.
|
|
|
|
REDIS = {
|
|
|
|
tasks = {
|
|
|
|
URL = "unix://${config.services.redis.servers.netbox.unixSocket}?db=0";
|
|
|
|
SSL = false;
|
|
|
|
};
|
|
|
|
caching = {
|
|
|
|
URL = "unix://${config.services.redis.servers.netbox.unixSocket}?db=1";
|
|
|
|
SSL = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
REMOTE_AUTH_BACKEND = lib.mkIf cfg.enableLdap "netbox.authentication.LDAPBackend";
|
|
|
|
|
|
|
|
LOGGING = lib.mkDefault {
|
|
|
|
version = 1;
|
|
|
|
|
|
|
|
formatters.precise.format = "[%(levelname)s@%(name)s] %(message)s";
|
|
|
|
|
|
|
|
handlers.console = {
|
|
|
|
class = "logging.StreamHandler";
|
|
|
|
formatter = "precise";
|
|
|
|
};
|
|
|
|
|
|
|
|
# log to console/systemd instead of file
|
|
|
|
root = {
|
|
|
|
level = "INFO";
|
|
|
|
handlers = [ "console" ];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
extraConfig = ''
|
|
|
|
with open("${cfg.secretKeyFile}", "r") as file:
|
|
|
|
SECRET_KEY = file.readline()
|
2023-08-25 16:30:32 +02:00
|
|
|
'' + (lib.optionalString (cfg.keycloakClientSecret != null) ''
|
|
|
|
with open("${cfg.keycloakClientSecret}", "r") as file:
|
|
|
|
SOCIAL_AUTH_KEYCLOAK_SECRET = file.readline()
|
|
|
|
'');
|
2022-12-20 10:19:42 +01:00
|
|
|
};
|
2022-11-07 13:58:22 +01:00
|
|
|
|
2022-03-05 19:25:21 +01:00
|
|
|
services.redis.servers.netbox.enable = true;
|
|
|
|
|
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
|
|
|
ensureDatabases = [ "netbox" ];
|
|
|
|
ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "netbox";
|
nixos/postgresql: drop ensurePermissions, fix ensureUsers for postgresql15
Closes #216989
First of all, a bit of context: in PostgreSQL, newly created users don't
have the CREATE privilege on the public schema of a database even with
`ALL PRIVILEGES` granted via `ensurePermissions` which is how most of
the DB users are currently set up "declaratively"[1]. This means e.g. a
freshly deployed Nextcloud service will break early because Nextcloud
itself cannot CREATE any tables in the public schema anymore.
The other issue here is that `ensurePermissions` is a mere hack. It's
effectively a mixture of SQL code (e.g. `DATABASE foo` is relying on how
a value is substituted in a query. You'd have to parse a subset of SQL
to actually know which object are permissions granted to for a user).
After analyzing the existing modules I realized that in every case with
a single exception[2] the UNIX system user is equal to the db user is
equal to the db name and I don't see a compelling reason why people
would change that in 99% of the cases. In fact, some modules would even
break if you'd change that because the declarations of the system user &
the db user are mixed up[3].
So I decided to go with something new which restricts the ways to use
`ensure*` options rather than expanding those[4]. Effectively this means
that
* The DB user _must_ be equal to the DB name.
* Permissions are granted via `ensureDBOwnerhip` for an attribute-set in
`ensureUsers`. That way, the user is actually the owner and can
perform `CREATE`.
* For such a postgres user, a database must be declared in
`ensureDatabases`.
For anything else, a custom state management should be implemented. This
can either be `initialScript`, doing it manual, outside of the module or
by implementing proper state management for postgresql[5], but the
current state of `ensure*` isn't even declarative, but a convergent tool
which is what Nix actually claims to _not_ do.
Regarding existing setups: there are effectively two options:
* Leave everything as-is (assuming that system user == db user == db
name): then the DB user will automatically become the DB owner and
everything else stays the same.
* Drop the `createDatabase = true;` declarations: nothing will change
because a removal of `ensure*` statements is ignored, so it doesn't
matter at all whether this option is kept after the first deploy (and
later on you'd usually restore from backups anyways).
The DB user isn't the owner of the DB then, but for an existing setup
this is irrelevant because CREATE on the public schema isn't revoked
from existing users (only not granted for new users).
[1] not really declarative though because removals of these statements
are simply ignored for instance: https://github.com/NixOS/nixpkgs/issues/206467
[2] `services.invidious`: I removed the `ensure*` part temporarily
because it IMHO falls into the category "manage the state on your
own" (see the commit message). See also
https://github.com/NixOS/nixpkgs/pull/265857
[3] e.g. roundcube had `"DATABASE ${cfg.database.username}" = "ALL PRIVILEGES";`
[4] As opposed to other changes that are considered a potential fix, but
also add more things like collation for DBs or passwords that are
_never_ touched again when changing those.
[5] As suggested in e.g. https://github.com/NixOS/nixpkgs/issues/206467
2023-11-08 12:50:09 +01:00
|
|
|
ensureDBOwnership = true;
|
2022-03-05 19:25:21 +01:00
|
|
|
}
|
|
|
|
];
|
|
|
|
};
|
|
|
|
|
|
|
|
environment.systemPackages = [ netboxManageScript ];
|
|
|
|
|
|
|
|
systemd.targets.netbox = {
|
|
|
|
description = "Target for all NetBox services";
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
after = [ "network-online.target" "redis-netbox.service" ];
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services = let
|
|
|
|
defaultServiceConfig = {
|
|
|
|
WorkingDirectory = "${cfg.dataDir}";
|
|
|
|
User = "netbox";
|
|
|
|
Group = "netbox";
|
|
|
|
StateDirectory = "netbox";
|
|
|
|
StateDirectoryMode = "0750";
|
|
|
|
Restart = "on-failure";
|
2023-06-06 14:53:08 +02:00
|
|
|
RestartSec = 30;
|
2022-03-05 19:25:21 +01:00
|
|
|
};
|
|
|
|
in {
|
|
|
|
netbox = {
|
|
|
|
description = "NetBox WSGI Service";
|
2023-06-06 14:53:08 +02:00
|
|
|
documentation = [ "https://docs.netbox.dev/" ];
|
|
|
|
|
2022-03-05 19:25:21 +01:00
|
|
|
wantedBy = [ "netbox.target" ];
|
2023-06-06 14:53:08 +02:00
|
|
|
|
2023-07-31 14:50:09 +02:00
|
|
|
after = [ "network-online.target" ];
|
2023-06-06 14:53:08 +02:00
|
|
|
wants = [ "network-online.target" ];
|
2022-03-05 19:25:21 +01:00
|
|
|
|
2023-07-31 14:50:09 +02:00
|
|
|
environment.PYTHONPATH = pkg.pythonPath;
|
|
|
|
|
2022-03-05 19:25:21 +01:00
|
|
|
preStart = ''
|
2023-07-31 14:50:09 +02:00
|
|
|
# On the first run, or on upgrade / downgrade, run migrations and related.
|
|
|
|
# This mostly correspond to upstream NetBox's 'upgrade.sh' script.
|
|
|
|
versionFile="${cfg.dataDir}/version"
|
|
|
|
|
|
|
|
if [[ -e "$versionFile" && "$(cat "$versionFile")" == "${cfg.package.version}" ]]; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
${pkg}/bin/netbox migrate
|
2022-03-05 19:25:21 +01:00
|
|
|
${pkg}/bin/netbox trace_paths --no-input
|
|
|
|
${pkg}/bin/netbox collectstatic --no-input
|
|
|
|
${pkg}/bin/netbox remove_stale_contenttypes --no-input
|
2023-07-31 14:50:09 +02:00
|
|
|
# TODO: remove the condition when we remove netbox_3_3
|
|
|
|
${lib.optionalString
|
|
|
|
(lib.versionAtLeast cfg.package.version "3.5.0")
|
|
|
|
"${pkg}/bin/netbox reindex --lazy"}
|
|
|
|
${pkg}/bin/netbox clearsessions
|
|
|
|
${pkg}/bin/netbox clearcache
|
|
|
|
|
|
|
|
echo "${cfg.package.version}" > "$versionFile"
|
2022-03-05 19:25:21 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
serviceConfig = defaultServiceConfig // {
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.python3Packages.gunicorn}/bin/gunicorn netbox.wsgi \
|
|
|
|
--bind ${cfg.listenAddress}:${toString cfg.port} \
|
|
|
|
--pythonpath ${pkg}/opt/netbox/netbox
|
|
|
|
'';
|
2023-06-06 14:53:08 +02:00
|
|
|
PrivateTmp = true;
|
2022-03-05 19:25:21 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
netbox-rq = {
|
|
|
|
description = "NetBox Request Queue Worker";
|
2023-06-06 14:53:08 +02:00
|
|
|
documentation = [ "https://docs.netbox.dev/" ];
|
|
|
|
|
2022-03-05 19:25:21 +01:00
|
|
|
wantedBy = [ "netbox.target" ];
|
|
|
|
after = [ "netbox.service" ];
|
|
|
|
|
2023-06-06 14:53:08 +02:00
|
|
|
environment.PYTHONPATH = pkg.pythonPath;
|
2022-03-05 19:25:21 +01:00
|
|
|
|
|
|
|
serviceConfig = defaultServiceConfig // {
|
|
|
|
ExecStart = ''
|
|
|
|
${pkg}/bin/netbox rqworker high default low
|
|
|
|
'';
|
2023-06-06 14:53:08 +02:00
|
|
|
PrivateTmp = true;
|
2022-03-05 19:25:21 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
netbox-housekeeping = {
|
|
|
|
description = "NetBox housekeeping job";
|
2023-06-06 14:53:08 +02:00
|
|
|
documentation = [ "https://docs.netbox.dev/" ];
|
2022-03-05 19:25:21 +01:00
|
|
|
|
2023-06-06 14:53:08 +02:00
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
2023-07-31 14:50:09 +02:00
|
|
|
after = [ "network-online.target" "netbox.service" ];
|
2023-06-06 14:53:08 +02:00
|
|
|
wants = [ "network-online.target" ];
|
|
|
|
|
|
|
|
environment.PYTHONPATH = pkg.pythonPath;
|
2022-03-05 19:25:21 +01:00
|
|
|
|
|
|
|
serviceConfig = defaultServiceConfig // {
|
|
|
|
Type = "oneshot";
|
|
|
|
ExecStart = ''
|
|
|
|
${pkg}/bin/netbox housekeeping
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.timers.netbox-housekeeping = {
|
|
|
|
description = "Run NetBox housekeeping job";
|
2023-06-06 14:53:08 +02:00
|
|
|
documentation = [ "https://docs.netbox.dev/" ];
|
|
|
|
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
|
|
|
|
2023-07-31 14:50:09 +02:00
|
|
|
after = [ "network-online.target" "netbox.service" ];
|
2023-06-06 14:53:08 +02:00
|
|
|
wants = [ "network-online.target" ];
|
2022-03-05 19:25:21 +01:00
|
|
|
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "daily";
|
2023-06-06 14:53:08 +02:00
|
|
|
AccuracySec = "1h";
|
|
|
|
Persistent = true;
|
2022-03-05 19:25:21 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.netbox = {
|
|
|
|
home = "${cfg.dataDir}";
|
|
|
|
isSystemUser = true;
|
|
|
|
group = "netbox";
|
|
|
|
};
|
|
|
|
users.groups.netbox = {};
|
|
|
|
users.groups."${config.services.redis.servers.netbox.user}".members = [ "netbox" ];
|
|
|
|
};
|
|
|
|
}
|