From cdf4ddeda521a4c3d02d459c25180964c1808953 Mon Sep 17 00:00:00 2001 From: Soispha Date: Sun, 14 Jan 2024 13:30:17 +0100 Subject: fix(hm/files/manifest_json): Make the ln idempotent --- hm/soispha/files/manifest_json/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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" + ''; }; }; } -- cgit 1.4.1