Created
March 1, 2026 15:54
-
-
Save shanesveller/8b866c115016b3a7541a1ccfe2633fa6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env nu | |
| use std | |
| use std/dirs | |
| const repos = [ | |
| "~/src/side-projects/rust/cargo-lsp" | |
| "~/src/side-projects/fantasy-geek/raphael" | |
| # "~/src/side-projects/fantasy-geek/triples" | |
| "~/src/side-projects/feeds/gazette" | |
| # "~/src/side-projects/games/chronicle" | |
| # "~/src/side-projects/games/citadel" | |
| # "~/src/side-projects/games/silt" | |
| # "~/src/side-projects/fantasy-geek/inspeqt" | |
| # "~/src/side-projects/rust/cargo-merge-driver" | |
| "~/src/side-projects/rust/coincide" | |
| # "~/src/side-projects/rust/tjj" | |
| # "~/src/side-projects/rust/vibecheck" | |
| "~/src/side-projects/clis/spaarti" | |
| # "~/src/side-projects/arxiv/categorizer" | |
| # "~/src/side-projects/tabletop/enchiridion" | |
| ] | |
| def main [ | |
| --base: string = "develop" | |
| --target: string = "~/src/nix/nix-flake-lock-targets", | |
| ] { | |
| std log info $"Fetching lock contents from ($target)" | |
| let metadata = (nix flake metadata --json ($target | path expand) | from json) | |
| let unstable = ($metadata.locks.nodes.unstable.locked.rev) | |
| std log debug $"Unstable: ($unstable)" | |
| jj git fetch --bookmark $base | |
| std log info $"Checking out ($base)" | |
| jj new $base | |
| std log info "Updating local lock file" | |
| do { | |
| git checkout -f flake.lock | |
| rm -fv .git/hooks/commit-msg .git/hooks/pre-commit | |
| $env.SKIP = "committed,prettier" | |
| (nix flake update | |
| --commit-lock-file | |
| --option commit-lockfile-summary "chore(workspace): Update flake.lock" | |
| --override-input nixpkgs | |
| $"github:nixos/nixpkgs/($unstable)") | |
| } | |
| nix develop --command true | |
| std log info "Advancing bookmark" | |
| jj tug | |
| jj git push --bookmark $base | |
| } | |
| def "main all" [ | |
| --base: string = "develop" | |
| --skip: number = 0 | |
| --target: string = "~/src/nix/nix-flake-lock-targets", | |
| ] { | |
| $repos | each {|repo| cd $repo; main --base $base --target $target } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment