This commit is contained in:
2023-12-05 12:27:09 +01:00
parent 85cdde777b
commit 9e0624eaf1
2 changed files with 31 additions and 9 deletions

View File

@@ -1,8 +1,31 @@
{ lib, ... }:
{ {
options.cids = {
uids = lib.mkOption {
readOnly = true;
description = lib.mdDoc ''
The user IDs used for containers.
'';
type = lib.types.attrsOf types.int;
};
gids = lib.mkOption {
readOnly = true;
description = lib.mdDoc ''
The group IDs used for containers.
'';
type = lib.types.attrsOf types.int;
};
};
config = {
cids = {
uids = { uids = {
unbound = 10001; unbound = 10001;
}; };
gids = { gids = {
unbound = 10001; unbound = 10001;
}; };
};
};
} }

View File

@@ -1,6 +1,5 @@
{ config, ... }: { config, ... }:
let let
cids = import [../modules/staticids.nix];
domain = "ns.cloonar.com"; domain = "ns.cloonar.com";
cfg = { cfg = {
server = { server = {
@@ -134,10 +133,10 @@ in {
users.users.unbound = { users.users.unbound = {
group = "unbound"; group = "unbound";
isSystemUser = true; isSystemUser = true;
uid = cids.uids.unbound; uid = config.cids.uids.unbound;
}; };
users.groups.unbound = { users.groups.unbound = {
gid = cids.gids.unbound; gid = config.cids.gids.unbound;
}; };
security.acme.certs."${domain}" = { security.acme.certs."${domain}" = {
@@ -176,10 +175,10 @@ in {
users.users.unbound = { users.users.unbound = {
group = "unbound"; group = "unbound";
isSystemUser = true; isSystemUser = true;
uid = cids.uids.unbound; uid = config.cids.uids.unbound;
}; };
users.groups.unbound = { users.groups.unbound = {
gid = cids.gids.unbound; gid = config.cids.gids.unbound;
}; };
services.unbound = { services.unbound = {
enable = true; enable = true;