Skip to content

Commit

Permalink
Merge pull request #27 from nlewo/ci-nix
Browse files Browse the repository at this point in the history
ci: run nix flake check
  • Loading branch information
nlewo authored Apr 27, 2024
2 parents 9ad1d95 + 49f327a commit a059f96
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: "Nix"
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: DeterminateSystems/magic-nix-cache-action@v2
- run: nix flake check
15 changes: 8 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
forAllSystems = nixpkgs.lib.genAttrs systems;
nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = [ self.overlay ];
overlays = [ self.overlays.default ];
});
optionsDocFor = forAllSystems (system:
import ./nix/module-options-doc.nix (nixpkgsFor."${system}")
);
in {
overlay = final: prev: {
overlays.default = final: prev: {
comin = final.buildGoModule rec {
pname = "comin";
version = "0.2.0";
Expand Down Expand Up @@ -41,16 +41,17 @@
};

packages = forAllSystems (system: {
inherit (nixpkgsFor."${system}") comin;
default = nixpkgsFor."${system}".comin;
generate-module-options = optionsDocFor."${system}".optionsDocCommonMarkGenerator;
});
defaultPackage = forAllSystems (system: self.packages."${system}".comin);
checks = forAllSystems (system: {
options-doc = optionsDocFor."${system}".checkOptionsDocCommonMark;
module-options-doc = optionsDocFor."${system}".checkOptionsDocCommonMark;
# I don't understand why nix flake check does't build packages.default
package = nixpkgsFor."${system}".comin;
});

nixosModules.comin = import ./nix/module.nix self.overlay;
devShell.x86_64-linux = let
nixosModules.comin = import ./nix/module.nix self.packages.default;
devShells.x86_64-linux.default = let
pkgs = nixpkgs.legacyPackages.x86_64-linux;
in pkgs.mkShell {
buildInputs = [
Expand Down

0 comments on commit a059f96

Please sign in to comment.