-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
49 lines (40 loc) · 1.39 KB
/
flake.nix
File metadata and controls
49 lines (40 loc) · 1.39 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
{
description = "A bootstrapping x86_64 compiler pipeline implemented in pure Nix (Minimally Dependent)";
inputs = { }; # No external inputs!
outputs = { self }:
let
# Use lib.nix for everything
lib = import ./lib/lib.nix { inherit lib; };
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
# Minimal forAllSystems implementation
forAllSystems = f: builtins.listToAttrs (map (system: {
name = system;
value = f system;
}) supportedSystems);
in
{
# Expose lib for internal/external use
inherit lib;
# Expose core components in the flake output
core = {
parser = import ./core/xml-parser.nix { inherit lib; };
assembler = { spec }: import ./core/assembler.nix { inherit lib spec; };
elf = import ./core/elf.nix { inherit lib; };
};
# Expose frontend components
frontend = {
syntax = import ./frontend/syntax.nix { inherit lib; };
compiler = import ./frontend/compiler.nix { inherit lib; };
};
packages = forAllSystems (system: {
default = import ./default.nix { inherit lib; };
});
# A simple app that builds and runs
apps = forAllSystems (system: {
default = {
type = "app";
program = "${self.packages.${system}.default}";
};
});
};
}