diff options
author | Soispha <soispha@vhack.eu> | 2024-01-14 13:30:17 +0100 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2024-01-14 13:30:17 +0100 |
commit | cdf4ddeda521a4c3d02d459c25180964c1808953 (patch) | |
tree | 4f33d39bf2905253bb8d8e6b830cee4e29e3e33f | |
parent | fix(sys/nixpkgs/ytc): Check if symlink path exists (diff) | |
download | nixos-config-cdf4ddeda521a4c3d02d459c25180964c1808953.tar.gz nixos-config-cdf4ddeda521a4c3d02d459c25180964c1808953.zip |
fix(hm/files/manifest_json): Make the ln idempotent
-rw-r--r-- | hm/soispha/files/manifest_json/default.nix | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hm/soispha/files/manifest_json/default.nix b/hm/soispha/files/manifest_json/default.nix index abc2e065..af8d85d2 100644 --- a/hm/soispha/files/manifest_json/default.nix +++ b/hm/soispha/files/manifest_json/default.nix @@ -7,7 +7,10 @@ activation = { addManifestJson = lib.hm.dag.entryAfter ["writeBoundary"] - ''$DRY_RUN_CMD ln -s $VERBOSE_ARG "${./profile}" "${config.xdg.stateHome}/nix/profiles/"''; + '' + [ -L "${config.xdg.stateHome}/nix/profiles/profile" ] && $DRY_RUN_CMD rm $VERBOSE_ARG "${config.xdg.stateHome}/nix/profiles/profile" + $DRY_RUN_CMD ln -s $DRY_RUN_CMD "${./profile}" "${config.xdg.stateHome}/nix/profiles/profile" + ''; }; }; } |