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

devbox: clean up profile history after sync #2449

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Conversation

gcurtis
Copy link
Collaborator

@gcurtis gcurtis commented Dec 12, 2024

After syncing the flake packages to the profile, remove all old generations of the Nix profile. This allows the Nix garbage collector to eventually remove any old packages.

Opted for a Go implementation instead of calling nix profile wipe-history because deleting the history is pretty simple and this is faster.

After syncing the flake packages to the profile, remove all old
generations of the Nix profile. This allows the Nix garbage collector to
eventually remove any old packages.

Opted for a Go implementation instead of calling `nix profile
wipe-history` because deleting the history is pretty simple and this is
faster.
@gcurtis gcurtis requested review from savil and mohsenari December 12, 2024 17:03
Copy link
Collaborator

@mohsenari mohsenari left a comment

Choose a reason for hiding this comment

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

Let's write a couple of unit tests for this as well to make sure regression is caught in the future.

Copy link
Collaborator

@savil savil left a comment

Choose a reason for hiding this comment

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

I feel mixed about re-implementing a nix command, but perf is somewhat persuasive :)

@savil
Copy link
Collaborator

savil commented Dec 12, 2024

to make sure regression is caught in the future.

@mohsenari I don't follow. What regression are you referring to?

@mohsenari
Copy link
Collaborator

to make sure regression is caught in the future.

@mohsenari I don't follow. What regression are you referring to?

@savil I'm talking about potential changes to this function in the future, causing regression

@gcurtis
Copy link
Collaborator Author

gcurtis commented Dec 13, 2024

@mohsenari I added an assertion to a testscripts test to ensure that the history is pruned after adding/removing packages.

@gcurtis gcurtis merged commit 9f43428 into main Dec 13, 2024
29 checks passed
@gcurtis gcurtis deleted the gcurtis/profile-history branch December 13, 2024 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants