summary refs log tree commit diff
diff options
context:
space:
mode:
authorAaron Andersen <aaron@fosslib.net>2019-02-23 17:45:28 -0500
committerAaron Andersen <aaron@fosslib.net>2019-05-25 13:48:41 -0400
commit191e4b075547c46449eaefd23b600d42e76d26e8 (patch)
tree757a933bb8bbefbef05c67ec0b36c9bcbde4b78e
parent73342be85bc28e8ab0e420554a3a5f0b83d164e5 (diff)
downloadnixpkgs-191e4b075547c46449eaefd23b600d42e76d26e8.tar
nixpkgs-191e4b075547c46449eaefd23b600d42e76d26e8.tar.gz
nixpkgs-191e4b075547c46449eaefd23b600d42e76d26e8.tar.bz2
nixpkgs-191e4b075547c46449eaefd23b600d42e76d26e8.tar.lz
nixpkgs-191e4b075547c46449eaefd23b600d42e76d26e8.tar.xz
nixpkgs-191e4b075547c46449eaefd23b600d42e76d26e8.tar.zst
nixpkgs-191e4b075547c46449eaefd23b600d42e76d26e8.zip
nixos/heartbeat: replace deprecated usage of PermissionsStartOnly
see https://github.com/NixOS/nixpkgs/issues/53852
-rw-r--r--nixos/modules/services/logging/heartbeat.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/nixos/modules/services/logging/heartbeat.nix b/nixos/modules/services/logging/heartbeat.nix
index b595ac07bf5..56fb4deabda 100644
--- a/nixos/modules/services/logging/heartbeat.nix
+++ b/nixos/modules/services/logging/heartbeat.nix
@@ -54,16 +54,18 @@ in
 
   config = mkIf cfg.enable {
 
+    systemd.tmpfiles.rules = [
+      "d '${cfg.stateDir}' - nobody nogroup - -"
+    ];
+
     systemd.services.heartbeat = with pkgs; {
       description = "heartbeat log shipper";
       wantedBy = [ "multi-user.target" ];
       preStart = ''
         mkdir -p "${cfg.stateDir}"/{data,logs}
-        chown nobody:nogroup "${cfg.stateDir}"/{data,logs}
       '';
       serviceConfig = {
         User = "nobody";
-        PermissionsStartOnly = true;
         AmbientCapabilities = "cap_net_raw";
         ExecStart = "${pkgs.heartbeat}/bin/heartbeat -c \"${heartbeatYml}\" -path.data \"${cfg.stateDir}/data\" -path.logs \"${cfg.stateDir}/logs\"";
       };