summary refs log tree commit diff
path: root/nixos/modules/security
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2018-09-29 12:28:54 -0700
committerJamey Sharp <jamey@minilop.net>2018-09-30 11:08:11 -0700
commitae3d3b0fffe4827a7f126368e01fd8c2c8a4c7fe (patch)
treec91f75da97145dd65044b244a3b63876fc236249 /nixos/modules/security
parentbbc0f6f005fa856d914711149838d2f75f9fe41b (diff)
downloadnixlib-ae3d3b0fffe4827a7f126368e01fd8c2c8a4c7fe.tar
nixlib-ae3d3b0fffe4827a7f126368e01fd8c2c8a4c7fe.tar.gz
nixlib-ae3d3b0fffe4827a7f126368e01fd8c2c8a4c7fe.tar.bz2
nixlib-ae3d3b0fffe4827a7f126368e01fd8c2c8a4c7fe.tar.lz
nixlib-ae3d3b0fffe4827a7f126368e01fd8c2c8a4c7fe.tar.xz
nixlib-ae3d3b0fffe4827a7f126368e01fd8c2c8a4c7fe.tar.zst
nixlib-ae3d3b0fffe4827a7f126368e01fd8c2c8a4c7fe.zip
nixos/polkit: use tmpfiles to clean old dirs
These don't need to get cleaned up during activation; that can wait
until systemd-tmpfiles-setup runs.
Diffstat (limited to 'nixos/modules/security')
-rw-r--r--nixos/modules/security/polkit.nix10
1 files changed, 5 insertions, 5 deletions
diff --git a/nixos/modules/security/polkit.nix b/nixos/modules/security/polkit.nix
index 04685f2c9ea1..7f1de81d5b70 100644
--- a/nixos/modules/security/polkit.nix
+++ b/nixos/modules/security/polkit.nix
@@ -88,11 +88,11 @@ in
       "polkit-agent-helper-1".source = "${pkgs.polkit.out}/lib/polkit-1/polkit-agent-helper-1";
     };
 
-    system.activationScripts.polkit =
-      ''
-        # Probably no more needed, clean up
-        rm -rf /var/lib/{polkit-1,PolicyKit}
-      '';
+    systemd.tmpfiles.rules = [
+      # Probably no more needed, clean up
+      "R /var/lib/polkit-1"
+      "R /var/lib/PolicyKit"
+    ];
 
     users.users.polkituser = {
       description = "PolKit daemon";