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: Add options for basic paths #87702

Merged
merged 3 commits into from May 19, 2020
Merged

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.

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?

nixos/modules/services/logging/logrotate.nix Show resolved Hide resolved
nixos/modules/services/logging/logrotate.nix Outdated Show resolved Hide resolved
nixos/modules/services/logging/logrotate.nix Outdated Show resolved Hide resolved
nixos/modules/services/logging/logrotate.nix Outdated Show resolved Hide resolved
nixos/modules/services/logging/logrotate.nix Outdated Show resolved Hide resolved
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants