Add config for busch
Busch is the proxmox host used for various vms, which will be defined through terraform or similar.
This commit is contained in:
parent
f2b2e26ba9
commit
13ca1dc205
5 changed files with 151 additions and 41 deletions
|
|
@ -115,7 +115,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
server = nixpkgs.lib.nixosSystem rec {
|
busch = nixpkgs.lib.nixosSystem rec {
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
|
|
||||||
specialArgs = {
|
specialArgs = {
|
||||||
|
|
@ -123,7 +123,8 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
modules = [
|
modules = [
|
||||||
./hosts/nixos-server-test
|
./hosts/busch
|
||||||
|
disko.nixosModules.disko
|
||||||
proxmox-nixos.nixosModules.proxmox-ve
|
proxmox-nixos.nixosModules.proxmox-ve
|
||||||
|
|
||||||
({...}: {
|
({...}: {
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,16 @@
|
||||||
{
|
{
|
||||||
imports =
|
imports =
|
||||||
[
|
[
|
||||||
|
./disko.nix
|
||||||
|
|
||||||
../../modules/nix.nix
|
../../modules/nix.nix
|
||||||
|
../../modules/auto-upgrade.nix
|
||||||
../../modules/locale.nix
|
../../modules/locale.nix
|
||||||
../../modules/server-cli.nix
|
../../modules/server-cli.nix
|
||||||
../../modules/sshd.nix
|
../../modules/sshd.nix
|
||||||
|
${inputs.secrets}/modules/opkssh.nix
|
||||||
|
|
||||||
|
../../modules/intel-cpu.nix
|
||||||
# Include the results of the hardware scan.
|
# Include the results of the hardware scan.
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
];
|
];
|
||||||
|
|
@ -14,11 +20,10 @@
|
||||||
boot = {
|
boot = {
|
||||||
loader.grub = {
|
loader.grub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
device = "/dev/vda";
|
|
||||||
};
|
};
|
||||||
tmp.useTmpfs = true;
|
tmp.useTmpfs = true;
|
||||||
};
|
};
|
||||||
networking.hostName = "nixos-server"; # Define your hostname.
|
networking.hostName = "busch"; # Define your hostname.
|
||||||
users = {
|
users = {
|
||||||
users = {
|
users = {
|
||||||
julius = {
|
julius = {
|
||||||
|
|
@ -43,12 +48,18 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
services.proxmox-ve = {
|
services = {
|
||||||
enable = true;
|
proxmox-ve = {
|
||||||
ipAddress = "192.168.122.71";
|
enable = true;
|
||||||
|
ipAddress = "192.168.7.252";
|
||||||
|
|
||||||
# Make vmbr0 bridge visible in Proxmox web interface
|
# Make vmbr0 bridge visible in Proxmox web interface
|
||||||
bridges = [ "vmbr0" ];
|
bridges = [ "vmbr0" ];
|
||||||
|
};
|
||||||
|
openiscsi = {
|
||||||
|
enable = true;
|
||||||
|
name = "busch";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
networking.useDHCP = false;
|
networking.useDHCP = false;
|
||||||
|
|
@ -57,7 +68,7 @@
|
||||||
enable = true;
|
enable = true;
|
||||||
|
|
||||||
networks."10-lan" = {
|
networks."10-lan" = {
|
||||||
matchConfig.Name = [ "enp1s0" ];
|
matchConfig.Name = [ "enp0s25" ];
|
||||||
networkConfig = {
|
networkConfig = {
|
||||||
Bridge = "vmbr0";
|
Bridge = "vmbr0";
|
||||||
};
|
};
|
||||||
107
hosts/busch/disko.nix
Normal file
107
hosts/busch/disko.nix
Normal file
|
|
@ -0,0 +1,107 @@
|
||||||
|
{
|
||||||
|
disko.devices = {
|
||||||
|
disk = {
|
||||||
|
disk1 = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/ata-Samsung_SSD_850_PRO_256GB_S251NX0H423575T";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
MBR = {
|
||||||
|
type = "EF02"; # for grub MBR
|
||||||
|
size = "1M";
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
|
};
|
||||||
|
ESP = {
|
||||||
|
priority = 1;
|
||||||
|
name = "ESP";
|
||||||
|
size = "2G";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot";
|
||||||
|
mountOptions = [ "umask=0077" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
crypt_p1 = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "p1";
|
||||||
|
settings = {
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
disk2 = {
|
||||||
|
type = "disk";
|
||||||
|
device = "/dev/disk/by-id/ata-Samsung_SSD_850_PRO_256GB_S251NXAG833792N";
|
||||||
|
content = {
|
||||||
|
type = "gpt";
|
||||||
|
partitions = {
|
||||||
|
MBR = {
|
||||||
|
type = "EF02"; # for grub MBR
|
||||||
|
size = "1M";
|
||||||
|
priority = 1; # Needs to be first partition
|
||||||
|
};
|
||||||
|
ESP = {
|
||||||
|
priority = 1;
|
||||||
|
name = "ESP";
|
||||||
|
size = "2G";
|
||||||
|
type = "EF00";
|
||||||
|
content = {
|
||||||
|
type = "filesystem";
|
||||||
|
format = "vfat";
|
||||||
|
mountpoint = "/boot-fallback";
|
||||||
|
mountOptions = [ "umask=0077" ];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
crypt_p2 = {
|
||||||
|
size = "100%";
|
||||||
|
content = {
|
||||||
|
type = "luks";
|
||||||
|
name = "p2";
|
||||||
|
settings = {
|
||||||
|
allowDiscards = true;
|
||||||
|
};
|
||||||
|
content = {
|
||||||
|
type = "btrfs";
|
||||||
|
extraArgs = [
|
||||||
|
"-d raid1"
|
||||||
|
"-m raid1"
|
||||||
|
"/dev/mapper/p1"
|
||||||
|
];
|
||||||
|
subvolumes = {
|
||||||
|
"/rootfs" = {
|
||||||
|
mountpoint = "/";
|
||||||
|
};
|
||||||
|
"/home" = {
|
||||||
|
mountOptions = [ "compress=zstd" ];
|
||||||
|
mountpoint = "/home";
|
||||||
|
};
|
||||||
|
"/nix" = {
|
||||||
|
mountOptions = [ "compress=zstd" "noatime" ];
|
||||||
|
mountpoint = "/nix";
|
||||||
|
};
|
||||||
|
"/pve-cluster" = {
|
||||||
|
mountOptions = [ "compress=zstd" ];
|
||||||
|
mountpoint = "/var/lib/pve-cluster";
|
||||||
|
};
|
||||||
|
"/swap" = {
|
||||||
|
mountpoint = "/.swapvol";
|
||||||
|
swap.swapfile.size = "32G";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
22
hosts/busch/hardware-configuration.nix
Normal file
22
hosts/busch/hardware-configuration.nix
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||||
|
# and may be overwritten by future invocations. Please make changes
|
||||||
|
# to /etc/nixos/configuration.nix instead.
|
||||||
|
{ config, lib, pkgs, modulesPath, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
imports =
|
||||||
|
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||||
|
];
|
||||||
|
|
||||||
|
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "ehci_pci" "mpt3sas" "usbhid" "usb_storage" "sr_mod" ];
|
||||||
|
boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" ];
|
||||||
|
boot.kernelModules = [ "kvm-intel" ];
|
||||||
|
boot.extraModulePackages = [ ];
|
||||||
|
boot.kernelParams = [ "intel_iommu=on" "iommu=pt" "vfio-pci.ids=1000:0087" ];
|
||||||
|
|
||||||
|
networking.useDHCP = lib.mkDefault true;
|
||||||
|
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
||||||
|
|
||||||
|
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||||
|
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||||
|
}
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
|
||||||
# and may be overwritten by future invocations. Please make changes
|
|
||||||
# to /etc/nixos/configuration.nix instead.
|
|
||||||
{ config, lib, pkgs, modulesPath, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
imports =
|
|
||||||
[ (modulesPath + "/profiles/qemu-guest.nix")
|
|
||||||
];
|
|
||||||
|
|
||||||
boot.initrd.availableKernelModules = [ "ahci" "xhci_pci" "virtio_pci" "sr_mod" "virtio_blk" ];
|
|
||||||
boot.initrd.kernelModules = [ ];
|
|
||||||
boot.kernelModules = [ "kvm-intel" ];
|
|
||||||
boot.extraModulePackages = [ ];
|
|
||||||
|
|
||||||
fileSystems."/" =
|
|
||||||
{ device = "/dev/disk/by-uuid/e46c412a-8b6d-41b8-b53c-65d7a8fc39ed";
|
|
||||||
fsType = "ext4";
|
|
||||||
};
|
|
||||||
|
|
||||||
swapDevices = [ ];
|
|
||||||
|
|
||||||
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
|
|
||||||
# (the default) this is the recommended approach. When using systemd-networkd it's
|
|
||||||
# still possible to use this option, but it's recommended to use it in conjunction
|
|
||||||
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
|
|
||||||
networking.useDHCP = lib.mkDefault true;
|
|
||||||
# networking.interfaces.enp1s0.useDHCP = lib.mkDefault true;
|
|
||||||
|
|
||||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
|
||||||
}
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue