about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorworldofpeace <worldofpeace@protonmail.ch>2019-06-19 08:38:03 -0400
committerGitHub <noreply@github.com>2019-06-19 08:38:03 -0400
commitd672ceeb68bb0896410f7a7c7a068a8bb7403c64 (patch)
tree4cb1c722756c5820d85a7e7b7c35eced0d6ca614 /nixos
parentde3935898ff44bd24cde844869cd38fad4aee0cd (diff)
parent0073c1fb0b4d230a305f703f2e2056b432c64cf6 (diff)
downloadnixlib-d672ceeb68bb0896410f7a7c7a068a8bb7403c64.tar
nixlib-d672ceeb68bb0896410f7a7c7a068a8bb7403c64.tar.gz
nixlib-d672ceeb68bb0896410f7a7c7a068a8bb7403c64.tar.bz2
nixlib-d672ceeb68bb0896410f7a7c7a068a8bb7403c64.tar.lz
nixlib-d672ceeb68bb0896410f7a7c7a068a8bb7403c64.tar.xz
nixlib-d672ceeb68bb0896410f7a7c7a068a8bb7403c64.tar.zst
nixlib-d672ceeb68bb0896410f7a7c7a068a8bb7403c64.zip
Merge pull request #63204 from michaelpj/imp/localtime-upstream
localtime: use upstream unit, fix polkit rules
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/system/localtime.nix31
1 files changed, 7 insertions, 24 deletions
diff --git a/nixos/modules/services/system/localtime.nix b/nixos/modules/services/system/localtime.nix
index 8e9286b94078..04595fc82fbb 100644
--- a/nixos/modules/services/system/localtime.nix
+++ b/nixos/modules/services/system/localtime.nix
@@ -28,33 +28,16 @@ in {
       };
     };
 
-    # so polkit will pick up the rules
-    environment.systemPackages = [ pkgs.localtime ];
-
-    users.users = [{
-      name = "localtimed";
-      description = "Taskserver user";
-    }];
+    # We use the 'out' output, since localtime has its 'bin' output
+    # first, so that is what we get if we use the derivation bare.
+    # Install the polkit rules.
+    environment.systemPackages = [ pkgs.localtime.out ];
+    # Install the systemd unit.
+    systemd.packages = [ pkgs.localtime.out ];
 
     systemd.services.localtime = {
-      description = "localtime service";
       wantedBy = [ "multi-user.target" ];
-      partOf = [ "geoclue.service "];
-
-      serviceConfig = {
-        Restart                 = "on-failure";
-        # TODO: make it work with dbus
-        #DynamicUser             = true;
-        Nice                    = 10;
-        User                    = "localtimed";
-        PrivateTmp              = "yes";
-        PrivateDevices          = true;
-        PrivateNetwork          = "yes";
-        NoNewPrivileges         = "yes";
-        ProtectSystem           = "strict";
-        ProtectHome             = true;
-        ExecStart               = "${pkgs.localtime}/bin/localtimed";
-      };
+      serviceConfig.Restart = "on-failure";
     };
   };
 }