X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=blobdiff_plain;f=.envrc;fp=.envrc;h=4718a18d217614ff29d457baef735fe6ef0c5e51;hp=438d807e29908d3c4855a7978433a504c952f38e;hb=1a64deeb894dc95e2645a75771732c6cc53a79ad;hpb=fa25ffd4583cc362075cd5e1b4130f33306103f0 diff --git a/.envrc b/.envrc index 438d807..4718a18 100644 --- a/.envrc +++ b/.envrc @@ -1,13 +1,25 @@ # vim: filetype=bash -export NIX_PATH=nixpkgs=$(cat $(expand_path nix/sources.json) | jq -r '."nixpkgs-nixops".url') -NIX_PATH=$NIX_PATH:nixpkgs-nix=$(cat $(expand_path nix/sources.json) | jq -r '."nixpkgs-nix".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) - -clean_nix_shell +use flake . --no-warn-dirty