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

feat: create a GC root for the generated .pre-commit-config.yaml #489

Merged
merged 1 commit into from
Aug 27, 2024

Conversation

sandydoo
Copy link
Member

Fixes #483.
Fixes #161.

@sandydoo sandydoo added the enhancement New feature or request label Aug 24, 2024
@sandydoo sandydoo force-pushed the add-gc-root branch 2 times, most recently from 6565e26 to fc20936 Compare August 24, 2024 16:41
@sandydoo sandydoo marked this pull request as ready for review August 27, 2024 09:15
@sandydoo sandydoo requested a review from domenkozar August 27, 2024 09:15
@@ -351,7 +361,11 @@ in
echo 1>&2 " 2. remove .pre-commit-config.yaml"
echo 1>&2 " 3. add .pre-commit-config.yaml to .gitignore"
else
ln -fs ${configFile} "''${GIT_WC}/.pre-commit-config.yaml"
if ${boolToString cfg.addGcRoot}; then
nix-store --add-root "''${GIT_WC}/.pre-commit-config.yaml" --indirect --realise ${configFile}
Copy link
Member

Choose a reason for hiding this comment

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

Why doesn't it symlink in this case?

Copy link
Member Author

Choose a reason for hiding this comment

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

The nix-store command creates the symlink. The result is the same as ln -s + registering the GC root with Nix.

@domenkozar domenkozar merged commit 1cd12de into master Aug 27, 2024
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants