-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
36 lines (35 loc) · 1.29 KB
/
default.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
{
fractalide ? import <fractalide> {}
, buffet ? fractalide.buffet
, rs ? null
, purs ? null
}:
let
inherit (buffet.pkgs.lib) attrVals recursiveUpdate;
inherit (buffet.pkgs) writeTextFile;
inherit (builtins) head;
target = if rs != null then { name = "rs"; nodes = newBuffet.nodes.rs; node = rs;}
else if purs != null then { name = "purs"; nodes = newBuffet.nodes.purs; node = purs;}
else { name = "rs"; nodes = newBuffet.nodes.rs; node = rs;};
targetNode = (head (attrVals [target.node] target.nodes));
newBuffet = {
nodes = recursiveUpdate buffet.nodes fractalNodes;
edges = recursiveUpdate buffet.edges fractalEdges;
support = buffet.support;
imsg = buffet.imsg;
mods = recursiveUpdate buffet.mods fractalMods;
pkgs = buffet.pkgs;
release = buffet.release;
verbose = buffet.verbose;
};
fractalEdges = import ./edges { buffet = newBuffet; };
fractalNodes = import ./nodes { buffet = newBuffet; };
fractalMods = import ./mods { buffet = newBuffet; };
fvm = import (<fractalide> + "/nodes/fvm/${target.name}") { buffet = newBuffet; };
test = writeTextFile {
name = targetNode.name;
text = "${fvm}/bin/fvm ${targetNode}";
executable = true;
};
in
{ nodes = fractalNodes; edges = fractalEdges; test = test; service = ./service.nix; }