Loading nixos/modules/services/logging/logrotate.nix +22 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ with lib; let cfg = config.services.logrotate; inherit (config.users) groups; pathOpts = { name, ... }: { options = { Loading @@ -23,6 +24,8 @@ let path = mkOption { type = with types; either str (listOf str); default = name; defaultText = "attribute name"; description = '' The path to log files to be rotated. Spaces are allowed and normal shell quoting rules apply, Loading Loading @@ -160,6 +163,25 @@ in } ) cfg.paths; services.logrotate = { paths = { "/var/log/btmp" = { frequency = mkDefault "monthly"; keep = mkDefault 1; extraConfig = '' create 0660 root ${groups.utmp.name} ''; }; "/var/log/wtmp" = { frequency = mkDefault "monthly"; keep = mkDefault 1; extraConfig = '' create 0664 root ${groups.utmp.name} ''; }; }; }; systemd.services.logrotate = { description = "Logrotate Service"; wantedBy = [ "multi-user.target" ]; Loading Loading
nixos/modules/services/logging/logrotate.nix +22 −0 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ with lib; let cfg = config.services.logrotate; inherit (config.users) groups; pathOpts = { name, ... }: { options = { Loading @@ -23,6 +24,8 @@ let path = mkOption { type = with types; either str (listOf str); default = name; defaultText = "attribute name"; description = '' The path to log files to be rotated. Spaces are allowed and normal shell quoting rules apply, Loading Loading @@ -160,6 +163,25 @@ in } ) cfg.paths; services.logrotate = { paths = { "/var/log/btmp" = { frequency = mkDefault "monthly"; keep = mkDefault 1; extraConfig = '' create 0660 root ${groups.utmp.name} ''; }; "/var/log/wtmp" = { frequency = mkDefault "monthly"; keep = mkDefault 1; extraConfig = '' create 0664 root ${groups.utmp.name} ''; }; }; }; systemd.services.logrotate = { description = "Logrotate Service"; wantedBy = [ "multi-user.target" ]; Loading