Skip to content

Commit

Permalink
Add ci to remotely build on two CI machines
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Jul 15, 2024
1 parent 74dd679 commit 70ff74d
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"b4dm4n.nixpkgs-fmt",
"jnoortheen.nix-ide",
"mattn.lisp",
"mkhl.direnv"
"mkhl.direnv",
"kdl-org.kdl"
]
}
1 change: 1 addition & 0 deletions home/terminal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# Useful for Nix development
nixci
nixci-build-remote
ci
nix-health
nixpkgs-fmt
just
Expand Down
15 changes: 15 additions & 0 deletions packages/ci/default.nix
Original file line number Diff line number Diff line change
@@ -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 changes: 23 additions & 0 deletions packages/ci/layout.kdl
Original file line number Diff line number Diff line change
@@ -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"
}
}
1 change: 1 addition & 0 deletions packages/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 70ff74d

Please sign in to comment.