Skip to content

Commit

Permalink
rebuild/ZZ: support remote builds
Browse files Browse the repository at this point in the history
  • Loading branch information
charlottia committed Jan 5, 2025
1 parent 8429bb7 commit a1dbf21
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 71 deletions.
67 changes: 0 additions & 67 deletions modules/fish/ZZZ.fish

This file was deleted.

1 change: 0 additions & 1 deletion modules/fish/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ in {
".config/fish/functions/fish_jj_prompt.fish".source = ./fish_jj_prompt.fish;
".config/fish/functions/fish_vcs_prompt.fish".source = ./fish_vcs_prompt.fish;
".config/fish/functions/nix_shell_info.fish".source = ./nix_shell_info.fish;
".config/fish/functions/ZZZ.fish".source = ./ZZZ.fish;
};
programs.fish =
{
Expand Down
14 changes: 11 additions & 3 deletions rebuild
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
#!/usr/bin/env fish

if [ (count $argv) -lt 1 ]
echo "usage: "(status -f)" verb [args ...]"
echo "usage: "(status -f)" verb [@HOST] [args ...]"
exit 1
end

if string match -qr '\A@(?<host>.+)\z' -- "$argv[2]"
# Assuming target is NixOS.
set -e argv[2]
set verb $argv[1]
set -e argv[1]
exec nixos-rebuild --target-host $host $verb --use-remote-sudo --flake git+file://(readlink -f (dirname (status -f)))\?submodules=1 $argv
end

set verb $argv[1]
set -e argv[1]

switch (uname)
case Linux
nixos-rebuild $verb --use-remote-sudo --flake git+file://(readlink -f (dirname (status -f)))\?submodules=1 --impure $argv
exec nixos-rebuild $verb --use-remote-sudo --flake git+file://(readlink -f (dirname (status -f)))\?submodules=1 $argv
case Darwin
darwin-rebuild $verb --flake git+file://(readlink -f (dirname (status -f)))\?submodules=1 --impure $argv
exec darwin-rebuild $verb --flake git+file://(readlink -f (dirname (status -f)))\?submodules=1 $argv
case '*'
echo "unknown uname: "(uname)
exit 1
Expand Down

0 comments on commit a1dbf21

Please sign in to comment.