remove env go brrr
This commit is contained in:
parent
433a613a33
commit
01c381276b
14
.remoteenv
14
.remoteenv
@ -6,8 +6,18 @@ flake_shell=.#remoteenv
|
||||
if [[ ! -f /run/current-system/nixos-version ]]; then
|
||||
flake_shell+=-fhs
|
||||
fi
|
||||
eval "$(nix print-dev-env "$flake_shell")"
|
||||
unset flake_shell
|
||||
|
||||
# `test A -nt B` deferences symlinks
|
||||
t1=$(stat --format=%Z flake.nix 2>/dev/null || printf 0)
|
||||
t2=$(stat --format=%Z flake.lock 2>/dev/null || printf 0)
|
||||
t3=$(stat --format=%Z .direnv/flake-remote-devshell-profile 2>/dev/null || printf 0)
|
||||
if [[ "$t1" -gt "$t3" || "$t2" -gt "$t3" ]]; then
|
||||
mkdir -p .direnv/
|
||||
eval "$(nix --extra-experimental-features "nix-command flakes" print-dev-env --profile ".direnv/flake-remote-devshell-profile" "$flake_shell")"
|
||||
else
|
||||
eval "$(nix --extra-experimental-features "nix-command flakes" print-dev-env ".direnv/flake-remote-devshell-profile")"
|
||||
fi
|
||||
unset t1 t2 t3 flake_shell
|
||||
|
||||
echo Entered "$(hostname --fqdn)"
|
||||
df -h /nix/store
|
||||
|
Loading…
x
Reference in New Issue
Block a user