Skip to content

Commit 131ffd2

Browse files
galin-sPetarKirov
authored andcommitted
feat(pre-commit): Add pre-commit to ci.yml, flake.nix, ci.nix
1 parent ff8176c commit 131ffd2

File tree

3 files changed

+41
-15
lines changed

3 files changed

+41
-15
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ on:
1111
- main
1212

1313
jobs:
14+
lint:
15+
uses: metacraft-labs/nixos-modules/.github/workflows/reusable-lint.yml@main
16+
secrets:
17+
NIX_GITHUB_TOKEN: ${{ secrets.NIX_GITHUB_TOKEN }}
18+
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
1419
ci:
1520
uses: metacraft-labs/nixos-modules/.github/workflows/reusable-flake-checks-ci-matrix.yml@main
1621
secrets:

flake.nix

Lines changed: 29 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,35 @@
3535
};
3636
};
3737

38-
outputs = inputs @ {flake-parts, ...}:
39-
flake-parts.lib.mkFlake {inherit inputs;} {
40-
systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
41-
imports = [./packages];
42-
perSystem = {
43-
final,
44-
self',
45-
...
46-
}: {
47-
devShells.default = import ./shells/all.nix {
48-
pkgs = final;
49-
inherit self';
38+
outputs =
39+
inputs@{ flake-parts, nixos-modules, ... }:
40+
flake-parts.lib.mkFlake { inherit inputs; } {
41+
systems = [
42+
"x86_64-linux"
43+
"aarch64-linux"
44+
"x86_64-darwin"
45+
"aarch64-darwin"
46+
];
47+
imports = [
48+
nixos-modules.modules.flake.git-hooks
49+
./packages
50+
];
51+
perSystem =
52+
{
53+
final,
54+
self',
55+
config,
56+
...
57+
}:
58+
{
59+
devShells.default = import ./shells/all.nix {
60+
pkgs = final;
61+
inherit self';
62+
};
63+
devShells.ci = import ./shells/ci.nix {
64+
pkgs = final;
65+
inherit config;
66+
};
5067
};
51-
devShells.ci = import ./shells/ci.nix {pkgs = final;};
52-
};
5368
};
5469
}

shells/ci.nix

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
{pkgs, ...}:
1+
{ pkgs, config, ... }:
22
pkgs.mkShellNoCC {
33
packages = with pkgs; [
44
jq
55
nix-eval-jobs
66
];
7+
8+
shellHook =
9+
''
10+
figlet -w$COLUMNS "nix-blockchain-development"
11+
''
12+
+ config.pre-commit.installationScript;
713
}

0 commit comments

Comments
 (0)