Add nixci-build-remote

A script to nix build remotely over ssh, without necessarily configuring distributed builds.
This commit is contained in:
Sridhar Ratnakumar 2024-07-13 15:00:24 -04:00
parent 2607a26c7d
commit 05ed86f8d6
No known key found for this signature in database
3 changed files with 20 additions and 0 deletions

View file

@ -13,6 +13,7 @@
# Useful for Nix development
nixci
nixci-build-remote
nix-health
nixpkgs-fmt
just

View file

@ -0,0 +1,18 @@
{ writeShellApplication, curl, jq, nix, nixci, ... }:
writeShellApplication {
name = "nixci-build-remote";
runtimeInputs = [ curl jq nix nixci ];
meta.description = ''
`nixci build`, but build remotely over SSH.
'';
# TODO: This should handle --override-inputs
# TODO: This should also `nix copy` nixci itself.
text = ''
FLAKE=$(nix flake metadata --json | jq -r .path)
set -x
nix copy --to "ssh://$1" "$FLAKE"
# shellcheck disable=SC2029
ssh "$1" nixci build "$FLAKE"
'';
}

View file

@ -4,6 +4,7 @@ self: super: {
fuckport = self.callPackage ./fuckport.nix { };
twitter-convert = self.callPackage ./twitter-convert { };
sshuttle-via = self.callPackage ./sshuttle-via.nix { };
nixci-build-remote = self.callPackage ./nixci-build-remote.nix { };
nixci = flake.inputs.nixci.packages.${system}.default;
# nix-health = flake.inputs.nix-browser.packages.${system}.nix-health;
actualism-app = flake.inputs.actualism-app.packages.${system}.default;