Add ci to remotely build on two CI machines

This commit is contained in:
Sridhar Ratnakumar 2024-07-15 17:15:24 -04:00
parent 74dd679cc4
commit 70ff74d24e
No known key found for this signature in database
5 changed files with 42 additions and 1 deletions

View file

@ -4,6 +4,7 @@
"b4dm4n.nixpkgs-fmt",
"jnoortheen.nix-ide",
"mattn.lisp",
"mkhl.direnv"
"mkhl.direnv",
"kdl-org.kdl"
]
}

View file

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

15
packages/ci/default.nix Normal file
View file

@ -0,0 +1,15 @@
{ writeShellApplication, nixci-build-remote, zellij, ... }:
writeShellApplication {
name = "ci";
runtimeInputs = [ nixci-build-remote zellij ];
meta.description = ''
Run CI locally.
Powered by nixci, zellij and your beefy machines over SSH.
'';
text = ''
PRJ=$(basename "$(pwd)")
zellij --layout ${./layout.kdl} attach --create "$PRJ"-ci --force-run-commands
'';
}

23
packages/ci/layout.kdl Normal file
View file

@ -0,0 +1,23 @@
// TODO: Make it a nix module?
// - Don't't hardcode hostnames/ systems
// - Use nix store path for nixci-build-remote
layout {
pane size=1 borderless=true {
plugin location="tab-bar"
}
pane split_direction="vertical" {
pane {
name "x86_64-linux"
command "nixci-build-remote"
args "nix-infra@dosa"
}
pane {
name "aaarch64-linux"
command "nixci-build-remote"
args "nix-infra@sambar"
}
}
pane size=2 borderless=true {
plugin location="status-bar"
}
}

View file

@ -5,6 +5,7 @@ self: super: {
twitter-convert = self.callPackage ./twitter-convert { };
sshuttle-via = self.callPackage ./sshuttle-via.nix { };
nixci-build-remote = self.callPackage (import ./nixci-build-remote.nix { inherit (flake) inputs; }) { };
ci = self.callPackage ./ci { };
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;