diff --git a/common/networking/zerotier.nix b/common/networking/zerotier.nix index adeda67..e674cdb 100644 --- a/common/networking/zerotier.nix +++ b/common/networking/zerotier.nix @@ -26,5 +26,6 @@ 192.168.194.241 grapheneos.far 192.168.194.182 trueremote.far 192.168.194.242 truehome.far + 192,168.194.155 yivo.far ''; } diff --git a/flake.nix b/flake.nix index 331c7aa..b4b9153 100644 --- a/flake.nix +++ b/flake.nix @@ -134,6 +134,10 @@ scruffy = mkHeadlessNixos [ ./hosts/scruffy ]; + # Xeon VM + yivo = mkHeadlessNixos [ + ./hosts/yivo + ]; }; darwinConfigurations = { diff --git a/hosts/yivo/default.nix b/hosts/yivo/default.nix new file mode 100644 index 0000000..f443e8a --- /dev/null +++ b/hosts/yivo/default.nix @@ -0,0 +1,34 @@ +{ + config, + lib, + pkgs, + inputs, + outputs, + home-manager, + ... +}: { + imports = [ + # Include the results of the hardware scan. + ./hardware-configuration.nix + ../../common/nixos/common.nix + ../../common/networking/zerotier.nix + ../../common/nixos/docker.nix + ]; + + # Bootloader. + boot.loader.grub.enable = true; + boot.loader.grub.device = "/dev/sda"; + boot.loader.grub.useOSProber = true; + networking.hostName = "yivo"; + + # Enable networking + networking.networkmanager.enable = true; + + # Enable the OpenSSH daemon. + services.openssh.enable = true; + + services.earlyoom.enable = true; + + # Latest stable kernel + boot.kernelPackages = pkgs.linuxPackages_latest; +} diff --git a/hosts/yivo/hardware-configuration.nix b/hosts/yivo/hardware-configuration.nix new file mode 100644 index 0000000..f97827a --- /dev/null +++ b/hosts/yivo/hardware-configuration.nix @@ -0,0 +1,43 @@ +{ + config, + lib, + pkgs, + modulesPath, + ... +}: { + imports = [ + (modulesPath + "/profiles/qemu-guest.nix") + ]; + + boot.initrd.availableKernelModules = ["ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sd_mod" "sr_mod"]; + boot.initrd.kernelModules = []; + boot.kernelModules = []; + boot.extraModulePackages = []; + + fileSystems."/" = { + device = "/dev/disk/by-uuid/b8f1e3d1-b2d7-4100-a1af-01b1f63f8e5a"; + 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..useDHCP`. + networking.useDHCP = lib.mkDefault true; + # networking.interfaces.enp6s0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp9s0f0.useDHCP = lib.mkDefault true; + # networking.interfaces.enp9s0f1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; + + zramSwap = { + enable = true; + memoryPercent = 25; + priority = 10; + }; + + boot.tmp.useTmpfs = true; +}