2
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; }; in { x86_64-linux = checks'.x86_64-linux-x86_64-genode; };

View File

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

View File

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