config/.envrc

15 lines
371 B
Bash

#!/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