2
0
Fork 0

fixup nixos module

This commit is contained in:
Ehmry - 2020-05-22 18:34:23 +05:30
parent e884bd854f
commit 7715c1ce11
3 changed files with 16 additions and 9 deletions

View File

@ -158,7 +158,7 @@
}
];
};
in nixos.config.system.build.genodeFirmware;
in nixos.config.system.build.genode.firmware;
});
in { x86_64-linux = checks'.x86_64-linux-x86_64-genode; };

View File

@ -20,35 +20,38 @@ let
guestChildren = lib'.runDhallCommand "vbox.dhall" { } (''
dhall > $out << END
let Genode = env:DHALL_GENODE
let toVbox = ${./dhall/vbox-guest.dhall}
in [
'' + builtins.concatStringsSep "," (lib.mapAttrsToList (vmName: cfg:
let
inherit (cfg) config;
vdiFile = "${toVdi config}/nixos.vdi";
in ''
in lib'.runDhallCommand "vbox.dhall" { } ''
vdiUuid=$(${pkgs.virtualbox}/bin/VBoxManage showmediuminfo "${vdiFile}" | awk '/^UUID:/ {print $2}')
dhall > $out << END
{ mapKey = "vbox-${vmName}"
, mapValue =
toVbox
${./dhall/vbox-guest.dhall}
{ vdiFilename = "${vdiFile}"
, vdiUuid =
"$(${pkgs.virtualbox}/bin/VBoxManage showmediuminfo ${vdiFile} | awk '/^UUID:/ {print \$2}')"
, vdiUuid = "$vdiUuid"
, memorySize = ${toString config.virtualbox.memorySize}
, vmName = "${vmName}"
}
}
END
'') config.genode.guests) + ''
] : Genode.Init.Children.Type
END
'');
initConfig = "${./dhall}/vbox-host.dhall ${guestChildren}";
buildBootDescription =
self.legacyPackages.x86_64-linux.callPackage ./buildBootDescription.nix {
lib = lib';
};
bootDescription = buildBootDescription {
initConfig = "${./dhall}/vbox-host.dhall ${guestChildren}";
inherit initConfig;
imageInputs = map pkgs'.genodeSources.depot [
"acpi_drv"
"ahci_drv"
@ -130,7 +133,11 @@ in {
};
config = {
system.build.genodeFirmware = firmware;
system.build.genode = {
inherit firmware;
config = lib'.runDhallCommand "config.dhall" { }
''dhall > $out <<< "${initConfig}"'';
};
boot.loader.grub = {
extraEntries = ''

View File

@ -479,7 +479,7 @@ let rootInit =
, XML.leaf
{ name = "policy"
, attributes = toMap
{ label_last = "nix"
{ label = "nix"
, root = "/store"
, writeable = "no"
}