From 0998d8294e21cd8bdc6ac94525df0aae51bb4b0d Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Mon, 9 Dec 2024 08:28:01 -0800 Subject: move each machine into a directory it will be easier to break down some configs. --- justfile | 36 +++++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 13 deletions(-) (limited to 'justfile') 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 -- cgit 1.4.1