2
0
Fork 0

add nixos-module test app

This commit is contained in:
Ehmry - 2020-05-23 20:22:25 +05:30
parent 7bd404aeea
commit a0998bde12
1 changed files with 33 additions and 11 deletions

View File

@ -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; };