This commit is contained in:
2025-03-16 17:33:24 +01:00
parent 7af3a39b2b
commit 4c31b1b055
2 changed files with 15 additions and 3 deletions

15
.envrc
View File

@@ -1,6 +1,11 @@
#!/usr/bin/env bash
git config --local core.hooksPath "$PWD"/.githooks
# https://direnv.net/man/direnv-stdlib.1.html
# TODO:
# git config --local core.hooksPath "$PWD"/.githooks
# ensure (dirty) updated flake lock
# TODO: cache this on gitea? Run in background?
test -d .direnv || mkdir -p .direnv
now="$(date +%Y-%m-%d)"
if ! test -s .direnv/pull-date || test "$now" != "$(cat .direnv/pull-date)"; then
@@ -8,11 +13,15 @@ if ! test -s .direnv/pull-date || test "$now" != "$(cat .direnv/pull-date)"; the
git restore flake.lock
git pull --rebase --autostash
grep -q "^=======" flake.lock && { git reset flake.lock; rm flake.lock; }
nix flake update
# nix flake update
nix eval --file flake.nix --apply 'x: builtins.attrNames x.inputs' --json \
| jq .[] -r \
| grep -v '^nixpkgs-expensive$' \
| nix flake update
echo "$now" > .direnv/pull-date
fi
# source env
if ! test -f .remote.toml; then
use flake .#envrc-local
else

View File

@@ -18,6 +18,9 @@
nixpkgs-1909.url = "github:NixOS/nixpkgs/nixos-19.09"; # for old docs
nixpkgs-1909.flake = false; # Earlier versions are not flake-pure
# expensive to bump
# nixpkgs-expensive.url = "github:NixOS/nixpkgs/nixos-unstable";
# https://github.com/nix-community/home-manager
home-manager-edge.url = "github:nix-community/home-manager/master";
home-manager-edge.inputs.nixpkgs.follows = "nixpkgs-edge";