Skip to content

feat: Add delete-old flag to automatically remove old generations#195

Open
jalseth wants to merge 1 commit into
nix-community:mainfrom
jalseth:add-auto-prune
Open

feat: Add delete-old flag to automatically remove old generations#195
jalseth wants to merge 1 commit into
nix-community:mainfrom
jalseth:add-auto-prune

Conversation

@jalseth

@jalseth jalseth commented Feb 18, 2024

Copy link
Copy Markdown

Implements #194.

This is the first Rust I've ever written so if there is a better approach I'm happy to make changes.

Signed-off-by: James Alseth <james@jalseth.me>
Comment thread src/nix/deployment/mod.rs

let host = target.host.as_mut().unwrap();
host.set_job(Some(job.clone()));
host.run_command(&["nix-collect-garbage", "--delete-old"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This deletes all old generations.

Using '--delete-older-than' and requiring the period to be provided via the colmena CLI argument allows for a more fine-grained deletion approach, including deleting all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants