add nixos-module test app
This commit is contained in:
parent
7bd404aeea
commit
a0998bde12
44
flake.nix
44
flake.nix
|
@ -116,6 +116,12 @@
|
|||
nixpkgs = nixpkgsFor.${system};
|
||||
nixpkgsLocal = nixpkgsFor.${localSystem};
|
||||
packages = self.packages.${system};
|
||||
} // {
|
||||
nixosGuest = {
|
||||
type = "app";
|
||||
program =
|
||||
"${self.checks.${localSystem}.nixosGuest}/bin/run-nixos-vm";
|
||||
};
|
||||
});
|
||||
in apps' // { x86_64-linux = apps'.x86_64-linux-x86_64-genode; };
|
||||
|
||||
|
@ -144,21 +150,37 @@
|
|||
system = localSystem;
|
||||
modules = [
|
||||
self.nixosModules.genodeHost
|
||||
{
|
||||
genode.guests.flakeCheck = {
|
||||
config = { config, lib, pkgs, ... }: {
|
||||
services.sshd.enable = true;
|
||||
services.nginx.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
users.users.root.password = "nixos";
|
||||
services.openssh.permitRootLogin = lib.mkDefault "yes";
|
||||
services.mingetty.autologinUser = lib.mkDefault "root";
|
||||
({ modulesPath, ... }: {
|
||||
imports = [ "${modulesPath}/virtualisation/qemu-vm.nix" ];
|
||||
boot.loader.grub.extraEntriesBeforeNixOS = true;
|
||||
virtualisation = {
|
||||
cores = 2;
|
||||
memorySize = 1024;
|
||||
useBootLoader = true;
|
||||
qemu = {
|
||||
options =
|
||||
[ "-machine q35" "-cpu phenom" "-serial mon:stdio" ];
|
||||
networkingOptions = [
|
||||
"-net nic,netdev=user.0,model=e1000"
|
||||
"-netdev user,id=user.0\${QEMU_NET_OPTS:+,$QEMU_NET_OPTS}"
|
||||
];
|
||||
};
|
||||
};
|
||||
}
|
||||
genode.guests.flakeCheck = {
|
||||
config = { config, lib, pkgs, ... }: {
|
||||
networking.firewall.allowedTCPPorts = [ 80 ];
|
||||
services.mingetty.autologinUser = lib.mkDefault "root";
|
||||
services.nginx.enable = true;
|
||||
services.openssh.permitRootLogin = lib.mkDefault "yes";
|
||||
services.sshd.enable = true;
|
||||
users.users.root.password = "nixos";
|
||||
virtualbox.memorySize = 128;
|
||||
};
|
||||
};
|
||||
})
|
||||
];
|
||||
};
|
||||
in nixos.config.system.build.genode.firmware;
|
||||
in nixos.config.system.build.vm;
|
||||
|
||||
});
|
||||
in { x86_64-linux = checks'.x86_64-linux-x86_64-genode; };
|
||||
|
|
Loading…
Reference in New Issue