diff options
author | Franck Cuny <franck@fcuny.net> | 2024-12-09 08:28:01 -0800 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2024-12-09 08:28:01 -0800 |
commit | 0998d8294e21cd8bdc6ac94525df0aae51bb4b0d (patch) | |
tree | 06c34041e7fb2f474e046dbb5deec3f23f82f0af /justfile | |
parent | set hostname and correct ssh key (diff) | |
download | world-0998d8294e21cd8bdc6ac94525df0aae51bb4b0d.tar.gz |
move each machine into a directory
it will be easier to break down some configs.
Diffstat (limited to 'justfile')
-rw-r--r-- | justfile | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/justfile b/justfile index 94877a0..992a107 100644 --- a/justfile +++ b/justfile @@ -3,18 +3,13 @@ SSH_OPTIONS := "-o PubkeyAuthentication=no -o UserKnownHostsFile=/dev/null -o St nixdisk := "vda" nixaddr := "" +hostname := lowercase(`hostname -s`) + # update dependencies +[group('nix')] update-deps: nix flake update --commit-lock-file -# build (and only build) the configuration for darwin -build-darwin: - darwin-rebuild build --flake .#$(hostname -s) - -# build and switch the configuration for darwin -switch-darwin: - darwin-rebuild switch --flake .#$(hostname -s) - # a simple check to ensure the nix configuration is OK test-nix: nix flake check @@ -24,11 +19,25 @@ test-nix: fmt: nix fmt -build-wildcat: - nixos-rebuild build --target-host fcuny.net --build-host fcuny.net --fast --use-remote-sudo --use-substitutes --flake .#wildcat +[group('machines')] +[macos] +build: + darwin-rebuild build --flake .#{{hostname}} + +[group('machines')] +[macos] +switch: + darwin-rebuild switch --flake .#{{hostname}} + +[group('machines')] +[linux] +build: + nixos-rebuild build --flake .#{{hostname}} -switch-wildcat: - nixos-rebuild switch --target-host fcuny.net --build-host fcuny.net --fast --use-remote-sudo --use-substitutes --flake .#wildcat +[group('machines')] +[linux] +switch: + nixos-rebuild switch --flake .#{{hostname}} vm-bootstrap: #!/usr/bin/env bash @@ -61,5 +70,6 @@ vm-copy: rsync -av -e 'ssh {{SSH_OPTIONS}}' \ --exclude='.git/' \ --exclude='result' \ + --exclude='.direnv/' \ --rsync-path="sudo rsync" \ - $(dirname justfile)/ root@{{nixaddr}}:/nix-config + $(dirname justfile)/ {{nixaddr}}:/nix-config |