forked from fluidattacks/makes
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
52 lines (47 loc) · 1.14 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
{
description = "A DevSecOps framework powered by Nix!";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs";
};
outputs = {
self,
nixpkgs,
...
} @ inputs: let
makes = import ./default.nix {system = "x86_64-linux";};
lib.flakes.evaluate = {
inputs,
system,
}: let
evaluated = import ./src/evaluator/default.nix {
flakeInputs = inputs;
makesSrc = inputs.makes.outPath;
projectSrc = inputs.self.sourceInfo.outPath;
inherit system;
};
evaluatedOutputs =
nixpkgs.lib.mapAttrs'
(output: value: {
name = "config:outputs:${output}";
inherit value;
})
evaluated.config.outputs;
in {
__makes__ =
evaluatedOutputs
// {
"config:configAsJson" = evaluated.config.configAsJson;
};
};
in
(lib.flakes.evaluate {
inputs = inputs // {makes = self;};
system = "x86_64-linux";
})
// {
inherit lib;
defaultPackage.x86_64-linux = makes;
defaultApp.x86_64-linux.program = "${makes}/bin/m";
defaultApp.x86_64-linux.type = "app";
};
}