nixos/service.tt-rss: use tt_rss user

- Add tt_rss system user.
- Use tt_rss as the user by default.
- Create tt_rss user and group automatically if used.
This commit is contained in:
Jaakko Luttinen 2018-01-02 21:45:42 +02:00 committed by Robin Gloster
parent c9b46ccea1
commit 13eaae1610
2 changed files with 17 additions and 2 deletions

View File

@ -301,6 +301,7 @@
pykms = 282;
kodi = 283;
restya-board = 284;
tt_rss = 285;
# When adding a uid, make sure it doesn't match an existing gid. And don't use uids above 399!
@ -570,6 +571,7 @@
pykms = 282;
kodi = 283;
restya-board = 284;
tt_rss = 285;
# When adding a gid, make sure it doesn't match an existing
# uid. Users and groups with the same name should have equal

View File

@ -99,8 +99,8 @@ let
user = mkOption {
type = types.str;
default = "nginx";
example = "nginx";
default = "tt_rss";
example = "tt_rss";
description = ''
User account under which both the update daemon and the web-application run.
'';
@ -553,5 +553,18 @@ let
requires = ["${dbService}"];
after = ["network.target" "${dbService}"];
};
users = optionalAttrs (cfg.user == "tt_rss") {
extraUsers = singleton {
name = "tt_rss";
group = "tt_rss";
uid = config.ids.uids.tt_rss;
};
extraGroups = singleton {
name = "tt_rss";
gid = config.ids.gids.tt_rss;
};
};
};
}