Skip to content

Commit 93bd412

Browse files
committed
Create a single derivation for CI
Allows running `nix-build -A ci` without relying on `nix-build`'s recursion
1 parent 54a1164 commit 93bd412

File tree

2 files changed

+24
-20
lines changed

2 files changed

+24
-20
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: cachix/install-nix-action@v26
3030

3131
- name: checks
32-
run: nix-build -A checks
32+
run: nix-build -A ci
3333

3434
nixpkgs-diff:
3535
runs-on: ubuntu-latest

default.nix

+23-19
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,6 @@ let
7575
# Haskell formatter
7676
programs.fourmolu.enable = true;
7777
};
78-
in
79-
build
80-
// {
81-
packages.nixfmt = build;
82-
83-
inherit pkgs;
84-
85-
shell = pkgs.haskellPackages.shellFor {
86-
packages = p: [ p.nixfmt ];
87-
nativeBuildInputs = with pkgs; [
88-
cabal-install
89-
stylish-haskell
90-
haskellPackages.haskell-language-server
91-
shellcheck
92-
npins
93-
hlint
94-
treefmtEval.config.build.wrapper
95-
];
96-
};
9778

9879
checks = {
9980
inherit build;
@@ -121,4 +102,27 @@ build
121102
};
122103
treefmt = treefmtEval.config.build.check source;
123104
};
105+
in
106+
build
107+
// {
108+
packages.nixfmt = build;
109+
110+
inherit pkgs;
111+
112+
shell = pkgs.haskellPackages.shellFor {
113+
packages = p: [ p.nixfmt ];
114+
nativeBuildInputs = with pkgs; [
115+
cabal-install
116+
stylish-haskell
117+
haskellPackages.haskell-language-server
118+
shellcheck
119+
npins
120+
hlint
121+
treefmtEval.config.build.wrapper
122+
];
123+
};
124+
125+
inherit checks;
126+
127+
ci = pkgs.linkFarm "ci" checks;
124128
}

0 commit comments

Comments
 (0)