autoupdate

This commit is contained in:
Peder Bergebakken Sundt 2023-03-07 23:56:50 +01:00
parent 138772ab74
commit 269cc6d3d8
2 changed files with 10 additions and 0 deletions

9
.envrc
View File

@ -1,5 +1,14 @@
#!/usr/bin/env bash #!/usr/bin/env bash
git config --local core.hooksPath "$PWD"/.githooks 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 if ! command -v nixos-rebuild >/dev/null; then
use nix use nix
fi fi

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
result result
/configuration.nix /configuration.nix
/hardware-configuration.nix /hardware-configuration.nix
.direnv