Skip to content

Commit f66fd49

Browse files
committed
ci: run nix flake check
1 parent 4eb600b commit f66fd49

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

.github/workflows/nix.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: "Nix"
2+
on:
3+
pull_request:
4+
push:
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: cachix/install-nix-action@v25
11+
with:
12+
nix_path: nixpkgs=channel:nixos-unstable
13+
- uses: DeterminateSystems/magic-nix-cache-action@v2
14+
- run: nix flake check

flake.nix

+8-7
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
forAllSystems = nixpkgs.lib.genAttrs systems;
88
nixpkgsFor = forAllSystems (system: import nixpkgs {
99
inherit system;
10-
overlays = [ self.overlay ];
10+
overlays = [ self.overlays.default ];
1111
});
1212
optionsDocFor = forAllSystems (system:
1313
import ./nix/module-options-doc.nix (nixpkgsFor."${system}")
1414
);
1515
in {
16-
overlay = final: prev: {
16+
overlays.default = final: prev: {
1717
comin = final.buildGoModule rec {
1818
pname = "comin";
1919
version = "0.2.0";
@@ -42,16 +42,17 @@
4242
};
4343

4444
packages = forAllSystems (system: {
45-
inherit (nixpkgsFor."${system}") comin;
45+
default = nixpkgsFor."${system}".comin;
4646
generate-module-options = optionsDocFor."${system}".optionsDocCommonMarkGenerator;
4747
});
48-
defaultPackage = forAllSystems (system: self.packages."${system}".comin);
4948
checks = forAllSystems (system: {
50-
options-doc = optionsDocFor."${system}".checkOptionsDocCommonMark;
49+
module-options-doc = optionsDocFor."${system}".checkOptionsDocCommonMark;
50+
# I don't understand why nix flake check does't build packages.default
51+
package = nixpkgsFor."${system}".comin;
5152
});
5253

53-
nixosModules.comin = import ./nix/module.nix self.overlay;
54-
devShell.x86_64-linux = let
54+
nixosModules.comin = import ./nix/module.nix self.packages.default;
55+
devShells.x86_64-linux.default = let
5556
pkgs = nixpkgs.legacyPackages.x86_64-linux;
5657
in pkgs.mkShell {
5758
buildInputs = [

0 commit comments

Comments
 (0)