feat(darknet): vm for dn42
nothing done
This commit is contained in:
parent
ba22476b25
commit
9b3c851d4a
5 changed files with 113 additions and 0 deletions
48
machines/kat-darknet/configuration.nix
Normal file
48
machines/kat-darknet/configuration.nix
Normal 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";
|
||||
}
|
4
machines/kat-darknet/default.nix
Normal file
4
machines/kat-darknet/default.nix
Normal file
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
meta.unstable = true;
|
||||
config = import ./configuration.nix;
|
||||
}
|
29
machines/kat-darknet/disks.nix
Normal file
29
machines/kat-darknet/disks.nix
Normal 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";
|
||||
};
|
||||
}
|
27
machines/kat-darknet/hardware-configuration.nix
Normal file
27
machines/kat-darknet/hardware-configuration.nix
Normal 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";
|
||||
}
|
|
@ -45,6 +45,11 @@
|
|||
proxyJump = "manah.kat";
|
||||
};
|
||||
|
||||
"darknet.kat" = {
|
||||
user = "root";
|
||||
hostname = "fe80::8%%virbr0";
|
||||
proxyJump = "manah.kat";
|
||||
};
|
||||
"sas.ens" = {
|
||||
user = "lbailly";
|
||||
hostname = "sas.eleves.ens.fr";
|
||||
|
|
Loading…
Reference in a new issue