Skip to content

nix-gc: rename frequency to dates #7670

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aguirre-matteo
Copy link
Member

@aguirre-matteo aguirre-matteo commented Aug 13, 2025

Description

This PR renames the nix.gc.frequency option to nix.gc.dates to match upstream NixOS' module. Closes #5106.

Checklist

  • Change is backwards compatible.

  • Code formatted with nix fmt or
    nix-shell -p treefmt nixfmt deadnix keep-sorted --run treefmt.

  • Code tested through nix run .#tests -- test-all or
    nix-shell --pure tests -A run.all.

  • Test cases updated/added. See
    example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and
    recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See
      example.
    • Generate a news entry. See
      News
    • Basic tests added. See
      Tests
  • If this PR adds an exciting new feature or contains a breaking change.

    • Generate a news entry. See
      News

@aguirre-matteo aguirre-matteo force-pushed the rename-nix-gc branch 3 times, most recently from 1f9f513 to 75d8380 Compare August 14, 2025 16:52
@aguirre-matteo
Copy link
Member Author

As far I can see, the old module used mkCalendarInterval to obtain StartCalendarInterval so I think the module expects to receive a single string, so I added assertions to ensure nix.gc.dates contains only one element.

Comment on lines +37 to +38
type = with types; either singleLineStr (listOf str);
apply = lib.toList;
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe:

Suggested change
type = with types; either singleLineStr (listOf str);
apply = lib.toList;
type = with types; coercedTo str lib.toList (listOf str);

Copy link
Member Author

Choose a reason for hiding this comment

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

I did the above because the NixOS module does it that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New option: nix.gc.dates alias for nix.gc.frequency
3 participants