-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathflake.nix
More file actions
82 lines (80 loc) · 2.16 KB
/
flake.nix
File metadata and controls
82 lines (80 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{
inputs = {
flake-utils = {
url = "github:numtide/flake-utils";
};
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-25.11";
};
};
outputs =
{
self,
flake-utils,
nixpkgs,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
mkDevShell =
jdk:
pkgs.mkShellNoCC {
buildInputs = with pkgs; [
bazelisk
(coursier.override ({ jre = jdk; }))
git
(gradle.override ({ java = jdk; }))
jdk
jq
(maven.override ({ jdk_headless = jdk; }))
nixfmt
nodejs
(sbt.override ({ jre = jdk; }))
scalafmt
yarn
];
};
in
{
checks = {
actionlint = pkgs.runCommand "check-actionlint" { } ''
${pkgs.actionlint}/bin/actionlint ${./.github/workflows}/*.yml
touch $out
'';
nixfmt = pkgs.runCommand "check-nixfmt" { } ''
${pkgs.nixfmt}/bin/nixfmt --check ${./flake.nix}
touch $out
'';
renovate = pkgs.runCommand "check-renovate" { } ''
LOG_LEVEL=warn ${pkgs.renovate}/bin/renovate-config-validator \
${./.github/renovate.json}
touch $out
'';
scalafmt =
pkgs.runCommand "check-scalafmt"
{
buildInputs = [ pkgs.git ];
}
''
cp -r ${./.}/. .
chmod -R u+w .
git init -q
git add -A
${pkgs.scalafmt}/bin/scalafmt --check --non-interactive
touch $out
'';
shellcheck = pkgs.runCommand "check-shellcheck" { } ''
${pkgs.shellcheck}/bin/shellcheck ${./bin}/*.sh
touch $out
'';
};
devShells = {
default = mkDevShell pkgs.jdk11;
jdk11 = mkDevShell pkgs.jdk11;
jdk17 = mkDevShell pkgs.jdk17;
jdk21 = mkDevShell pkgs.jdk21;
};
}
);
}