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

jslight90 commented May 12, 2020

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
Contributor

aanderse left a comment

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 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

jslight90 commented May 13, 2020

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
Contributor

aanderse commented May 13, 2020

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 jslight90:logrotate branch from 1e7c667 to 4f51cb8 May 13, 2020
@jslight90 jslight90 force-pushed the jslight90:logrotate branch 2 times, most recently from f5a452b to 9b93cd7 May 13, 2020
@jslight90
Copy link
Contributor Author

jslight90 commented May 13, 2020

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
Contributor

aanderse commented May 13, 2020

See #63103

@jslight90
Copy link
Contributor Author

jslight90 commented May 13, 2020

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

@jslight90
Copy link
Contributor Author

jslight90 commented May 13, 2020

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 jslight90:logrotate branch 2 times, most recently from 22dccca to 8865e4b May 13, 2020
@jslight90
Copy link
Contributor Author

jslight90 commented May 13, 2020

I updated the description to say list of attribute sets.

Copy link
Contributor

aanderse left a comment

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!

@jslight90 jslight90 force-pushed the jslight90:logrotate branch from 8865e4b to 90ce7f5 May 13, 2020
nixos/modules/services/logging/logrotate.nix Outdated Show resolved Hide resolved
Co-authored-by: Ryan Mulligan <ryan@ryantm.com>
@ryantm
ryantm approved these changes May 19, 2020
@ryantm ryantm merged commit 6466678 into NixOS:master May 19, 2020
14 checks passed
14 checks passed
Evaluation Performance Report Evaluator Performance Report
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fe07ade"; rev="fe07adef7f4a4053a32d61351f0bc5f2ecbb3a80"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fe07ade"; rev="fe07adef7f4a4053a32d61351f0bc5f2ecbb3a80"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fe07ade"; rev="fe07adef7f4a4053a32d61351f0bc5f2ecbb3a80"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fe07ade"; rev="fe07adef7f4a4053a32d61351f0bc5f2ecbb3a80"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fe07ade"; rev="fe07adef7f4a4053a32d61351f0bc5f2ecbb3a80"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fe07ade"; rev="fe07adef7f4a4053a32d61351f0bc5f2ecbb3a80"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="fe07ade"; rev="fe07adef7f4a4053a32d61351f0bc5f2ecbb3a80"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
@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
Contributor

aanderse commented May 19, 2020

@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
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.