Skip to content

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

Merged
aanderse merged 2 commits intoNixOS:masterfrom
aanderse:logrotate
Aug 21, 2020
Merged

nixos/logrotate: switch paths option type from listOf to attrsOf#95809
aanderse merged 2 commits intoNixOS:masterfrom
aanderse:logrotate

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 aanderse requested a review from ryantm August 19, 2020 16:48
@aanderse aanderse force-pushed the logrotate branch 3 times, most recently from 381e3c8 to 62c1b13 Compare August 19, 2020 17:38
@ofborg ofborg bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Aug 20, 2020
@aanderse aanderse marked this pull request as ready for review August 20, 2020 11:04
@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?

@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

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants