Skip to content

nixos/logrotate: Copy configFile to /etc, remove option#512581

Open
m1cr0man wants to merge 1 commit intoNixOS:masterfrom
m1cr0man:rfc108-logrotate
Open

nixos/logrotate: Copy configFile to /etc, remove option#512581
m1cr0man wants to merge 1 commit intoNixOS:masterfrom
m1cr0man:rfc108-logrotate

Conversation

@m1cr0man
Copy link
Copy Markdown
Contributor

@m1cr0man m1cr0man commented Apr 22, 2026

Part of breaking up #216025

When running logrotate in a user namespaced environment, such as an nspawn container with PrivateUsers=pick, logrotate may refuse to start as its config file is not owned by root.

Using environment.etc we can copy the file from the store and set the proper permissions during activation.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@m1cr0man m1cr0man self-assigned this Apr 22, 2026
@m1cr0man m1cr0man requested review from Izorkin, ajs124 and mweinelt April 25, 2026 12:37
Comment thread nixos/modules/services/logging/logrotate.nix Outdated
@m1cr0man m1cr0man changed the title nixos/logrotate: Copy default configFile to /etc nixos/logrotate: Copy configFile to /etc, remove option Apr 26, 2026
Comment thread nixos/modules/services/logging/logrotate.nix Outdated
@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Apr 26, 2026
When running logrotate in a user namespaced environment, such as
an nspawn container with PrivateUsers=pick, logrotate may refuse to
start as its config file is not owned by root.

Using environment.etc we can copy the file from the store and
set the proper permissions during activation.

As such, there is much less utility in being able to configure the
configFile path now, and `include` directives supported in the
program's own config schema would suffice for including extra config
outside of the NixOS module.
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: changelog This PR adds or changes release notes 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: documentation This PR adds or changes documentation labels Apr 28, 2026
@m1cr0man
Copy link
Copy Markdown
Contributor Author

After rebasing on master with #512584 merged, the CI checks are now passing 🙂

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: changelog This PR adds or changes release notes 8.has: documentation This PR adds or changes documentation 8.has: module (update) This PR changes an existing module in `nixos/` 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants