X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=.envrc;h=9741a311a705f709db85527186a5fd4af2dee4da;hp=6eeaba9ee75de5e41b9dad17c6ea956d256f63c9;hb=HEAD;hpb=da28a4e2afef21710f73860b26893fa18dd32858 diff --git a/.envrc b/.envrc index 6eeaba9..4718a18 100644 --- a/.envrc +++ b/.envrc @@ -1,13 +1,25 @@ # vim: filetype=bash -export PASSWORD_STORE_DIR=$(expand_path nixops/secrets) -export NIXOPS_STATE=$(expand_path nixops/state/immaeEu.nixops) -export NIXOPS_DEPLOYMENT=cef694f3-081d-11e9-b31f-0242ec186adf -export NIX_PATH=nixpkgs=$(cat $(expand_path nix/sources.json) | jq -r '."nixpkgs-nixops".url') +export DIRENV_FLAKE_DONT_ADD_SOURCES_ROOT=y +nix_direnv_watch_file() { + nix_watches+=("$@") + filtered=() + for i in "$@"; do + case "$i" in + */flake.lock) + ;; + *) + filtered+=("$i") + esac + done + watch_file "${filtered[@]}" +} -export NIXOPS_ENV_LOADED=1 +if nix eval './deploy#sops-vars-file' 2>/dev/null >/dev/null; then + export DEVSHELL_NO_MOTD=1 + cd deploy + use flake . --no-warn-dirty + cd .. + unset DEVSHELL_NO_MOTD +fi -PATH_add $(expand_path scripts) -PATH_add $(expand_path nixops/scripts) - -use nix -watch_file $(expand_path nix/sources.json) +use flake . --no-warn-dirty