-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.shard
35 lines (32 loc) · 1.24 KB
/
bootstrap.shard
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
with import ./geode.shard;
config: let
bootstrapPkgs = pkgList: builtins.map manager.installPkg pkgList;
createInitrd = initrd: builtins.seqList [
(util.io.logMajor ("Creating initrd " + (builtins.toString initrd.path) + "...") null)
(geode.proc.spawn "tar"
([
("--format=" + initrd.compression)
"-cf"
(builtins.toString $ util.paths.prefix + initrd.path)
"--no-recursion" "-C"
(builtins.toString geode.prefix)
] ++ (util.dirEnts geode.prefix))
true
)
];
createIso = file: builtins.seqList [
(util.io.logMajor ("Creating Image " + file + "...") null)
(util.shell.xorriso [
# TODO: make bootloader-generic
"-as" "mkisofs" "-b" "boot/limine/limine-bios-cd.bin"
"-no-emul-boot" "-boot-load-size" 4 "-boot-info-table"
(util.paths.prefix) "-o" file
])
(geode.proc.spawn "limine/limine" ["bios-install" file] true)
];
in
builtins.seqList [
(bootstrapPkgs config.environment.packages)
(builtins.when config.boot.initrd.enabled $ createInitrd config.boot.initrd)
(createIso "amethyst.iso")
]