diff --git a/nixos/modules/services/logging/logrotate.nix b/nixos/modules/services/logging/logrotate.nix index 8dfece8109d3..7e32296c7909 100644 --- a/nixos/modules/services/logging/logrotate.nix +++ b/nixos/modules/services/logging/logrotate.nix @@ -5,7 +5,7 @@ with lib; let cfg = config.services.logrotate; - pathOpts = { name, ... }: { + pathOpts = { name, ... }: { options = { enable = mkOption { type = types.bool; @@ -98,8 +98,8 @@ let paths = sortProperties (attrValues (filterAttrs (_: pathOpts: pathOpts.enable) cfg.paths)); configText = concatStringsSep "\n" ( - [ "missingok" "notifempty" cfg.extraConfig ] ++ (map mkConf paths) - ); + [ "missingok" "notifempty" cfg.extraConfig ] ++ (map mkConf paths) + ); configFile = pkgs.writeText "logrotate.conf" configText; mailOption = @@ -124,7 +124,7 @@ in paths = mkOption { type = with types; attrsOf (submodule pathOpts); - default = {}; + default = { }; description = '' Attribute set of paths to rotate. The order each block appears in the generated configuration file can be controlled by the priority option @@ -163,13 +163,16 @@ in }; config = mkIf cfg.enable { - assertions = mapAttrsToList (name: pathOpts: - { assertion = (pathOpts.user != null) == (pathOpts.group != null); - message = '' - If either of `services.logrotate.paths.${name}.user` or `services.logrotate.paths.${name}.group` are specified then *both* must be specified. - ''; - } - ) cfg.paths; + assertions = mapAttrsToList + (name: pathOpts: + { + assertion = (pathOpts.user != null) == (pathOpts.group != null); + message = '' + If either of `services.logrotate.paths.${name}.user` or `services.logrotate.paths.${name}.group` are specified then *both* must be specified. + ''; + } + ) + cfg.paths; systemd.services.logrotate = { description = "Logrotate Service";