about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorJaakko Luttinen <jaakko.luttinen@iki.fi>2018-01-02 21:45:42 +0200
committerRobin Gloster <mail@glob.in>2018-01-05 14:47:54 +0100
commit13eaae161006f21ca50821111d70ebaddbc843fc (patch)
treec043bf0e9aa2301726bd477caf991a9294fa9ede /nixos/modules
parentc9b46ccea17ca550932c30e9a72ea979c3fe9f0a (diff)
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.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/misc/ids.nix2
-rw-r--r--nixos/modules/services/web-apps/tt-rss.nix17
2 files changed, 17 insertions, 2 deletions
diff --git a/nixos/modules/misc/ids.nix b/nixos/modules/misc/ids.nix
index c6440dd906fdd..f44d9a7e09dc0 100644
--- a/nixos/modules/misc/ids.nix
+++ b/nixos/modules/misc/ids.nix
@@ -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
diff --git a/nixos/modules/services/web-apps/tt-rss.nix b/nixos/modules/services/web-apps/tt-rss.nix
index 35457a1cdb8f0..a94c71a95dd65 100644
--- a/nixos/modules/services/web-apps/tt-rss.nix
+++ b/nixos/modules/services/web-apps/tt-rss.nix
@@ -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;
+      };
+    };
+
   };
 }