diff options
author | lassulus <lassulus@lassul.us> | 2021-12-28 22:20:54 +0100 |
---|---|---|
committer | lassulus <lassulus@lassul.us> | 2021-12-28 22:20:54 +0100 |
commit | 2a47990f16935d909930c9dd1ed6f8f2982df638 (patch) | |
tree | 12c7860ad47f78e7a8a058a4b533b9e00626c2e6 /krebs | |
parent | ece4724625312f027f5721dc0135b7eedb2c4e15 (diff) |
ergo: use DynamicUser
Diffstat (limited to 'krebs')
-rw-r--r-- | krebs/3modules/ergo.nix | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/krebs/3modules/ergo.nix b/krebs/3modules/ergo.nix index 14f85c4d7..df9757db0 100644 --- a/krebs/3modules/ergo.nix +++ b/krebs/3modules/ergo.nix @@ -50,7 +50,7 @@ in }; }; datastore = { - path = "${cfg.statedir}/ircd.db"; + path = "/var/lib/ergo/ircd.db"; }; accounts = { authentication-enabled = true; @@ -75,30 +75,6 @@ in }; }; - statedir = mkOption { - type = types.path; - default = "/var/lib/ergo"; - description = '' - Location of the state directory of ergo. - ''; - }; - - user = mkOption { - type = types.str; - default = "ergo"; - description = '' - Ergo IRC daemon user. - ''; - }; - - group = mkOption { - type = types.str; - default = "ergo"; - description = '' - Ergo IRC daemon group. - ''; - }; - }; }; @@ -107,28 +83,14 @@ in ###### implementation config = mkIf cfg.enable ({ - users.users.${cfg.user} = { - description = "Ergo IRC daemon user"; - uid = config.ids.uids.ircd; - group = cfg.group; - }; - - users.groups.${cfg.group} = { - gid = config.ids.gids.ircd; - }; - - systemd.tmpfiles.rules = [ - "d ${cfg.statedir} - ${cfg.user} ${cfg.group} - -" - ]; systemd.services.ergo = { description = "Ergo IRC daemon"; wantedBy = [ "multi-user.target" ]; serviceConfig = { - ExecStartPre = "${ergo}/bin/ergo initdb --conf ${configFile}"; ExecStart = "${ergo}/bin/ergo run --conf ${configFile}"; - Group = cfg.group; - User = cfg.user; + DynamicUser = true; + StateDirectory = "ergo"; }; }; |