Compare commits

...

2 commits

Author SHA1 Message Date
isabel roses c2143518d7
feat: inital support for x86_64-linux 2024-06-13 22:40:41 +01:00
Jake Hamilton 856b88321e
fix: correct broken submodules 2024-06-13 10:22:57 -07:00
80 changed files with 2814 additions and 1137 deletions

View file

@ -4,11 +4,7 @@
modules = import ./src; modules = import ./src;
result = lib.modules.run { result = lib.modules.run {
modules = modules = (builtins.attrValues modules) ++ [{config.aux.system = system;}];
(builtins.attrValues modules)
++ [
{config.aux.system = system;}
];
}; };
in in
result.config.exports.resolved.packages result.config.exports.resolved.packages

View file

@ -3,10 +3,10 @@
"lib": { "lib": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"dirtyRev": "f24f0876a9103c7adb8120ce9709fb90c73f2a7c-dirty", "dirtyRev": "856b88321e5f19019332f8b60b729095c2260340-dirty",
"dirtyShortRev": "f24f087-dirty", "dirtyShortRev": "856b883-dirty",
"lastModified": 1718105966, "lastModified": 1718299377,
"narHash": "sha256-L68G29+bPmwZSERg3VYXdfont/w+mssmWnrs6tyBijk=", "narHash": "sha256-qsSV+ty3XdEOlxJr5/1ZGheyjDAIu3xWtFxVs1+rDKA=",
"type": "git", "type": "git",
"url": "file:../?dir=lib" "url": "file:../?dir=lib"
}, },

View file

@ -14,24 +14,18 @@
forEachSystem = lib.attrs.generate [ forEachSystem = lib.attrs.generate [
"i686-linux" "i686-linux"
"x86_64-linux"
]; ];
in { in {
extras = let extras = let
result = lib.modules.run { result = lib.modules.run {modules = builtins.attrValues modules;};
modules =
builtins.attrValues modules;
};
in in
result.config.exports.resolved.extras; result.config.exports.resolved.extras;
packages = forEachSystem ( packages = forEachSystem (
system: let system: let
result = lib.modules.run { result = lib.modules.run {
modules = modules = (builtins.attrValues modules) ++ [{config.aux.system = system;}];
(builtins.attrValues modules)
++ [
{config.aux.system = system;}
];
}; };
in in
result.config.exports.resolved.packages result.config.exports.resolved.packages

View file

@ -2,7 +2,7 @@
lib, lib,
config, config,
}: let }: let
system = config.aux.system; inherit (config.aux) system;
architecture = architecture =
if system == "x86_64-linux" if system == "x86_64-linux"

View file

@ -35,7 +35,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -47,24 +50,26 @@ in {
config = { config = {
aux.foundation.stages.stage0.kaem = { aux.foundation.stages.stage0.kaem = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "kaem"; builders.raw.build {
version = "1.6.0"; pname = "kaem";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = kaem-unwrapped.package; executable = kaem-unwrapped.package;
args = [ args = [
"--verbose" "--verbose"
"--strict" "--strict"
"--file" "--file"
./build.kaem ./build.kaem
]; ];
kaemUnwrapped = kaem-unwrapped.package; kaemUnwrapped = kaem-unwrapped.package;
PATH = lib.paths.bin [mescc-tools-extra.package]; PATH = lib.paths.bin [mescc-tools-extra.package];
}); }
);
}; };
}; };
} }

View file

@ -43,7 +43,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -55,27 +58,29 @@ in {
config = { config = {
aux.foundation.stages.stage0.mescc-tools-extra = { aux.foundation.stages.stage0.mescc-tools-extra = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "mescc-tools-tools"; builders.raw.build {
version = "1.6.0"; pname = "mescc-tools-tools";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = kaem-unwrapped.package; executable = kaem-unwrapped.package;
args = [ args = [
"--verbose" "--verbose"
"--strict" "--strict"
"--file" "--file"
./build.kaem ./build.kaem
]; ];
src = sources.mescc-tools-extra; src = sources.mescc-tools-extra;
m2libcOS = "linux"; m2libcOS = "linux";
m2libcArch = architecture.m2libc; m2libcArch = architecture.m2libc;
mesccTools = mescc-tools.package; mesccTools = mescc-tools.package;
}); }
);
}; };
}; };
} }

View file

@ -129,7 +129,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -141,42 +144,44 @@ in {
config = { config = {
aux.foundation.stages.stage0.mescc-tools = { aux.foundation.stages.stage0.mescc-tools = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "mescc-tools"; builders.raw.build {
version = "1.6.0"; pname = "mescc-tools";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = kaem-unwrapped.package; executable = kaem-unwrapped.package;
args = [ args = [
"--verbose" "--verbose"
"--strict" "--strict"
"--file" "--file"
./build.kaem ./build.kaem
]; ];
M1 = M1.package; M1 = M1.package;
M2 = M2.package; M2 = M2.package;
blood-elf-0 = blood-elf.package; blood-elf-0 = blood-elf.package;
hex2 = hex2.package; hex2 = hex2.package;
m2libc = sources.m2libc; m2libc = sources.m2libc;
m2libcArch = architecture.m2libc; m2libcArch = architecture.m2libc;
m2planet = sources.m2planet; m2planet = sources.m2planet;
m2mesoplanet = sources.m2mesoplanet; m2mesoplanet = sources.m2mesoplanet;
mesccTools = sources.mescc-tools; mesccTools = sources.mescc-tools;
mesccToolsExtra = sources.mescc-tools-extra; mesccToolsExtra = sources.mescc-tools-extra;
bloodFlag = bloodFlag; bloodFlag = bloodFlag;
endianFlag = endianFlag; endianFlag = endianFlag;
baseAddress = baseAddress; baseAddress = baseAddress;
mkdir = getExtraUtil "mkdir"; mkdir = getExtraUtil "mkdir";
cp = getExtraUtil "cp"; cp = getExtraUtil "cp";
chmod = getExtraUtil "chmod"; chmod = getExtraUtil "chmod";
replace = getExtraUtil "replace"; replace = getExtraUtil "replace";
}); }
);
}; };
}; };
} }

View file

@ -41,7 +41,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -66,23 +69,25 @@ in {
config = { config = {
aux.foundation.stages.stage0.hex0 = { aux.foundation.stages.stage0.hex0 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "hex0"; builders.raw.build {
version = "1.6.0"; pname = "hex0";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = cfg.executable; executable = cfg.executable;
args = [ args = [
"${sources.base}/hex0_${architecture}.hex0" "${sources.base}/hex0_${architecture}.hex0"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
outputHashMode = "recursive"; outputHashMode = "recursive";
outputHashAlgo = "sha256"; outputHashAlgo = "sha256";
outputHash = cfg.hash; outputHash = cfg.hash;
}); }
);
hash = lib.modules.overrides.default ( hash = lib.modules.overrides.default (
if system == "x86_64-linux" if system == "x86_64-linux"
@ -94,12 +99,14 @@ in {
else null else null
); );
executable = lib.modules.overrides.default (import <nix/fetchurl.nix> { executable = lib.modules.overrides.default (
name = "hex0-seed"; import <nix/fetchurl.nix> {
url = "https://github.com/oriansj/bootstrap-seeds/raw/b1263ff14a17835f4d12539226208c426ced4fba/POSIX/${architecture}/hex0-seed"; name = "hex0-seed";
executable = true; url = "https://github.com/oriansj/bootstrap-seeds/raw/b1263ff14a17835f4d12539226208c426ced4fba/POSIX/${architecture}/hex0-seed";
hash = cfg.hash; executable = true;
}); hash = cfg.hash;
}
);
}; };
}; };
} }

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -46,19 +49,21 @@ in {
config = { config = {
aux.foundation.stages.stage0.hex1 = { aux.foundation.stages.stage0.hex1 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "hex1"; builders.raw.build {
version = "1.6.0"; pname = "hex1";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex0.package; executable = hex0.package;
args = [ args = [
"${sources.base}/hex1_${architecture.base}.hex0" "${sources.base}/hex1_${architecture.base}.hex0"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}); }
);
}; };
}; };
} }

View file

@ -35,7 +35,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -47,19 +50,21 @@ in {
config = { config = {
aux.foundation.stages.stage0.hex2-0 = { aux.foundation.stages.stage0.hex2-0 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "hex2-0"; builders.raw.build {
version = "1.6.0"; pname = "hex2-0";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex1.package; executable = hex1.package;
args = [ args = [
"${sources.base}/hex2_${architecture.base}.hex1" "${sources.base}/hex2_${architecture.base}.hex1"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}); }
);
}; };
}; };
} }

View file

@ -36,7 +36,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -48,28 +51,30 @@ in {
config = { config = {
aux.foundation.stages.stage0.catm = { aux.foundation.stages.stage0.catm = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "catm"; builders.raw.build {
version = "1.6.0"; pname = "catm";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = executable =
if architecture.base == "AArch64" if architecture.base == "AArch64"
then hex1.package then hex1.package
else hex2-0.package; else hex2-0.package;
args = args =
if architecture.base == "AArch64" if architecture.base == "AArch64"
then [ then [
"${sources.base}/catm_${architecture.base}.hex1" "${sources.base}/catm_${architecture.base}.hex1"
(builtins.placeholder "out") (builtins.placeholder "out")
] ]
else [ else [
"${sources.base}/catm_${architecture.base}.hex2" "${sources.base}/catm_${architecture.base}.hex2"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}); }
);
}; };
}; };
} }

View file

@ -36,7 +36,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -48,34 +51,36 @@ in {
config = { config = {
aux.foundation.stages.stage0.M0 = { aux.foundation.stages.stage0.M0 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "M0"; builders.raw.build {
version = "1.6.0"; pname = "M0";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2-0.package; executable = hex2-0.package;
args = let args = let
M0_hex2-0 = builders.raw.build { M0_hex2-0 = builders.raw.build {
pname = "M0_hex2-0"; pname = "M0_hex2-0";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = catm.package;
args = [ args = [
(builtins.placeholder "out") (builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2" "${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
"${sources.base}/M0_${architecture.base}.hex2" "${sources.base}/M0_${architecture.base}.hex2"
]; ];
}; };
in [ in [
M0_hex2-0 M0_hex2-0
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}); }
);
}; };
}; };
} }

View file

@ -37,7 +37,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -49,47 +52,49 @@ in {
config = { config = {
aux.foundation.stages.stage0.cc_arch = { aux.foundation.stages.stage0.cc_arch = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "cc_arch"; builders.raw.build {
version = "1.6.0"; pname = "cc_arch";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2-0.package; executable = hex2-0.package;
args = let args = let
cc_arch0_hex2-0 = builders.raw.build { cc_arch0_hex2-0 = builders.raw.build {
pname = "cc_arch0_hex2-0"; pname = "cc_arch0_hex2-0";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M0.package; executable = M0.package;
args = [ args = [
"${sources.base}/cc_${architecture.m2libc}.M1" "${sources.base}/cc_${architecture.m2libc}.M1"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
cc_arch1_hex2-0 = builders.raw.build { cc_arch1_hex2-0 = builders.raw.build {
pname = "cc_arch1_hex2-0"; pname = "cc_arch1_hex2-0";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = catm.package;
args = [ args = [
(builtins.placeholder "out") (builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2" "${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
cc_arch0_hex2-0 cc_arch0_hex2-0
]; ];
}; };
in [ in [
cc_arch1_hex2-0 cc_arch1_hex2-0
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}); }
);
}; };
}; };
} }

View file

@ -38,7 +38,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -50,97 +53,99 @@ in {
config = { config = {
aux.foundation.stages.stage0.M2 = { aux.foundation.stages.stage0.M2 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "M2"; builders.raw.build {
version = "1.6.0"; pname = "M2";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2-0.package; executable = hex2-0.package;
args = let args = let
M2_c = builders.raw.build { M2_c = builders.raw.build {
pname = "M2_c"; pname = "M2_c";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = catm.package;
args = [ args = [
(builtins.placeholder "out") (builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c" "${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"${sources.m2planet}/cc.h" "${sources.m2planet}/cc.h"
"${sources.m2libc}/bootstrappable.c" "${sources.m2libc}/bootstrappable.c"
"${sources.m2planet}/cc_globals.c" "${sources.m2planet}/cc_globals.c"
"${sources.m2planet}/cc_reader.c" "${sources.m2planet}/cc_reader.c"
"${sources.m2planet}/cc_strings.c" "${sources.m2planet}/cc_strings.c"
"${sources.m2planet}/cc_types.c" "${sources.m2planet}/cc_types.c"
"${sources.m2planet}/cc_core.c" "${sources.m2planet}/cc_core.c"
"${sources.m2planet}/cc_macro.c" "${sources.m2planet}/cc_macro.c"
"${sources.m2planet}/cc.c" "${sources.m2planet}/cc.c"
]; ];
}; };
M2_M1 = builders.raw.build { M2_M1 = builders.raw.build {
pname = "M2_M1"; pname = "M2_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = cc_arch.package; executable = cc_arch.package;
args = [ args = [
M2_c M2_c
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
M2_M1' = builders.raw.build { M2_M1' = builders.raw.build {
pname = "M2_M1"; pname = "M2_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = catm.package;
args = [ args = [
(builtins.placeholder "out") (builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1" "${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1" "${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
M2_M1 M2_M1
]; ];
}; };
M2_hex2-0 = builders.raw.build { M2_hex2-0 = builders.raw.build {
pname = "M2_hex2-0"; pname = "M2_hex2-0";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M0.package; executable = M0.package;
args = [ args = [
M2_M1' M2_M1'
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
M2_hex2-0' = builders.raw.build { M2_hex2-0' = builders.raw.build {
pname = "M2_hex2-0"; pname = "M2_hex2-0";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = catm.package;
args = [ args = [
(builtins.placeholder "out") (builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2" "${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
M2_hex2-0 M2_hex2-0
]; ];
}; };
in [ in [
M2_hex2-0' M2_hex2-0'
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}); }
);
}; };
}; };
} }

View file

@ -39,7 +39,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -51,86 +54,88 @@ in {
config = { config = {
aux.foundation.stages.stage0.blood-elf = { aux.foundation.stages.stage0.blood-elf = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "blood-elf"; builders.raw.build {
version = "1.6.0"; pname = "blood-elf";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2-0.package; executable = hex2-0.package;
args = let args = let
blood-elf_M1 = builders.raw.build { blood-elf_M1 = builders.raw.build {
pname = "blood-elf_M1"; pname = "blood-elf_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M2.package; executable = M2.package;
args = [ args = [
"--architecture" "--architecture"
architecture.m2libc architecture.m2libc
"-f" "-f"
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c" "${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"-f" "-f"
"${sources.m2libc}/bootstrappable.c" "${sources.m2libc}/bootstrappable.c"
"-f" "-f"
"${sources.mescc-tools}/stringify.c" "${sources.mescc-tools}/stringify.c"
"-f" "-f"
"${sources.mescc-tools}/blood-elf.c" "${sources.mescc-tools}/blood-elf.c"
"--bootstrap-mode" "--bootstrap-mode"
"-o" "-o"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
blood-elf_M1' = builders.raw.build { blood-elf_M1' = builders.raw.build {
pname = "blood-elf_M1-1"; pname = "blood-elf_M1-1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = catm.package;
args = [ args = [
(builtins.placeholder "out") (builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1" "${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1" "${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
blood-elf_M1 blood-elf_M1
]; ];
}; };
blood-elf_hex2-0 = builders.raw.build { blood-elf_hex2-0 = builders.raw.build {
pname = "blood-elf_hex2-0"; pname = "blood-elf_hex2-0";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M0.package; executable = M0.package;
args = [ args = [
blood-elf_M1' blood-elf_M1'
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
blood-elf_hex2-0' = builders.raw.build { blood-elf_hex2-0' = builders.raw.build {
pname = "blood-elf_hex2-0-1"; pname = "blood-elf_hex2-0-1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = catm.package;
args = [ args = [
(builtins.placeholder "out") (builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2" "${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}.hex2"
blood-elf_hex2-0 blood-elf_hex2-0
]; ];
}; };
in [ in [
blood-elf_hex2-0' blood-elf_hex2-0'
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}); }
);
}; };
}; };
} }

View file

@ -40,7 +40,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -52,110 +55,112 @@ in {
config = { config = {
aux.foundation.stages.stage0.M1-0 = { aux.foundation.stages.stage0.M1-0 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "M1-0"; builders.raw.build {
version = "1.6.0"; pname = "M1-0";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2-0.package; executable = hex2-0.package;
args = let args = let
M1-macro-0_M1 = builders.raw.build { M1-macro-0_M1 = builders.raw.build {
pname = "M1-macro-0_M1"; pname = "M1-macro-0_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M2.package; executable = M2.package;
args = [ args = [
"--architecture" "--architecture"
architecture.m2libc architecture.m2libc
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/M1-macro.c"
"--bootstrap-mode"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
M1-macro-0-footer_M1 = builders.raw.build {
pname = "M1-macro-0-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f" "-f"
M1-macro-0_M1 "${sources.m2libc}/${architecture.m2libc}/linux/bootstrap.c"
( "-f"
if config.aux.platform.endian == "little" "${sources.m2libc}/bootstrappable.c"
then "--little-endian" "-f"
else "--big-endian" "${sources.mescc-tools}/stringify.c"
) "-f"
"${sources.mescc-tools}/M1-macro.c"
"--bootstrap-mode"
"--debug"
"-o" "-o"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
M1-macro-0_M1' = builders.raw.build { M1-macro-0-footer_M1 = builders.raw.build {
pname = "M1-macro-0_M1-1"; pname = "M1-macro-0-footer_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = blood-elf.package;
args = [ args =
(builtins.placeholder "out") (lib.lists.when (config.aux.platform.bits == 64) "--64")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1" ++ [
"${sources.m2libc}/${architecture.m2libc}/libc-core.M1" "-f"
M1-macro-0_M1 M1-macro-0_M1
M1-macro-0-footer_M1 (
]; if config.aux.platform.endian == "little"
}; then "--little-endian"
M1-macro-0_hex2-0 = builders.raw.build { else "--big-endian"
pname = "M1-macro-0_hex2-0"; )
version = "1.6.0"; "-o"
(builtins.placeholder "out")
];
};
M1-macro-0_M1' = builders.raw.build {
pname = "M1-macro-0_M1-1";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M0.package; executable = catm.package;
args = [ args = [
M1-macro-0_M1' (builtins.placeholder "out")
(builtins.placeholder "out") "${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
]; "${sources.m2libc}/${architecture.m2libc}/libc-core.M1"
}; M1-macro-0_M1
M1-macro-0_hex2-0' = builders.raw.build { M1-macro-0-footer_M1
pname = "M1-macro-0_hex2-0-1"; ];
version = "1.6.0"; };
M1-macro-0_hex2-0 = builders.raw.build {
pname = "M1-macro-0_hex2-0";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = catm.package; executable = M0.package;
args = [ args = [
(builtins.placeholder "out") M1-macro-0_M1'
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2" (builtins.placeholder "out")
M1-macro-0_hex2-0 ];
]; };
}; M1-macro-0_hex2-0' = builders.raw.build {
in [ pname = "M1-macro-0_hex2-0-1";
M1-macro-0_hex2-0' version = "1.6.0";
(builtins.placeholder "out")
]; meta = cfg.meta;
});
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
M1-macro-0_hex2-0
];
};
in [
M1-macro-0_hex2-0'
(builtins.placeholder "out")
];
}
);
}; };
}; };
} }

View file

@ -41,7 +41,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -53,128 +56,130 @@ in {
config = { config = {
aux.foundation.stages.stage0.hex2-1 = { aux.foundation.stages.stage0.hex2-1 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "hex2-1"; builders.raw.build {
version = "1.6.0"; pname = "hex2-1";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2-0.package; executable = hex2-0.package;
args = let args = let
hex2_linker_M1 = builders.raw.build { hex2_linker_M1 = builders.raw.build {
pname = "hex2_linker_M1"; pname = "hex2_linker_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M2.package; executable = M2.package;
args = [ args = [
"--architecture" "--architecture"
architecture.m2libc architecture.m2libc
"-f"
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/hex2.h"
"-f"
"${sources.mescc-tools}/hex2_linker.c"
"-f"
"${sources.mescc-tools}/hex2_word.c"
"-f"
"${sources.mescc-tools}/hex2.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
hex2_linker-footer_M1 = builders.raw.build {
pname = "hex2_linker-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f" "-f"
hex2_linker_M1 "${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/hex2.h"
"-f"
"${sources.mescc-tools}/hex2_linker.c"
"-f"
"${sources.mescc-tools}/hex2_word.c"
"-f"
"${sources.mescc-tools}/hex2.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
hex2_linker-footer_M1 = builders.raw.build {
pname = "hex2_linker-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
hex2_linker_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
hex2_linker_hex2 = builders.raw.build {
pname = "hex2_linker_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1-0.package;
args = [
"--architecture"
architecture.m2libc
( (
if config.aux.platform.endian == "little" if config.aux.platform.endian == "little"
then "--little-endian" then "--little-endian"
else "--big-endian" else "--big-endian"
) )
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
hex2_linker_M1
"-f"
hex2_linker-footer_M1
"-o" "-o"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
hex2_linker_hex2 = builders.raw.build { hex2_linker_hex2' = builders.raw.build {
pname = "hex2_linker_hex2"; pname = "hex2_linker_hex2-1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M1-0.package; executable = catm.package;
args = [ args = [
"--architecture" (builtins.placeholder "out")
architecture.m2libc "${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
( hex2_linker_hex2
if config.aux.platform.endian == "little" ];
then "--little-endian" };
else "--big-endian" in [
) hex2_linker_hex2'
"-f" (builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1" ];
"-f" }
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1" );
"-f"
hex2_linker_M1
"-f"
hex2_linker-footer_M1
"-o"
(builtins.placeholder "out")
];
};
hex2_linker_hex2' = builders.raw.build {
pname = "hex2_linker_hex2-1";
version = "1.6.0";
meta = cfg.meta;
executable = catm.package;
args = [
(builtins.placeholder "out")
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
hex2_linker_hex2
];
};
in [
hex2_linker_hex2'
(builtins.placeholder "out")
];
});
}; };
}; };
} }

View file

@ -42,7 +42,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -54,133 +57,135 @@ in {
config = { config = {
aux.foundation.stages.stage0.M1 = { aux.foundation.stages.stage0.M1 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "M1"; builders.raw.build {
version = "1.6.0"; pname = "M1";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2-1.package; executable = hex2-1.package;
args = let args = let
M1-macro_M1 = builders.raw.build { M1-macro_M1 = builders.raw.build {
pname = "M1-macro_M1"; pname = "M1-macro_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M2.package; executable = M2.package;
args = [ args = [
"--architecture" "--architecture"
architecture.m2libc architecture.m2libc
"-f"
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/string.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/M1-macro.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
M1-macro-footer_M1 = builders.raw.build {
pname = "M1-macro-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f" "-f"
M1-macro_M1 "${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/string.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/stringify.c"
"-f"
"${sources.mescc-tools}/M1-macro.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
M1-macro-footer_M1 = builders.raw.build {
pname = "M1-macro-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
M1-macro_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
M1-macro_hex2 = builders.raw.build {
pname = "M1-macro_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1-0.package;
args = [
"--architecture"
architecture.m2libc
( (
if config.aux.platform.endian == "little" if config.aux.platform.endian == "little"
then "--little-endian" then "--little-endian"
else "--big-endian" else "--big-endian"
) )
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
M1-macro_M1
"-f"
M1-macro-footer_M1
"-o" "-o"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
M1-macro_hex2 = builders.raw.build { in [
pname = "M1-macro_hex2"; "--architecture"
version = "1.6.0"; architecture.m2libc
(
meta = cfg.meta; if config.aux.platform.endian == "little"
then "--little-endian"
executable = M1-0.package; else "--big-endian"
)
args = [ "--base-address"
"--architecture" (
architecture.m2libc if config.aux.system == "x86_64-linux"
( then "0x00600000"
if config.aux.platform.endian == "little" else if config.aux.system == "aarch64-linux"
then "--little-endian" then "0x00600000"
else "--big-endian" else if config.aux.system == "i686-linux"
) then "0x08048000"
"-f" else builtins.throw "Unsupported system: ${config.aux.system}"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1" )
"-f" "-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1" "${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f" "-f"
M1-macro_M1 M1-macro_hex2
"-f" "-o"
M1-macro-footer_M1 (builtins.placeholder "out")
"-o" ];
(builtins.placeholder "out") }
]; );
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
M1-macro_hex2
"-o"
(builtins.placeholder "out")
];
});
}; };
}; };
} }

View file

@ -41,7 +41,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -53,135 +56,137 @@ in {
config = { config = {
aux.foundation.stages.stage0.hex2 = { aux.foundation.stages.stage0.hex2 = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "hex2"; builders.raw.build {
version = "1.6.0"; pname = "hex2";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2-1.package; executable = hex2-1.package;
args = let args = let
hex2_linker_M1 = builders.raw.build { hex2_linker_M1 = builders.raw.build {
pname = "hex2_linker_M1"; pname = "hex2_linker_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M2.package; executable = M2.package;
args = [ args = [
"--architecture" "--architecture"
architecture.m2libc architecture.m2libc
"-f"
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/hex2.h"
"-f"
"${sources.mescc-tools}/hex2_linker.c"
"-f"
"${sources.mescc-tools}/hex2_word.c"
"-f"
"${sources.mescc-tools}/hex2.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
hex2_linker-footer_M1 = builders.raw.build {
pname = "hex2_linker-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f" "-f"
hex2_linker_M1 "${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/hex2.h"
"-f"
"${sources.mescc-tools}/hex2_linker.c"
"-f"
"${sources.mescc-tools}/hex2_word.c"
"-f"
"${sources.mescc-tools}/hex2.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
hex2_linker-footer_M1 = builders.raw.build {
pname = "hex2_linker-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
hex2_linker_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
hex2_linker_hex2 = builders.raw.build {
pname = "hex2_linker_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1.package;
args = [
"--architecture"
architecture.m2libc
( (
if config.aux.platform.endian == "little" if config.aux.platform.endian == "little"
then "--little-endian" then "--little-endian"
else "--big-endian" else "--big-endian"
) )
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
hex2_linker_M1
"-f"
hex2_linker-footer_M1
"-o" "-o"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
hex2_linker_hex2 = builders.raw.build { in [
pname = "hex2_linker_hex2"; "--architecture"
version = "1.6.0"; architecture.m2libc
(
meta = cfg.meta; if config.aux.platform.endian == "little"
then "--little-endian"
executable = M1.package; else "--big-endian"
)
args = [ "--base-address"
"--architecture" (
architecture.m2libc if config.aux.system == "x86_64-linux"
( then "0x00600000"
if config.aux.platform.endian == "little" else if config.aux.system == "aarch64-linux"
then "--little-endian" then "0x00600000"
else "--big-endian" else if config.aux.system == "i686-linux"
) then "0x08048000"
"-f" else builtins.throw "Unsupported system: ${config.aux.system}"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1" )
"-f" "-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1" "${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f" "-f"
hex2_linker_M1 hex2_linker_hex2
"-f" "-o"
hex2_linker-footer_M1 (builtins.placeholder "out")
"-o" ];
(builtins.placeholder "out") }
]; );
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
hex2_linker_hex2
"-o"
(builtins.placeholder "out")
];
});
}; };
}; };
} }

View file

@ -41,7 +41,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -53,137 +56,139 @@ in {
config = { config = {
aux.foundation.stages.stage0.kaem-unwrapped = { aux.foundation.stages.stage0.kaem-unwrapped = {
package = lib.modules.overrides.default (builders.raw.build { package = lib.modules.overrides.default (
pname = "kaem-unwrapped"; builders.raw.build {
version = "1.6.0"; pname = "kaem-unwrapped";
version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = hex2.package; executable = hex2.package;
args = let args = let
kaem_M1 = builders.raw.build { kaem_M1 = builders.raw.build {
pname = "kaem_M1"; pname = "kaem_M1";
version = "1.6.0"; version = "1.6.0";
meta = cfg.meta; meta = cfg.meta;
executable = M2.package; executable = M2.package;
args = [ args = [
"--architecture" "--architecture"
architecture.m2libc architecture.m2libc
"-f"
"${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/string.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem.h"
"-f"
"${sources.mescc-tools}/Kaem/variable.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem_globals.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
kaem-footer_M1 = builders.raw.build {
pname = "kaem-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f" "-f"
kaem_M1 "${sources.m2libc}/sys/types.h"
"-f"
"${sources.m2libc}/stddef.h"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/unistd.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/fcntl.c"
"-f"
"${sources.m2libc}/fcntl.c"
"-f"
"${sources.m2libc}/${architecture.m2libc}/linux/sys/stat.c"
"-f"
"${sources.m2libc}/string.c"
"-f"
"${sources.m2libc}/stdlib.c"
"-f"
"${sources.m2libc}/stdio.h"
"-f"
"${sources.m2libc}/stdio.c"
"-f"
"${sources.m2libc}/bootstrappable.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem.h"
"-f"
"${sources.mescc-tools}/Kaem/variable.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem_globals.c"
"-f"
"${sources.mescc-tools}/Kaem/kaem.c"
"--debug"
"-o"
(builtins.placeholder "out")
];
};
kaem-footer_M1 = builders.raw.build {
pname = "kaem-footer_M1";
version = "1.6.0";
meta = cfg.meta;
executable = blood-elf.package;
args =
(lib.lists.when (config.aux.platform.bits == 64) "--64")
++ [
"-f"
kaem_M1
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"-o"
(builtins.placeholder "out")
];
};
kaem_hex2 = builders.raw.build {
pname = "kaem_hex2";
version = "1.6.0";
meta = cfg.meta;
executable = M1.package;
args = [
"--architecture"
architecture.m2libc
( (
if config.aux.platform.endian == "little" if config.aux.platform.endian == "little"
then "--little-endian" then "--little-endian"
else "--big-endian" else "--big-endian"
) )
"-f"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1"
"-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1"
"-f"
kaem_M1
"-f"
kaem-footer_M1
"-o" "-o"
(builtins.placeholder "out") (builtins.placeholder "out")
]; ];
}; };
kaem_hex2 = builders.raw.build { in [
pname = "kaem_hex2"; "--architecture"
version = "1.6.0"; architecture.m2libc
(
meta = cfg.meta; if config.aux.platform.endian == "little"
then "--little-endian"
executable = M1.package; else "--big-endian"
)
args = [ "--base-address"
"--architecture" (
architecture.m2libc if config.aux.system == "x86_64-linux"
( then "0x00600000"
if config.aux.platform.endian == "little" else if config.aux.system == "aarch64-linux"
then "--little-endian" then "0x00600000"
else "--big-endian" else if config.aux.system == "i686-linux"
) then "0x08048000"
"-f" else builtins.throw "Unsupported system: ${config.aux.system}"
"${sources.m2libc}/${architecture.m2libc}/${architecture.m2libc}_defs.M1" )
"-f" "-f"
"${sources.m2libc}/${architecture.m2libc}/libc-full.M1" "${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f" "-f"
kaem_M1 kaem_hex2
"-f" "-o"
kaem-footer_M1 (builtins.placeholder "out")
"-o" ];
(builtins.placeholder "out") }
]; );
};
in [
"--architecture"
architecture.m2libc
(
if config.aux.platform.endian == "little"
then "--little-endian"
else "--big-endian"
)
"--base-address"
(
if config.aux.system == "x86_64-linux"
then "0x00600000"
else if config.aux.system == "aarch64-linux"
then "0x00600000"
else if config.aux.system == "i686-linux"
then "0x08048000"
else builtins.throw "Unsupported system: ${config.aux.system}"
)
"-f"
"${sources.m2libc}/${architecture.m2libc}/ELF-${architecture.m2libc}-debug.hex2"
"-f"
kaem_hex2
"-o"
(builtins.placeholder "out")
];
});
}; };
}; };
} }

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -9,9 +9,7 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in {
includes = [ includes = [./boot.nix];
./boot.nix
];
options.aux.foundation.stages.stage1.bash = { options.aux.foundation.stages.stage1.bash = {
meta = { meta = {
@ -37,7 +35,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -34,7 +34,10 @@ in {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
# TODO: Support more platforms. # TODO: Support more platforms.
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -9,9 +9,7 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in {
includes = [ includes = [./boot.nix];
./boot.nix
];
options.aux.foundation.stages.stage1.coreutils = { options.aux.foundation.stages.stage1.coreutils = {
meta = { meta = {
@ -37,7 +35,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -9,9 +9,7 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in {
includes = [ includes = [./boot.nix];
./boot.nix
];
options.aux.foundation.stages.stage1.gawk = { options.aux.foundation.stages.stage1.gawk = {
meta = { meta = {
@ -37,7 +35,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -39,7 +39,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -9,9 +9,7 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in {
includes = [ includes = [./boot.nix];
./boot.nix
];
options.aux.foundation.stages.stage1.gnumake = { options.aux.foundation.stages.stage1.gnumake = {
meta = { meta = {
@ -37,7 +35,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };
@ -118,13 +121,8 @@ in {
]; ];
objects = objects =
builtins.map builtins.map (
( value: builtins.replaceStrings [".c"] [".o"] (builtins.baseNameOf value)
value:
builtins.replaceStrings
[".c"]
[".o"]
(builtins.baseNameOf value)
) )
sources; sources;
in in
@ -134,9 +132,7 @@ in {
meta = cfg.meta; meta = cfg.meta;
src = cfg.src; src = cfg.src;
deps.build.host = [ deps.build.host = [stage1.tinycc.mes.compiler.package];
stage1.tinycc.mes.compiler.package
];
script = '' script = ''
# Unpack # Unpack

View file

@ -9,9 +9,7 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in {
includes = [ includes = [./boot.nix];
./boot.nix
];
options.aux.foundation.stages.stage1.gnused = { options.aux.foundation.stages.stage1.gnused = {
meta = { meta = {
@ -37,7 +35,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -38,7 +38,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -10,9 +10,7 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
stage2 = config.aux.foundation.stages.stage2; stage2 = config.aux.foundation.stages.stage2;
in { in {
includes = [ includes = [./devtools.nix];
./devtools.nix
];
options.aux.foundation.stages.stage1.heirloom = { options.aux.foundation.stages.stage1.heirloom = {
meta = { meta = {
@ -48,7 +46,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -54,7 +54,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };
}; };

View file

@ -27,7 +27,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };
@ -79,11 +82,9 @@ in {
sources = import ./sources.nix; sources = import ./sources.nix;
files = files = lib.strings.concatMapSep " " (getSourcePath ".o") (
lib.strings.concatMapSep builtins.map compile sources.x86.linux.mescc.mes
" " );
(getSourcePath ".o")
(builtins.map compile sources.x86.linux.mescc.mes);
in in
builders.kaem.build { builders.kaem.build {
name = "mes-${stage1.mes.version}"; name = "mes-${stage1.mes.version}";

View file

@ -32,7 +32,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };
@ -57,9 +60,7 @@ in {
meta = cfg.meta; meta = cfg.meta;
deps.build.host = [ deps.build.host = [stage1.ln-boot.package];
stage1.ln-boot.package
];
script = '' script = ''
cd ${stage1.mes.libs.prefix} cd ${stage1.mes.libs.prefix}

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };
@ -199,11 +202,13 @@ in {
libc-mini = createLib "libc-mini" sources.x86.linux.mescc.libc_mini; libc-mini = createLib "libc-mini" sources.x86.linux.mescc.libc_mini;
libmescc = createLib "libmescc" sources.x86.linux.mescc.libmescc; libmescc = createLib "libmescc" sources.x86.linux.mescc.libmescc;
libc = createLib "libc" sources.x86.linux.mescc.libc; libc = createLib "libc" sources.x86.linux.mescc.libc;
libc_tcc = createLib "libc+tcc" (sources.x86.linux.mescc.libc_tcc libc_tcc = createLib "libc+tcc" (
sources.x86.linux.mescc.libc_tcc
++ [ ++ [
# We need `symlink` support for `ln-boot` to work. # We need `symlink` support for `ln-boot` to work.
"lib/linux/symlink.c" "lib/linux/symlink.c"
]); ]
);
in in
builders.kaem.build { builders.kaem.build {
name = "mes-m2-libs-${stage1.mes.version}"; name = "mes-m2-libs-${stage1.mes.version}";

View file

@ -131,7 +131,6 @@ in {
# Install # Install
make install make install
cp ${stage1.tinycc.mes.libs.package}/lib/libtcc1.a $out/lib cp ${stage1.tinycc.mes.libs.package}/lib/libtcc1.a $out/lib
''; '';
}; };
}; };

View file

@ -9,9 +9,7 @@
stage1 = config.aux.foundation.stages.stage1; stage1 = config.aux.foundation.stages.stage1;
in { in {
includes = [ includes = [./boot.nix];
./boot.nix
];
options.aux.foundation.stages.stage1.musl = { options.aux.foundation.stages.stage1.musl = {
meta = { meta = {
@ -38,7 +36,10 @@ in {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
# TODO: Support more platforms. # TODO: Support more platforms.
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86-64_linux"
];
}; };
}; };

View file

@ -35,7 +35,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"i686-linux"
"x86_64-linux"
];
}; };
}; };

View file

@ -38,7 +38,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -36,7 +36,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };
@ -64,9 +67,7 @@ in {
}; };
package = let package = let
patches = [ patches = [./patches/busybox-in-store.patch];
./patches/busybox-in-store.patch
];
busyboxConfig = [ busyboxConfig = [
"CC=musl-gcc" "CC=musl-gcc"

View file

@ -34,7 +34,10 @@ in {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
# TODO: Support more platforms. # TODO: Support more platforms.
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
mainProgram = lib.options.create { mainProgram = lib.options.create {

View file

@ -33,7 +33,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -34,7 +34,10 @@ in {
platforms = lib.options.create { platforms = lib.options.create {
type = lib.types.list.of lib.types.string; type = lib.types.list.of lib.types.string;
description = "Platforms the package supports."; description = "Platforms the package supports.";
default.value = ["i686-linux"]; default.value = [
"x86_64-linux"
"i686-linux"
];
}; };
}; };

View file

@ -2,7 +2,7 @@
options.aux = { options.aux = {
system = lib.options.create { system = lib.options.create {
type = lib.types.string; type = lib.types.string;
default.value = "i686-linux"; default.value = "x86_64-linux";
description = '' description = ''
The system to build packages for. This value can be provided as either The system to build packages for. This value can be provided as either
`config.aux.system` or by setting the `system` argument for modules. `config.aux.system` or by setting the `system` argument for modules.

View file

@ -187,7 +187,7 @@ lib: {
in in
withFreeform (withMeta base); withFreeform (withMeta base);
} }
else builtins.throw "Module `${key}` has unsupported attribute(s): ${invalidKeys}"; else builtins.throw "Module `${key}` (${file}) has unsupported attribute(s): ${invalidKeys}";
## Convert a module that is either a function or an attribute set into ## Convert a module that is either a function or an attribute set into
## a resolved attribute set. If the module was a function then it will ## a resolved attribute set. If the module was a function then it will
@ -428,7 +428,7 @@ lib: {
matched = lib.options.run location option definitions'; matched = lib.options.run location option definitions';
unmatched = []; unmatched = [];
} }
else builtins.throw "The option `${lib.options.getIdentifier location}` in module `${(builtins.head optionDeclarations).__file__}` does not support nested options." else builtins.throw "The option `${lib.options.getIdentifier location}` in module `${(builtins.head optionDeclarations).__file__}` would be a parent of the following options, but its type `${(builtins.head optionDeclarations).options.type.description or "<no description>"}` does not support nested options."
else process location declarations definitions else process location declarations definitions
) )
declarationsByName; declarationsByName;
@ -611,7 +611,7 @@ lib: {
collected = collected =
collect collect
(args.path or "") (args.path or "")
(modules ++ [internal]) ([internal] ++ modules)
( (
{ {
inherit options config; inherit options config;
@ -625,7 +625,8 @@ lib: {
// args // args
); );
in in
lib.modules.combine prefix (lib.lists.reverse collected); lib.modules.combine
prefix (lib.lists.reverse collected);
options = merged.matched; options = merged.matched;

View file

@ -423,5 +423,36 @@ in {
}; };
in in
evaluated.config.aux.message == expected; evaluated.config.aux.message == expected;
"submodules" = let
expected = "Hello, World!";
evaluated = lib.modules.run {
modules = [
{
options = {
aux = lib.options.create {
default.value = {
message = "hi";
};
type = lib.types.attrs.of (lib.types.submodule ({name}: {
# freeform = lib.types.any;
options.message = lib.options.create {
type = lib.types.string;
};
}));
};
};
config = {
aux = {
x = {
message = "Hello, World!";
};
};
};
}
];
};
in
evaluated.config.aux.x.message == expected;
}; };
} }

View file

@ -750,10 +750,16 @@ lib: {
description ? null, description ? null,
}: let }: let
getModules = builtins.map ( getModules = builtins.map (
definition: { definition:
__file__ = definition.__file__; if builtins.isAttrs definition
includes = [definition.value]; then {
} __file__ = definition.__file__;
config = definition.value;
}
else {
__file__ = definition.__file__;
includes = [definition.value];
}
); );
base = lib.modules.run { base = lib.modules.run {
@ -762,9 +768,6 @@ lib: {
modules = modules =
[ [
{ {
options.__module__.args.dynamic.name = lib.options.create {
type = lib.types.string;
};
config.__module__.args.dynamic.name = lib.modules.overrides.default "<name>"; config.__module__.args.dynamic.name = lib.modules.overrides.default "<name>";
} }
] ]
@ -989,7 +992,7 @@ lib: {
## @type List Attrs -> Attrs ## @type List Attrs -> Attrs
one = types: let one = types: let
first = builtins.elemAt types 0; first = builtins.elemAt types 0;
rest = lib.lists.tail types; rest = builtins.tail types;
in in
if types == [] if types == []
then builtins.throw "lib.types.one must be given at least one type" then builtins.throw "lib.types.one must be given at least one type"

View file

@ -10,21 +10,24 @@
++ [ ++ [
./src/export.nix ./src/export.nix
{ {
__file__ = ./default.nix; __file__ = "broken";
options.packages.aux = { # options.foundation = lib.options.create {
foundation = lib.options.create { # type = lib.types.attrs.of lib.types.derivation;
type = lib.types.attrs.of lib.types.package; # };
internal = true;
description = "The foundational packages used to construct the larger package set.";
};
};
config.packages.aux = { # config.foundation = foundation;
foundation = foundation; config.packages.foundation =
}; builtins.mapAttrs (name: package: {
name = package.name;
inherit package;
meta = package.meta;
})
foundation;
} }
]; ];
}; };
in in
result.config.exported result.config

View file

@ -8,10 +8,10 @@
}, },
"locked": { "locked": {
"dir": "foundation", "dir": "foundation",
"dirtyRev": "cd12786be17a611976b44fbba3e245eca512535f-dirty", "dirtyRev": "9c29945531c58ad81f05cd1f4958c8894a733216-dirty",
"dirtyShortRev": "cd12786-dirty", "dirtyShortRev": "9c29945-dirty",
"lastModified": 1718199069, "lastModified": 1718255029,
"narHash": "sha256-H2Mkyp9BPDPte+E++uIG2N/vGtcS3H9Q7tM3fOOEXT0=", "narHash": "sha256-fmrDe4GfvVfXZ9lzaOt+tgBUMFCsyKr0Dlnm8aQwAXs=",
"type": "git", "type": "git",
"url": "file:../?dir=foundation" "url": "file:../?dir=foundation"
}, },
@ -24,10 +24,10 @@
"lib": { "lib": {
"locked": { "locked": {
"dir": "lib", "dir": "lib",
"dirtyRev": "cd12786be17a611976b44fbba3e245eca512535f-dirty", "dirtyRev": "9c29945531c58ad81f05cd1f4958c8894a733216-dirty",
"dirtyShortRev": "cd12786-dirty", "dirtyShortRev": "9c29945-dirty",
"lastModified": 1718199069, "lastModified": 1718255029,
"narHash": "sha256-H2Mkyp9BPDPte+E++uIG2N/vGtcS3H9Q7tM3fOOEXT0=", "narHash": "sha256-fmrDe4GfvVfXZ9lzaOt+tgBUMFCsyKr0Dlnm8aQwAXs=",
"type": "git", "type": "git",
"url": "file:../?dir=lib" "url": "file:../?dir=lib"
}, },

View file

@ -2,7 +2,7 @@
lib, lib,
config, config,
}: let }: let
cfg = config.exports.modules; cfg = config.exports;
type = lib.types.one [ type = lib.types.one [
lib.types.path lib.types.path

View file

@ -2,6 +2,7 @@
config, config,
lib, lib,
}: let }: let
lib' = config.lib;
in { in {
options = { options = {
exports.packages = lib.options.create { exports.packages = lib.options.create {
@ -14,6 +15,8 @@ in {
}; };
config = { config = {
exported.packages = {}; exported.packages = {
# i686-linux = config.packages.foundation;
};
}; };
} }

File diff suppressed because it is too large Load diff

View file

@ -107,164 +107,354 @@ in {
}; };
}; };
package = lib.types.submodule ({config}: { package = {
freeform = lib.types.any; base = lib.types.submodule ({config}: {
freeform = lib.types.any;
options = { options = {
name = lib.options.create { name = lib.options.create {
type = lib.types.string; type = lib.types.string;
default = { default = {
value = "${config.pname}-${config.version or "unknown"}"; value = "${config.pname}-${config.version or "unknown"}";
text = "\${config.pname}-\${config.version}"; text = "\${config.pname}-\${config.version}";
};
description = "The name of the package.";
};
pname = lib.options.create {
type = lib.types.nullish lib.types.string;
default.value = null;
description = "The name of the package.";
};
version = lib.options.create {
type = lib.types.nullish lib.types.string;
default.value = null;
description = "The version of the package.";
};
meta = lib.options.create {
type = lib'.types.meta;
default = {
text = "{ name = <package>.pname; }";
value = {
name = config.pname;
}; };
}; description = "The name of the package.";
description = "The metadata for the package.";
};
env = lib.options.create {
type = lib.types.attrs.of lib.types.string;
default.value = {};
description = "Environment variables for the package's builder to use.";
};
phases = lib.options.create {
type = lib.types.dag.of (
lib.types.either
lib.types.string
(lib.types.function lib.types.string)
);
default.value = {};
description = "Phases for the package's builder to use.";
};
platform = {
build = lib.options.create {
type = lib.types.string;
description = "The platform the package is built on.";
}; };
host = lib.options.create { pname = lib.options.create {
type = lib.types.string; type = lib.types.nullish lib.types.string;
description = "The platform the package is run on."; default.value = null;
description = "The name of the package.";
}; };
target = lib.options.create { version = lib.options.create {
type = lib.types.string; type = lib.types.nullish lib.types.string;
description = "The platform the package generates code for."; default.value = null;
description = "The version of the package.";
}; };
};
builder = lib.options.create { meta = lib.options.create {
type = lib'.types.builder; type = lib'.types.meta;
description = "The builder for the package."; default = {
}; text = "{ name = <package>.pname; }";
value = {
package = lib.options.create { name = config.pname;
type = lib.types.derivation; };
default = {
value = config.builder.build config.builder config;
text = "<derivation>";
};
description = "The package derivation.";
};
deps = {
build = {
only = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are only used in the build environment.";
}; };
description = "The metadata for the package.";
};
env = lib.options.create {
type = lib.types.attrs.of lib.types.string;
default.value = {};
description = "Environment variables for the package's builder to use.";
};
phases = lib.options.create {
type = lib.types.dag.of (
lib.types.either
lib.types.string
(lib.types.function lib.types.string)
);
default.value = {};
description = "Phases for the package's builder to use.";
};
platform = {
build = lib.options.create { build = lib.options.create {
type = lib'.types.dependencies; type = lib.types.nullish lib.types.string;
default.value = {}; default.value = null;
description = "Dependencies which are created in the build environment and are run in the build environment."; description = "The platform the package is built on.";
}; };
host = lib.options.create { host = lib.options.create {
type = lib'.types.dependencies; type = lib.types.nullish lib.types.string;
default.value = {}; default.value = null;
description = "Dependencies which are created in the build environment and are run in the host environment."; description = "The platform the package is run on.";
}; };
target = lib.options.create { target = lib.options.create {
type = lib'.types.dependencies; type = lib.types.nullish lib.types.string;
default.value = {}; default.value = null;
description = "Dependencies which are created in the build environment and are run in the target environment."; description = "The platform the package generates code for.";
}; };
}; };
host = { builder = lib.options.create {
only = lib.options.create { type = lib'.types.builder;
type = lib'.types.dependencies; description = "The builder for the package.";
default.value = {}; };
description = "Dependencies which are only used in the host environment.";
package = lib.options.create {
type = lib.types.derivation;
default = {
value = config.builder.build config.builder config;
text = "<derivation>";
};
description = "The package derivation.";
};
deps = {
build = {
only = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are only used in the build environment.";
};
build = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are created in the build environment and are run in the build environment.";
};
host = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are created in the build environment and are run in the host environment.";
};
target = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are created in the build environment and are run in the target environment.";
};
};
host = {
only = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are only used in the host environment.";
};
host = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are run in the host environment.";
};
target = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are run in the host environment which produces code for the target environment.";
};
};
target = {
only = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are only used in the target environment.";
};
target = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are run in the target environment.";
};
};
};
versions = lib.options.create {
type = lib.types.attrs.of lib'.types.package;
default.value = {};
description = "Available versions of the package.";
};
};
});
targeted = lib.types.submodule ({config}: {
freeform = lib.types.any;
options = {
name = lib.options.create {
type = lib.types.string;
default = {
value = "${config.pname}-${config.version or "unknown"}";
text = "\${config.pname}-\${config.version}";
};
description = "The name of the package.";
};
pname = lib.options.create {
type = lib.types.nullish lib.types.string;
default.value = null;
description = "The name of the package.";
};
version = lib.options.create {
type = lib.types.nullish lib.types.string;
default.value = null;
description = "The version of the package.";
};
meta = lib.options.create {
type = lib'.types.meta;
default = {
text = "{ name = <package>.pname; }";
value = {
name = config.pname;
};
};
description = "The metadata for the package.";
};
env = lib.options.create {
type = lib.types.attrs.of lib.types.string;
default.value = {};
description = "Environment variables for the package's builder to use.";
};
phases = lib.options.create {
type = lib.types.dag.of (
lib.types.either
lib.types.string
(lib.types.function lib.types.string)
);
default.value = {};
description = "Phases for the package's builder to use.";
};
platform = {
build = lib.options.create {
type = lib.types.string;
description = "The platform the package is built on.";
}; };
host = lib.options.create { host = lib.options.create {
type = lib'.types.dependencies; type = lib.types.string;
default.value = {}; description = "The platform the package is run on.";
description = "Dependencies which are run in the host environment.";
}; };
target = lib.options.create { target = lib.options.create {
type = lib'.types.dependencies; type = lib.types.string;
default.value = {}; description = "The platform the package generates code for.";
description = "Dependencies which are run in the host environment which produces code for the target environment.";
}; };
}; };
target = { builder = lib.options.create {
only = lib.options.create { type = lib'.types.builder;
type = lib'.types.dependencies; description = "The builder for the package.";
default.value = {}; };
description = "Dependencies which are only used in the target environment.";
package = lib.options.create {
type = lib.types.derivation;
default = {
value = config.builder.build config.builder config;
text = "<derivation>";
};
description = "The package derivation.";
};
deps = {
build = {
only = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are only used in the build environment.";
};
build = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are created in the build environment and are run in the build environment.";
};
host = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are created in the build environment and are run in the host environment.";
};
target = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are created in the build environment and are run in the target environment.";
};
}; };
target = lib.options.create { host = {
type = lib'.types.dependencies; only = lib.options.create {
default.value = {}; type = lib'.types.dependencies;
description = "Dependencies which are run in the target environment."; default.value = {};
description = "Dependencies which are only used in the host environment.";
};
host = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are run in the host environment.";
};
target = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are run in the host environment which produces code for the target environment.";
};
};
target = {
only = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are only used in the target environment.";
};
target = lib.options.create {
type = lib'.types.dependencies;
default.value = {};
description = "Dependencies which are run in the target environment.";
};
}; };
}; };
};
versions = lib.options.create { versions = lib.options.create {
type = lib.types.attrs.of lib'.types.package; type = lib.types.attrs.of lib'.types.package;
default.value = {}; default.value = {};
description = "Available versions of the package."; description = "Available versions of the package.";
};
}; };
}; });
}); };
dependencies = lib.types.attrs.of (lib.types.nullish lib'.types.package); dependencies = lib.types.attrs.of (lib.types.nullish lib'.types.package);
packages = lib.types.attrs.of (lib.types.submodule { packages = {
freeform = lib.types.nullish lib'.types.package; base = lib.types.attrs.of (lib.types.submodule {
}); freeform = lib'.types.package.base;
# options =
# builtins.foldl' (result: system: {
# "${system}" = lib.options.create {
# type = lib'.types.packages.targeted;
# default.value = {};
# description = "Packages for the architecture `${system}`";
# };
# }) {}
# lib'.systems.doubles.all;
});
targeted = lib.types.attrs.of (lib.types.submodule {
freeform = lib.types.nullish lib'.types.package.targeted;
options = {
cross = lib.options.create {
type = lib'.types.packages.cross;
default.value = {};
description = "Cross-compiled packages targeting another architecture.";
};
};
});
# Cross-compiled packages are accessed via
# packages.cross.<platform>.<namespace>.<name>
cross = lib.types.attrs.of (lib.types.submodule {
freeform = lib.types.attrs.of (lib.types.submodule {
freeform = lib.types.nullish lib'.types.package.targeted;
});
});
};
builder = lib.types.submodule { builder = lib.types.submodule {
freeform = lib.types.any; freeform = lib.types.any;

View file

@ -1,4 +1,5 @@
{ {
exports = ./exports; exports = ./exports;
lib = ./lib; lib = ./lib;
packages = ./packages;
} }

View file

@ -3,19 +3,10 @@
config, config,
}: let }: let
lib' = config.lib; lib' = config.lib;
# configure = namespace: packages:
# builtins.mapAttrs doubles = lib'.systems.doubles.all;
# (key: package: let
# name = generic = builtins.removeAttrs config.packages ["targeted"];
# if package.pname != null && package.version != null
# then "${package.pname}-${package.version}"
# else key;
# in {
# name = lib.modules.overrides.default name;
# package = lib.modules.overrides.default (package.builder package);
# })
# packages;
# configs = builtins.mapAttrs configure config.packages;
in { in {
includes = [ includes = [
# ./aux/foundation.nix # ./aux/foundation.nix
@ -23,9 +14,14 @@ in {
options = { options = {
packages = lib.options.create { packages = lib.options.create {
type = lib'.types.packages; default.value = {};
type = lib.types.attrs.of (lib.types.submodule {
freeform = lib.types.any;
});
}; };
}; };
# config = lib.modules.merge configs; config = {
packages.targeted.i686-linux = generic;
};
} }