hosts: jupiter: change to vm

This commit is contained in:
Kabbone 2023-10-01 09:22:19 +02:00
parent 8453d4b06d
commit b42a36ec8e
Signed by: Kabbone
SSH Key Fingerprint: SHA256:A5zPB5I6u5V78V51c362BBdCwhDhfDUVbt7NfKdjWBY
3 changed files with 18 additions and 37 deletions

View File

@ -163,7 +163,6 @@ in
jupiter = lib.nixosSystem { # Desktop profile jupiter = lib.nixosSystem { # Desktop profile
inherit system; inherit system;
#user = "dmz-user";
specialArgs = { inherit inputs user location nixos-hardware nur agenix; }; specialArgs = { inherit inputs user location nixos-hardware nur agenix; };
modules = [ modules = [
agenix.nixosModules.default agenix.nixosModules.default

View File

@ -20,9 +20,9 @@
{ config, pkgs, user, ... }: { config, pkgs, user, ... }:
{ {
imports = # For now, if applying to other system, swap files imports = # For now, if applying to other ssystem, swap files
[(import ./hardware-configuration.nix)] ++ # Current system hardware config @ /etc/nixos/hardware-configuration.nix [(import ./hardware-configuration.nix)] ++ # Current system hardware config @ /etc/nixos/hardware-configuration.nix
(import ../../modules/desktop/virtualisation) ++ # Docker #(import ../../modules/desktop/virtualisation) ++ # Docker
(import ../../modules/services/nas) ++ # Server Services (import ../../modules/services/nas) ++ # Server Services
(import ../../modules/hardware); # Hardware devices (import ../../modules/hardware); # Hardware devices

View File

@ -17,8 +17,8 @@
[ (modulesPath + "/profiles/qemu-guest.nix") [ (modulesPath + "/profiles/qemu-guest.nix")
]; ];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usb_storage" "usbhid" "sd_mod" ]; boot.initrd.availableKernelModules = [ "uhci_hcd" "ehci_pci" "ahci" "virtio_pci" "virtio_scsi" "sr_mod" "virtio_blk" ];
boot.initrd.kernelModules = [ "vfio_pci" "vfio" "vfio_iommu_type1" ]; boot.initrd.kernelModules = [ ];
# boot.initrd.secrets = { # boot.initrd.secrets = {
# "/root/NASKeyfile" = # "/root/NASKeyfile" =
# /root/NASKeyfile; # /root/NASKeyfile;
@ -33,7 +33,7 @@
# keyFile = "/root/NASKeyfile"; # keyFile = "/root/NASKeyfile";
# }; # };
# }; # };
boot.kernelModules = [ "kvm-intel" ]; boot.kernelModules = [ ];
boot.extraModulePackages = [ ]; boot.extraModulePackages = [ ];
boot.tmp.useTmpfs = false; boot.tmp.useTmpfs = false;
boot.tmp.cleanOnBoot = true; boot.tmp.cleanOnBoot = true;
@ -44,6 +44,7 @@
interval = "monthly"; interval = "monthly";
fileSystems = [ fileSystems = [
"/" "/"
"/mnt/Mars"
# "/mnt/Pluto" # "/mnt/Pluto"
]; ];
}; };
@ -67,6 +68,13 @@
subvolume = { subvolume = {
"@" = {}; "@" = {};
"@home" = {}; "@home" = {};
};
};
};
volume = {
"/mnt/snapshots/Mars" = {
snapshot_create = "always";
subvolume = {
"@nas" = {}; "@nas" = {};
}; };
}; };
@ -140,7 +148,7 @@
}; };
fileSystems."/mnt/snapshots/Mars" = fileSystems."/mnt/snapshots/Mars" =
{ device = "/dev/disk/by-label/NIXROOT"; { device = "/dev/disk/by-label/Mars";
fsType = "btrfs"; fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvolid=5,discard=async" ];
}; };
@ -158,7 +166,7 @@
# }; # };
# #
fileSystems."/mnt/Mars" = fileSystems."/mnt/Mars" =
{ device = "/dev/disk/by-label/NIXROOT"; { device = "/dev/disk/by-label/Mars";
fsType = "btrfs"; fsType = "btrfs";
options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nas,discard=async" ]; options = [ "compress=zstd,space_cache=v2,ssd,noatime,subvol=@nas,discard=async" ];
}; };
@ -181,21 +189,6 @@
swapDevices = [ { device = "/swap/swapfile"; } ]; swapDevices = [ { device = "/swap/swapfile"; } ];
networking = { networking = {
vswitches = {
vs0 = {
interfaces = {
enp1s0 = { };
lo1 = {
type = "internal";
};
enp1s0iot = {
type = "internal";
vlan = 100;
};
};
};
};
useDHCP = false; # Deprecated
hostName = "jupiter"; hostName = "jupiter";
domain = "home.opel-online.de"; domain = "home.opel-online.de";
networkmanager = { networkmanager = {
@ -205,8 +198,8 @@
"192.168.2.1" "192.168.2.1"
]; ];
interfaces = { interfaces = {
# enp0s31f6 = { enp6s18 = {
# useDHCP = true; # For versatility sake, manually edit IP on nm-applet. useDHCP = true; # For versatility sake, manually edit IP on nm-applet.
# ipv4.addresses = [ { # ipv4.addresses = [ {
# address = "45.142.114.153"; # address = "45.142.114.153";
# prefixLength = 24; # prefixLength = 24;
@ -216,15 +209,12 @@
# prefixLength = 64; # prefixLength = 64;
# } ]; # } ];
# }; # };
lo1 = {
useDHCP = true;
macAddress = "68:84:7e:71:a0:e0";
}; };
}; };
# defaultGateway = "45.142.114.1"; # defaultGateway = "45.142.114.1";
defaultGateway6 = { defaultGateway6 = {
address = "fe80::1"; address = "fe80::1";
interface = "lo1"; interface = "enp6s18";
}; };
# nameservers = [ "9.9.9.9" "2620:fe::fe" ]; # nameservers = [ "9.9.9.9" "2620:fe::fe" ];
#firewall = { #firewall = {
@ -234,14 +224,6 @@
#}; #};
}; };
systemd.services = {
"ovsdb".partOf = [ "network-setup.service" ];
"ovs-vswitchd".partOf = [ "network-setup.service" ];
"network-addresses-lo1" = {
requires = [ "network-setup.service" ];
};
};
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
powerManagement = { powerManagement = {
cpuFreqGovernor = lib.mkDefault "powersave"; cpuFreqGovernor = lib.mkDefault "powersave";