-
Notifications
You must be signed in to change notification settings - Fork 0
fix: declutter writable activation artifacts before nix linkGeneration #2323
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,19 @@ let | |||||
| hermesNode = pkgs.nodejs_22; | ||||||
| in | ||||||
| lib.mkIf host.isKyber { | ||||||
| # Clean up writable copies that Hermes activate.sh creates (replacing Nix-managed | ||||||
| # symlinks) so they don't block the next nix-switch's linkGeneration. | ||||||
| home.activation.hermesCleanup = config.lib.dag.entryBefore [ "linkGeneration" ] '' | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cleanup can be scheduled before
Why this matters here: Suggested fix (also applies to home.activation.hermesCleanup = config.lib.dag.entryBetween [ "linkGeneration" ] [ "writeBoundary" ] ''
...
'';
Suggested change
|
||||||
| $DRY_RUN_CMD ${pkgs.bash}/bin/bash -c ' | ||||||
| for f in hermes-gateway.service hermes-dashboard.service hermes-dashboard-proxy.service; do | ||||||
| unit="${homeDir}/.config/systemd/user/$f" | ||||||
| if [ -f "$unit" ] && [ ! -L "$unit" ]; then | ||||||
| rm -f "$unit" | ||||||
| fi | ||||||
| done | ||||||
| ' | ||||||
| ''; | ||||||
|
|
||||||
| home.activation.hermesSetup = config.lib.dag.entryAfter [ "writeBoundary" ] '' | ||||||
| $DRY_RUN_CMD ${pkgs.bash}/bin/bash "${./activate.sh}" "${homeDir}" "${hermesNode}/bin/npm" | ||||||
| ''; | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Darwin path missed.
hydrate.sh:37-41selects~/Library/Application Support/cass/sources.tomlon Darwin and~/.config/cass/sources.tomlelsewhere, and this module is imported unconditionally (home-manager/programs/default.nix:11). The cleanup hard-codes the Linux path, so on macOS it never fires. Today this is defensive-only (sources.toml isn't declared inhome.fileanywhere I could find), but it does mean the migration case thehydrate.shcomment calls out ("Older generations symlinked this file into the Nix store; replace it.") is only handled on Linux.Consider selecting the path from Nix, e.g.: