feat(darknet): vm for dn42

nothing done
This commit is contained in:
catvayor 2024-12-10 18:00:39 +01:00
parent ba22476b25
commit 9b3c851d4a
Signed by: lbailly
GPG key ID: CE3E645251AC63F3
5 changed files with 113 additions and 0 deletions

View file

@ -0,0 +1,48 @@
{
...
}:
{
deployment = {
targetHost = "darknet.kat";
tags = [ "kat-vms" ];
};
imports = [
./hardware-configuration.nix
./disks.nix
];
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelParams = [ "console=ttyS0" ];
};
systemd.network.networks."10-enp1s0" = {
name = "enp1s0";
address = [
"192.168.122.8/24"
"fe80::8/64"
];
routes = [
{
Gateway = "192.168.122.1";
}
];
dns = [ "192.168.122.1" ];
};
services = {
getty.autologinUser = "root";
openssh.enable = true;
};
networking = {
useDHCP = false;
firewall.enable = false;
};
system.stateVersion = "23.11";
}

View file

@ -0,0 +1,4 @@
{
meta.unstable = true;
config = import ./configuration.nix;
}

View file

@ -0,0 +1,29 @@
{
disko.devices = {
disk = {
vda = {
device = "/dev/vda";
type = "disk";
content = {
type = "gpt";
partitions = {
ESP = {
type = "EF00";
size = "100%";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
};
};
};
};
};
boot.initrd.kernelModules = [ "virtiofs" ];
fileSystems."/" = {
device = "root";
fsType = "virtiofs";
};
}

View file

@ -0,0 +1,27 @@
{
lib,
modulesPath,
...
}:
{
imports = [ (modulesPath + "/profiles/qemu-guest.nix") ];
boot = {
initrd = {
availableKernelModules = [
"ahci"
"xhci_pci"
"virtio_pci"
"sr_mod"
"virtio_blk"
];
kernelModules = [ ];
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
networking.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
}

View file

@ -45,6 +45,11 @@
proxyJump = "manah.kat"; proxyJump = "manah.kat";
}; };
"darknet.kat" = {
user = "root";
hostname = "fe80::8%%virbr0";
proxyJump = "manah.kat";
};
"sas.ens" = { "sas.ens" = {
user = "lbailly"; user = "lbailly";
hostname = "sas.eleves.ens.fr"; hostname = "sas.eleves.ens.fr";