-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
64 lines (61 loc) · 2.09 KB
/
flake.nix
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
{
description = "Nedryland is a collection of utilities and a build system for declaring, building and deploying microservice solutions.";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
inputs.flake-utils.url = "github:numtide/flake-utils";
outputs = { nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem
(system:
let
pkgs = nixpkgs.legacyPackages."${system}";
internalNedryland = import ./default.nix { inherit pkgs; };
in
{
lib = import ./.;
packages = {
inherit (internalNedryland) docs checks;
default = pkgs.linkFarm
"all"
(pkgs.lib.mapAttrsToList
(name: path: { inherit name path; })
{ inherit (internalNedryland) docs checks; });
};
apps = {
checks = rec {
type = "app";
inherit (all) program;
nixfmt = {
type = "app";
program = "${internalNedryland.checks}/bin/nixfmt";
};
shellcheck = {
type = "app";
program = "${internalNedryland.checks}/bin/shellcheck";
};
nixlint = {
type = "app";
program = "${internalNedryland.checks}/bin/nixlint";
};
all = {
type = "app";
program = "${internalNedryland.checks}/bin/check";
};
actionlint = {
type = "app";
program = "${internalNedryland.checks}/bin/actionlint";
};
};
};
devShells.docs = internalNedryland.docs;
checks.default = builtins.derivation {
inherit system;
name = "all-tests";
builder = "${pkgs.bash}/bin/bash";
args = [ "-c" ''${pkgs.coreutils}/bin/touch $out'' ];
tests = builtins.filter (x: x != { })
(import ./test.nix {
inherit pkgs;
}).all;
};
}
);
}