about summary refs log tree commit diff
path: root/pkgs/servers/owncast
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2022-07-25 00:02:33 +0200
committerPeder Bergebakken Sundt <pbsds@hotmail.com>2022-07-25 00:09:03 +0200
commitac2d6bef042e817b7c8734a2aca4ffa904996425 (patch)
tree9044924b98628afab841e32b4af6902ac37bf16d /pkgs/servers/owncast
parent3556174c299888c8daa44afef34e9242fe257ad1 (diff)
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.
Diffstat (limited to 'pkgs/servers/owncast')
-rw-r--r--pkgs/servers/owncast/default.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/pkgs/servers/owncast/default.nix b/pkgs/servers/owncast/default.nix
index 313d17e8e8d42..a4dff20d31e11 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"
       )
     '';