Use group/user option for Radicale

This commit is contained in:
Pim Kunis 2025-01-04 23:23:41 +01:00
parent e7ddf543c8
commit fe960448c6
3 changed files with 12 additions and 6 deletions

View file

@ -687,16 +687,16 @@
"treefmt-nix": "treefmt-nix_2"
},
"locked": {
"lastModified": 1735985475,
"narHash": "sha256-7blkWqfcvYKfaL2hpy/nWTooHRfJSqaO0a2+XWccqkE=",
"lastModified": 1736029062,
"narHash": "sha256-7X65+TP0luFpQsA6KV80R05qnWp7NxMaIDryFfJ4MqI=",
"owner": "pizzapim",
"repo": "NixNG",
"rev": "dea65c6a83945c755b9d0097aa2535991daeb907",
"rev": "6211c11d7ef2cc8067efcd169e0b8fd02f1816b6",
"type": "github"
},
"original": {
"owner": "pizzapim",
"ref": "kubernetes",
"ref": "dinit-fixes",
"repo": "NixNG",
"type": "github"
}

View file

@ -36,7 +36,7 @@
};
nixng = {
url = "github:pizzapim/NixNG/kubernetes";
url = "github:pizzapim/NixNG/dinit-fixes";
inputs.nixpkgs.follows = "nixpkgs";
};

View file

@ -51,12 +51,17 @@ in {
in {
init.services.radicale = {
enabled = true;
user = lib.mkDefault "radicale";
group = lib.mkDefault "radicale";
script = pkgs.writeShellScript "radicale-run" ''
chpst -u ${cfg.user}:${cfg.group} ${cfg.package}/bin/radicale \
${cfg.package}/bin/radicale \
--config ${configFile}
'';
};
environment.systemPackages = [cfg.package];
users.users.${cfg.user} = nglib.mkDefaultRec {
description = "radicale";
group = cfg.group;
@ -65,6 +70,7 @@ in {
useDefaultShell = true;
uid = config.ids.uids.radicale;
};
users.groups.${cfg.group} = nglib.mkDefaultRec {gid = config.ids.gids.radicale;};
ids = {