hostname := shell("hostname | sed 's/\\..*//' | tr '[:upper:]' '[:lower:]'") default: @just --list action target action: git add . && rui --allow-unfree --allow-insecure {{target}} {{action}} -- --impure build target=hostname: @uname | \ grep -q Darwin \ && just darwin_action {{target}} build \ || just action {{target}} build darwin_action target action: nix run nix-darwin --extra-experimental-features 'flakes nix-command' -- {{action}} --flake .#{{target}} switch target=hostname: case "$(uname)" in \ Darwin) just darwin_action {{target}} switch ;; \ *) just action {{target}} switch ;; \ esac news user='ebisu': rui home news --user {{user}} -- --impure check: nix flake check fmt: treefmt push message: git add . && git commit -m "{{message}}" && git push origin main commit message: git add . && git commit -m "{{message}}" restore path='.': git restore --staged {{path}} && git restore {{path}} deploy_action action hostname user='root' ip=hostname: git add . && nixos-rebuild \ --flake .#{{hostname}} \ --target-host {{user}}@{{ip}} \ --use-remote-sudo \ {{action}} deploy hostname user='root' ip=hostname: just deploy_action boot {{hostname}} {{user}} {{ip}} deploy_switch hostname user='root' ip=hostname: just deploy_action switch {{hostname}} {{user}} {{ip}} provision ip hostname: doas nix run github:nix-community/nixos-anywhere \ -- \ --flake .#{{hostname}} root@{{ip}} update: nix flake metadata --json | \ jq -r '.locks.nodes | keys[] | select(. != "nixpkgs")' | \ xargs -I{} nix flake update {}