nix: replace paths dynamically

This commit is contained in:
Mihai Fufezan
2022-06-02 00:42:05 +03:00
parent 6daa866beb
commit 7451890fd7
4 changed files with 8 additions and 148 deletions

View File

@@ -1,14 +1,14 @@
#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#moreutils nixpkgs#jq -c bash
# update nixpkgs to latest version
nix flake lock --update-input nixpkgs
# get wlroots revision from submodule
SUB_REV=$(git submodule status | awk '{ print substr($1,2)}')
# and from lockfile
CRT_REV=$(jq < flake.lock '.nodes.wlroots.locked.rev' -r)
if [ $SUB_REV != $CRT_REV ]; then
# update nixpkgs to latest version
nix flake lock --update-input nixpkgs
# update wlroots to submodule revision
nix flake lock --override-input wlroots "gitlab:wlroots/wlroots/$SUB_REV?host=gitlab.freedesktop.org"