2024-01-27 04:55:16 +01:00
|
|
|
@_default:
|
|
|
|
#just --choose # TODO: achieve something better with `gum`
|
|
|
|
#just --list --list-prefix ' just '
|
|
|
|
just "$(gum choose $(just --summary --unsorted))"
|
|
|
|
|
2024-02-01 02:06:03 +01:00
|
|
|
@set-remote:
|
|
|
|
tomlq <.remote.toml '.hosts | to_entries[] | "remote-set \(.key+1) # -> \(.value.host)" | @sh "\(.)"' -r | xargs gum choose | sh
|
|
|
|
|
2024-02-18 22:14:40 +01:00
|
|
|
eval hostname=`just _a-host`:
|
|
|
|
nix eval .#nixosConfigurations.{{hostname}}.config.system.build.toplevel.outPath
|
|
|
|
|
|
|
|
report hostname=`just _a-host`:
|
|
|
|
nix eval .#nixosReports.{{hostname}} --json | yq . --yaml-output | bat --language yaml --style plain --paging never
|
|
|
|
|
|
|
|
reports:
|
|
|
|
nix eval .#nixosReports --json | yq . --yaml-output | bat --language yaml --style plain --paging never
|
2024-01-27 04:55:16 +01:00
|
|
|
|
|
|
|
update:
|
|
|
|
git reset flake.lock
|
|
|
|
git restore flake.lock
|
|
|
|
git pull --rebase --autostash
|
|
|
|
nix flake update --commit-lock-file
|
|
|
|
@mkdir -p .direnv/
|
|
|
|
@echo "$(date +%Y-%m-%d)" > .direnv/pull-date
|
|
|
|
|
|
|
|
build:
|
|
|
|
nixos-rebuild build --flake .
|
|
|
|
|
|
|
|
test:
|
|
|
|
sudo nixos-rebuild test --flake .
|
|
|
|
|
|
|
|
switch:
|
|
|
|
sudo nixos-rebuild switch --flake .
|
|
|
|
|
|
|
|
boot:
|
|
|
|
sudo nixos-rebuild boot --flake .
|
2024-02-01 02:06:03 +01:00
|
|
|
|
|
|
|
@list-remotes:
|
|
|
|
echo Current remote: $(remote-host)
|
|
|
|
tomlq <.remote.toml '.hosts | to_entries[] | "remote-set \(.key+1) # -> \(.value.host)"' -r
|
2024-02-18 22:14:40 +01:00
|
|
|
|
|
|
|
@_a-host:
|
|
|
|
nix eval .#nixosHostnames --json 2>/dev/null | jq '.[]' -r | gum filter --height 10 --placeholder "Pick a host..."
|