Skip to content

nixos/logrotate: Add options for basic paths#87702

Merged
ryantm merged 3 commits intoNixOS:masterfrom
jslight90:logrotate
May 19, 2020
Merged

nixos/logrotate: Add options for basic paths#87702
ryantm merged 3 commits intoNixOS:masterfrom
jslight90:logrotate

Conversation

@jslight90
Copy link
Contributor

Motivation for this change

Add basic options for rotating paths.

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.

@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/` labels May 12, 2020
@ofborg ofborg bot added 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 May 12, 2020
Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

Looks fine, just some minor points I thought of which you're free to take or leave 👍. Out of curiosity what motivated you to go with an attribute set over a list for options?

@jslight90
Copy link
Contributor Author

Out of curiosity what motivated you to go with an attribute set over a list for options?

Formatting; In order to use the path as a key in the options. I could also use list or attrset.

@aanderse
Copy link
Member

You're good with giving up control over sort order? I can't recall if that would be important at all... 🤔

@jslight90 jslight90 force-pushed the logrotate branch 2 times, most recently from f5a452b to 9b93cd7 Compare May 13, 2020 19:16
@jslight90
Copy link
Contributor Author

You're good with giving up control over sort order? I can't recall if that would be important at all... 🤔

I changed attrsOf to loaOf in case order was important.

@aanderse
Copy link
Member

See #63103

@jslight90
Copy link
Contributor Author

Okay. Does the order matter? I can make it a list or attribute set.

@jslight90
Copy link
Contributor Author

I found this on the logrotate man page so I'll change it to a list of submodules:

Later config files may override the options given in earlier files, so the order in which the logrotate config files are listed is important.

@jslight90 jslight90 force-pushed the logrotate branch 2 times, most recently from 22dccca to 8865e4b Compare May 13, 2020 20:43
@jslight90
Copy link
Contributor Author

I updated the description to say list of attribute sets.

Copy link
Member

@aanderse aanderse left a comment

Choose a reason for hiding this comment

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

Looking good 👍 We could actually start using this internally given the ability to override 🎉

I'll test this out in the next few days. Thanks!

Co-authored-by: Ryan Mulligan <ryan@ryantm.com>
@ryantm ryantm merged commit 6466678 into NixOS:master May 19, 2020
@ryantm
Copy link
Member

ryantm commented May 19, 2020

@aanderse, we are still interested in your feedback. jslight90 and I've been using something like this for a while though, so I went ahead and merged it.

@aanderse
Copy link
Member

@ryantm sorry I got tied up and this sorta dropped off my radar... Thanks! Looking forward to using it 🎉

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.

3 participants