diff --git a/src/modules/services/postgres.nix b/src/modules/services/postgres.nix index 444072b7a..2cb5ebf59 100644 --- a/src/modules/services/postgres.nix +++ b/src/modules/services/postgres.nix @@ -99,8 +99,7 @@ let echo "PostgreSQL is setting up the initial database." echo OLDPGHOST="$PGHOST" - PGHOST="$DEVENV_STATE/$(mktemp -d "pg-init-XXXXXX")" - mkdir -p "$PGHOST" + PGHOST=$(mktemp -d "$DEVENV_STATE/pg-init-XXXXXX") function remove_tmp_pg_init_sock_dir() { if [[ -d "$1" ]]; then diff --git a/src/modules/top-level.nix b/src/modules/top-level.nix index 4f5ecc2f1..376d1bbe5 100644 --- a/src/modules/top-level.nix +++ b/src/modules/top-level.nix @@ -230,8 +230,10 @@ in fi mkdir -p .devenv - rm -f .devenv/profile - ln -s ${profile} .devenv/profile + if [ ! -L .devenv/profile ] || [ "$(${pkgs.coreutils}/bin/readlink .devenv/profile)" != "${profile}" ] + then + ln -nsf ${profile} .devenv/profile + fi unset ${lib.concatStringsSep " " config.unsetEnvVars} '';