Skip to content

Commit

Permalink
flake: add checks (#87)
Browse files Browse the repository at this point in the history
  • Loading branch information
kalbasit authored Dec 12, 2024
1 parent 59516a3 commit 88f8ace
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 0 deletions.
77 changes: 77 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
inputs@{ flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
./nix/checks/flake-module.nix
./nix/devshells/flake-module.nix
./nix/formatter/flake-module.nix
./nix/packages/flake-module.nix
Expand Down
34 changes: 34 additions & 0 deletions nix/checks/flake-module.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
perSystem =
{
self',
lib,
pkgs,
config,
...
}:
{
checks =
let
packages = lib.mapAttrs' (n: lib.nameValuePair "package-${n}") self'.packages;
devShells = lib.mapAttrs' (n: lib.nameValuePair "devShell-${n}") self'.devShells;
in
packages
// devShells
// {
golangci-lint = config.packages.ncps.overrideAttrs (oa: {
name = "golangci-lint";
src = ../../.;
nativeBuildInputs = oa.nativeBuildInputs ++ [ pkgs.golangci-lint ];
buildPhase = ''
HOME=$TMPDIR
golangci-lint run --timeout 10m
'';
installPhase = ''
touch $out
'';
doCheck = false;
});
};
};
}

0 comments on commit 88f8ace

Please sign in to comment.