Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nixos/logrotate: switch paths option type from listOf to attrsOf #95809

Merged
merged 2 commits into from Aug 21, 2020

Conversation

aanderse
Copy link
Member

@aanderse aanderse commented Aug 19, 2020

Motivation for this change

#87702

It was a really bad idea for me to suggest @jslight90 to use a listOf instead of attrsOf for the paths option. I upgraded a server to unstable and tried this out... attrsOf is a much better fit when given a priority option to control sort order.

With this PR NixOS modules can actually start providing log rotation for (the very few) services that actually need it using logrotate. The user remains in full control with the ability to even disable log rotation via the enable option, like so:

services.logrotate.paths.httpd.enable = false;
Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@aanderse
Copy link
Member Author

@infinisil we had a small conversation about this module and I always appreciate/enjoy your reviews... would you mind taking a look at this?

nixos/modules/services/logging/logrotate.nix Outdated Show resolved Hide resolved
nixos/modules/services/logging/logrotate.nix Show resolved Hide resolved
nixos/modules/services/logging/logrotate.nix Show resolved Hide resolved
nixos/modules/services/logging/logrotate.nix Outdated Show resolved Hide resolved
@aanderse
Copy link
Member Author

Thanks for your review @infinisil. I have made a few fixes/additions as per your comments. I have also addressed some of the comments which I think might not be the best direction for this module. Please let me know your thoughts.

Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first commit looks good now, but I can't really comment much on the second one as I don't know a lot about httpd. If you think the second one won't cause any problems then feel free to merge it :)

Copy link
Member

@ryantm ryantm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

@aanderse aanderse changed the title nixos/logrotate: switch paths option type from listOf to attrsOf (submodule ...) nixos/logrotate: switch paths option type from listOf to attrsOf Aug 21, 2020
@aanderse aanderse merged commit 4df8370 into NixOS:master Aug 21, 2020
@aanderse aanderse deleted the logrotate branch August 21, 2020 21:31
@aanderse
Copy link
Member Author

ping @dasj19 just as an FYI (06d17ca).

@zowoq
Copy link
Contributor

zowoq commented Aug 21, 2020

This seems to have broken the nixos manual: https://hydra.nixos.org/build/125616472/nixlog/5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants