Skip to content

Commit e1ccf6e

Browse files
committed
fix(nix): evaluate all systems in package CI
1 parent 9de2ed7 commit e1ccf6e

2 files changed

Lines changed: 25 additions & 30 deletions

File tree

.github/workflows/nix.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ jobs:
4646
- name: Check flake outputs
4747
run: nix flake check --print-build-logs
4848

49+
- name: Evaluate all supported systems
50+
run: nix flake check --all-systems --no-build
51+
4952
- name: Build Hunk package
5053
run: nix build .#default --print-build-logs
5154

flake.nix

Lines changed: 22 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,14 @@
2727
"aarch64-darwin"
2828
];
2929
forAllSystems = lib.genAttrs supportedSystems;
30-
in {
31-
packages = forAllSystems (
30+
perSystem = forAllSystems (
3231
system: let
3332
pkgs = import nixpkgs {
3433
inherit system;
3534
};
3635
hunk = pkgs.callPackage ./nix/package.nix {
3736
bun2nix = bun2nix.packages.${system}.default;
3837
};
39-
in {
40-
inherit hunk;
41-
default = hunk;
42-
}
43-
);
44-
45-
apps = forAllSystems (
46-
system: let
47-
pkgs = import nixpkgs {
48-
inherit system;
49-
};
5038
updateBunLock = pkgs.writeShellScriptBin "hunk-update-bun-lock" ''
5139
set -euo pipefail
5240
${bun2nix.packages.${system}.default}/bin/bun2nix -o nix/bun.lock.nix -c ../ "$@"
@@ -55,28 +43,32 @@
5543
fi
5644
'';
5745
in {
58-
default = {
59-
type = "app";
60-
program = "${self.packages.${system}.hunk}/bin/hunk";
61-
meta.description = "Run Hunk";
46+
packages = {
47+
inherit hunk;
48+
default = hunk;
6249
};
63-
update-bun-lock = {
64-
type = "app";
65-
program = "${updateBunLock}/bin/hunk-update-bun-lock";
66-
meta.description = "Regenerate nix/bun.lock.nix with the flake-pinned bun2nix";
50+
apps = {
51+
default = {
52+
type = "app";
53+
program = "${hunk}/bin/hunk";
54+
meta.description = "Run Hunk";
55+
};
56+
update-bun-lock = {
57+
type = "app";
58+
program = "${updateBunLock}/bin/hunk-update-bun-lock";
59+
meta.description = "Regenerate nix/bun.lock.nix with the flake-pinned bun2nix";
60+
};
6761
};
68-
}
69-
);
70-
71-
devShells = forAllSystems (
72-
system: let
73-
pkgs = import nixpkgs {
74-
inherit system;
62+
devShells = {
63+
default = pkgs.callPackage ./nix/devShell.nix {};
7564
};
76-
in {
77-
default = pkgs.callPackage ./nix/devShell.nix {};
7865
}
7966
);
67+
systemOutput = name: lib.mapAttrs (_: value: value.${name}) perSystem;
68+
in {
69+
packages = systemOutput "packages";
70+
apps = systemOutput "apps";
71+
devShells = systemOutput "devShells";
8072

8173
homeManagerModules = {
8274
hunk = import ./nix/home-manager.nix;

0 commit comments

Comments
 (0)