diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 4d6c35e..e770e2e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -4,6 +4,7 @@ "b4dm4n.nixpkgs-fmt", "jnoortheen.nix-ide", "mattn.lisp", - "mkhl.direnv" + "mkhl.direnv", + "kdl-org.kdl" ] } \ No newline at end of file diff --git a/home/terminal.nix b/home/terminal.nix index dfaf62d..b50d1cf 100644 --- a/home/terminal.nix +++ b/home/terminal.nix @@ -14,6 +14,7 @@ # Useful for Nix development nixci nixci-build-remote + ci nix-health nixpkgs-fmt just diff --git a/packages/ci/default.nix b/packages/ci/default.nix new file mode 100644 index 0000000..d458663 --- /dev/null +++ b/packages/ci/default.nix @@ -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 + ''; +} diff --git a/packages/ci/layout.kdl b/packages/ci/layout.kdl new file mode 100644 index 0000000..d3be543 --- /dev/null +++ b/packages/ci/layout.kdl @@ -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" + } +} diff --git a/packages/overlay.nix b/packages/overlay.nix index b5ff945..ef8d439 100644 --- a/packages/overlay.nix +++ b/packages/overlay.nix @@ -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;