-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
76 lines (73 loc) · 2.11 KB
/
Copy pathflake.nix
File metadata and controls
76 lines (73 loc) · 2.11 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
{
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs";
};
dream2nix = {
url = "github:nix-community/dream2nix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-parts = {
url = "github:hercules-ci/flake-parts";
};
};
outputs =
inputs@{
self,
nixpkgs,
dream2nix,
flake-parts,
}:
let
pointyLib = import ./lib.nix inputs pointyLib;
in
{
lib = pointyLib;
flakeModules.default = top: {
options.pointy = {
stepDefs = top.lib.mkOption { type = top.lib.types.attrsOf pointyLib.types.pointy.stepDef; };
templates = top.lib.mkOption { type = top.lib.types.attrs; };
presets = top.lib.mkOption {
type = top.lib.types.attrsOf pointyLib.types.pointy.preset;
default = { };
};
projects = top.lib.mkOption { type = top.lib.types.attrsOf pointyLib.types.pointy.project; };
srcFiles = top.lib.mkOption { type = top.lib.types.raw; };
};
config =
let
cfg = top.config.pointy;
fakeDrv = {
type = "derivation";
name = "";
};
in
{
flake.pointy = with pointyLib; {
stepConfig = evalStepConfig cfg;
presets = evalPresets cfg;
projects = evalProjects cfg;
stepDefs = evalStepDefs cfg;
srcFiles = cfg.srcFiles;
dependencies = evalDependencies cfg;
};
perSystem =
{ pkgs, ... }:
{
config = {
packages = {
pointy =
with pointyLib;
fakeDrv
// {
steps = evalSteps <| cfg // { inherit pkgs; };
projectOutPaths = evalProjectOutPaths <| cfg // { inherit pkgs; };
autocomplete = evalAutocomplete <| cfg // { inherit pkgs; };
};
};
};
};
};
};
};
}