Upgrade 'ci' script to use omnix

This commit is contained in:
Sridhar Ratnakumar 2024-08-26 17:05:36 -04:00
parent ba39e6d2c0
commit e757701dc2
No known key found for this signature in database
6 changed files with 14 additions and 35 deletions

6
flake.lock generated
View file

@ -1095,11 +1095,11 @@
"treefmt-nix": "treefmt-nix_3"
},
"locked": {
"lastModified": 1724556658,
"narHash": "sha256-ZZZY6fIkYIM5C7QVjdYvvZRgSYN+YVyeu8NwRHRlKGw=",
"lastModified": 1724700491,
"narHash": "sha256-RdBIfZ1Eo+h6B/mUZCEQuGKvo4DwPv25FvEx8dw4ZhA=",
"owner": "juspay",
"repo": "omnix",
"rev": "5322235ce4069e72fd5eb477353ee5d1f5100243",
"rev": "2a2fbdc00578006f94b99be01bea9eaf1389710c",
"type": "github"
},
"original": {

View file

@ -12,7 +12,6 @@
# ncdu
# Useful for Nix development
om-ci-build-remote
ci
touchpr
omnix

View file

@ -1,10 +1,10 @@
{ writeShellApplication, om-ci-build-remote, zellij, ... }:
{ writeShellApplication, omnix, zellij, ... }:
writeShellApplication {
name = "ci";
runtimeInputs = [ om-ci-build-remote zellij ];
meta.description = ''
Run CI locally.
Run CI locally.
Powered by omnix, zellij and your beefy machines over SSH.
'';

View file

@ -6,20 +6,20 @@ layout {
plugin location="tab-bar"
}
pane split_direction="horizontal" {
pane {
pane {
name "x86_64-linux"
command "om-ci-build-remote"
args "nix-infra@dosa"
command "om"
args "ci" "run" "--on" "ssh://nix-infra@dosa"
}
pane {
pane {
name "aaarch64-darwin"
command "om-ci-build-remote"
args "nix-infra@sambar"
command "om"
args "ci" "run" "--on" "ssh://nix-infra@sambar"
}
pane {
pane {
name "x86_64-darwin"
command "om-ci-build-remote"
args "nix-infra@sambar" "--systems" "x86_64-darwin"
command "om"
args "ci" "run" "--on" "ssh://nix-infra@sambar" "--systems" "x86_64-darwin"
}
}
pane size=2 borderless=true {

View file

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

View file

@ -4,7 +4,6 @@ self: super: {
fuckport = self.callPackage ./fuckport.nix { };
twitter-convert = self.callPackage ./twitter-convert { };
sshuttle-via = self.callPackage ./sshuttle-via.nix { };
om-ci-build-remote = self.callPackage (import ./om-ci-build-remote.nix { inherit (flake) inputs; }) { };
ci = self.callPackage ./ci { };
touchpr = self.callPackage ./touchpr { };
# nix-health = flake.inputs.nix-browser.packages.${system}.nix-health;