Skip to content

Commit

Permalink
feat: add buildkite pipeline (#1012)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnae authored Nov 25, 2024
1 parent 0d30b49 commit 6daaf79
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 2 deletions.
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@
outputs = inputs @ {flake-parts, ...}:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [
./flake/buildkite-pipeline.nix
./flake/devenv.nix
./flake/github-actions.nix
./flake/helper-packages.nix
Expand All @@ -139,4 +140,4 @@
];
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"];
};
}
}
58 changes: 58 additions & 0 deletions flake/buildkite-pipeline.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
withSystem,
lib,
self,
...
}: let
inherit (lib) mapAttrsToList filterAttrs hasPrefix filter elem;
defaultSkip = [
"container-"
"container-processes"
"container-shell"
"devenv-up"
];
matrix = withSystem "x86_64-linux" (
ctx @ {pkgs, ...}: let
skip =
(mapAttrsToList (name: _: name) (filterAttrs (name: _: hasPrefix "images/" name) pkgs))
++ defaultSkip;
in
filter (item: !(elem item skip)) (mapAttrsToList (name: _: name) ctx.config.packages)
);
in {
flake = {
buildkite-pipeline = {
env = {
CACHE_NAME = "insane";
NIX_CONFIG = "accept-flake-config = true";
};
steps = [
{
group = ":broom: Linting and syntax checks";
key = "checks";
steps = [
{
label = ":nix: Lint";
command = "nix run .#world -- lint";
}
{
label = ":nix: Check";
command = "nix run .#world -- check";
}
];
}
{
group = ":hammer_and_pick: Building packages";
key = "packages";
steps = [
{
label = ":nix: {{matrix}} build";
command = "nix build .#packages.x86_64-linux.{{matrix}} -L";
inherit matrix;
}
];
}
];
};
};
}
2 changes: 1 addition & 1 deletion flake/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
in
pkgs.writeShellApplication {
name = "world";
runtimeInputs = with pkgs; [just nushell statix deadnix];
runtimeInputs = with pkgs; [just nushell statix deadnix cachix];
text = ''
just -f ${pkgs.replaceVars ../files/Justfile.template {
inherit upgrade build;
Expand Down

0 comments on commit 6daaf79

Please sign in to comment.