diff --git a/.envrc b/.envrc index 39dc992..d36a344 100644 --- a/.envrc +++ b/.envrc @@ -1,5 +1,14 @@ #!/usr/bin/env bash git config --local core.hooksPath "$PWD"/.githooks + +test -d .direnv || mkdir -p .direnv +now="$(date +%Y-%m-%d)" +if ! test -s .direnv/pull-date || test "$now" != "$(cat .direnv/pull-date)"; then + git pull --rebase --autostash + nix flake update + echo "$now" > .direnv/pull-date +fi + if ! command -v nixos-rebuild >/dev/null; then use nix fi diff --git a/.gitignore b/.gitignore index 7fe2454..d1c4634 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ result /configuration.nix /hardware-configuration.nix +.direnv