diff --git a/devices/binto/hardware-configuration.nix b/devices/binto/hardware-configuration.nix index 7b07e8f..55d32cf 100644 --- a/devices/binto/hardware-configuration.nix +++ b/devices/binto/hardware-configuration.nix @@ -67,6 +67,7 @@ virtualisation = { libvirtd.enable = true; + spiceUSBRedirection.enable = true; }; environment.systemPackages = with pkgs; [ qemu diff --git a/devices/cluster/default.nix b/devices/cluster/default.nix new file mode 100644 index 0000000..c5b1635 --- /dev/null +++ b/devices/cluster/default.nix @@ -0,0 +1,43 @@ +deviceName: {config, ...}: let + inherit (config.vars) mainUser hostName; +in { + imports = [ + ./hardware-configuration.nix + + ../../modules/kmscon.nix + ../../modules/sshd.nix + ../../modules/tailscale.nix + ]; + + vars = { + mainUser = "matt"; + hostName = deviceName; + }; + + users.users.${mainUser} = { + isNormalUser = true; + extraGroups = [ + "wheel" + "adm" + ]; + }; + + home-manager.users.${mainUser} = { + imports = []; + + # No touchy + home.stateVersion = "24.05"; + }; + + networking = { + inherit hostName; + resolvconf.enable = true; + firewall.enable = false; + }; + + # Set your time zone. + time.timeZone = "America/Montreal"; + + # No touchy + system.stateVersion = "24.05"; +} diff --git a/devices/cluster/hardware-configuration.nix b/devices/cluster/hardware-configuration.nix new file mode 100644 index 0000000..7d12a4c --- /dev/null +++ b/devices/cluster/hardware-configuration.nix @@ -0,0 +1,48 @@ +{ + config, + modulesPath, + ... +}: { + nixpkgs.hostPlatform = "x86_64-linux"; + imports = [(modulesPath + "/installer/scan/not-detected.nix")]; + + boot = { + loader = { + timeout = 2; + + systemd-boot.enable = true; + efi.canTouchEfiVariables = true; + }; + + initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usbhid" + "usb_storage" + "sd_mod" + ]; + }; + + fileSystems = { + "/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "btrfs"; + }; + + "/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + }; + }; + + swapDevices = [ + { + device = "/var/lib/swapfile"; + size = 16 * 1024; + } + ]; + + zramSwap.enable = true; + + hardware.cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware; +} diff --git a/flake.nix b/flake.nix index ac4af89..6b4b745 100644 --- a/flake.nix +++ b/flake.nix @@ -48,6 +48,14 @@ secrets.nixosModules.oksys ]; + # Cluster + thingone = mkNixOS [ + (import ./devices/cluster "thingone") + ]; + thingtwo = mkNixOS [ + (import ./devices/cluster "thingtwo") + ]; + live-image = mkNixOS [ ("${nixpkgs}/nixos/modules/installer/" + "cd-dvd/installation-cd-minimal.nix")