does anyone have a solution for the infuriating problem that Nix requires you to...

@whitequark@treehouse.systems

does anyone have a solution for the infuriating problem that Nix requires you to build everything twice: first to calculate the hash, second to actually do the build after you manually copy the hash into the source, and hope you aren't misplaced it because the system has exactly 0 guardrails against that

my current solution is

$ cat ~/.config/git/config
[alias]
cum = !"cum() { echo \" rev = \\\"$(git rev-parse HEAD)\\\";\\n hash = \\\"$(nix hash convert --hash-algo sha256 $(nix-prefetch-url --quiet --unpack $(git config remote.origin.url)/archive/$(git rev-parse HEAD).tar.gz) 2>/dev/null)\\\";\";}; cum"

which only works if there's no submodules