summary refs log tree commit diff
path: root/nixos/modules/services/system/uptimed.nix
diff options
context:
space:
mode:
authorArtturin <Artturin@artturin.com>2021-07-22 07:39:18 +0300
committerArtturin <Artturin@artturin.com>2021-07-31 01:05:44 +0300
commitbd8eeec9c0e8993c82ad8441867a5ea3fd0a87df (patch)
tree9d9fc631551625e525ee5bbaadaf116fea04b4c9 /nixos/modules/services/system/uptimed.nix
parentecc968543c6d2911303f32ad92b354661a0663d9 (diff)
downloadnixpkgs-bd8eeec9c0e8993c82ad8441867a5ea3fd0a87df.tar
nixpkgs-bd8eeec9c0e8993c82ad8441867a5ea3fd0a87df.tar.gz
nixpkgs-bd8eeec9c0e8993c82ad8441867a5ea3fd0a87df.tar.bz2
nixpkgs-bd8eeec9c0e8993c82ad8441867a5ea3fd0a87df.tar.lz
nixpkgs-bd8eeec9c0e8993c82ad8441867a5ea3fd0a87df.tar.xz
nixpkgs-bd8eeec9c0e8993c82ad8441867a5ea3fd0a87df.tar.zst
nixpkgs-bd8eeec9c0e8993c82ad8441867a5ea3fd0a87df.zip
{uptimed,nixos/uptimed}: switch to /var/lib/ and fix perms
Diffstat (limited to 'nixos/modules/services/system/uptimed.nix')
-rw-r--r--nixos/modules/services/system/uptimed.nix10
1 files changed, 7 insertions, 3 deletions
diff --git a/nixos/modules/services/system/uptimed.nix b/nixos/modules/services/system/uptimed.nix
index 1e256c51408..67a03876e19 100644
--- a/nixos/modules/services/system/uptimed.nix
+++ b/nixos/modules/services/system/uptimed.nix
@@ -4,7 +4,7 @@ with lib;
 
 let
   cfg = config.services.uptimed;
-  stateDir = "/var/spool/uptimed";
+  stateDir = "/var/lib/uptimed";
 in
 {
   options = {
@@ -21,12 +21,16 @@ in
   };
 
   config = mkIf cfg.enable {
+
+    environment.systemPackages = [ pkgs.uptimed ];
+
     users.users.uptimed = {
       description = "Uptimed daemon user";
       home        = stateDir;
-      createHome  = true;
       uid         = config.ids.uids.uptimed;
+      group       = "uptimed";
     };
+    users.groups.uptimed = {};
 
     systemd.services.uptimed = {
       unitConfig.Documentation = "man:uptimed(8) man:uprecords(1)";
@@ -41,7 +45,7 @@ in
         PrivateTmp              = "yes";
         PrivateNetwork          = "yes";
         NoNewPrivileges         = "yes";
-        ReadWriteDirectories    = stateDir;
+        StateDirectory          = [ "uptimed" ];
         InaccessibleDirectories = "/home";
         ExecStart               = "${pkgs.uptimed}/sbin/uptimed -f -p ${stateDir}/pid";
       };