{ stdenv , pkgs }: { binDir , user }: { TtrssPostgresDB , TtrssService }: stdenv.mkDerivation { name = "dbupgrade"; src = pkgs.writeTextDir "wrapper" '' #!/bin/bash -e sudo -u ${user} bash < /tmp/wrapper.lock fi ;; unlock) rm -f /tmp/wrapper.lock ;; esac HERE ''; installPhase = '' mkdir -p $out/bin cp $src/wrapper $out/bin chmod +x $out/bin/* ''; }