From ac2d6bef042e817b7c8734a2aca4ffa904996425 Mon Sep 17 00:00:00 2001 From: Peder Bergebakken Sundt Date: Mon, 25 Jul 2022 00:02:33 +0200 Subject: [PATCH] owncast: Fix statedirectory issue after upgrade The entrypoint script would ensure a symlink to the nix store exists in the state directory. The script would fail when trying to overwrite an existing symlink. Steps to trigger the issue: * Install owncast * Upgrade owncast * Garbage collect the store * Upgrade owncast I chose not to use the -f option in `ln`, as this is more explicit. --- pkgs/servers/owncast/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/servers/owncast/default.nix b/pkgs/servers/owncast/default.nix index 313d17e8e8d4..a4dff20d31e1 100644 --- a/pkgs/servers/owncast/default.nix +++ b/pkgs/servers/owncast/default.nix @@ -30,6 +30,7 @@ buildGoModule rec { ) [ ! -d "$PWD/static" ] && ( + [ -L "$PWD/static" ] && ${coreutils}/bin/rm "$PWD/static" ${coreutils}/bin/ln -s "${placeholder "out"}/static" "$PWD" ) '';