diff --git a/flake.nix b/flake.nix index 88890a3..bcad4c1 100644 --- a/flake.nix +++ b/flake.nix @@ -49,5 +49,12 @@ # Currently supported: plasma, gnome, hyprland desktopEnvironment = "gnome"; }; + nixosConfigurations.workstation = mkSystem "workstation" { + system = "x86_64-linux"; + user = "r3ddy"; + email = personalEmail; + gamingSystem = false; + desktopEnvironment = "gnome"; + }; }; } diff --git a/machines/workstation/default.nix b/machines/workstation/default.nix new file mode 100644 index 0000000..abab42d --- /dev/null +++ b/machines/workstation/default.nix @@ -0,0 +1,16 @@ +{ currentSystemUser, ... }: +{ + imports = [ + ./hardware.nix + ./services.nix + ./virtualisation.nix + ./networking.nix + ]; + + networking.hostName = "workstation"; # Define your hostname. + + boot.loader.systemd-boot.enable = true; + boot.loader.efi.canTouchEfiVariables = true; + + system.stateVersion = "24.11"; # Did you read the comment? +} diff --git a/machines/workstation/hardware.nix b/machines/workstation/hardware.nix new file mode 100644 index 0000000..0759628 --- /dev/null +++ b/machines/workstation/hardware.nix @@ -0,0 +1,40 @@ +# 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 = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "rtsx_usb_sdmmc" ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-intel" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = + { device = "/dev/disk/by-uuid/b8f99588-490c-47a4-ad8b-dfbe27ced16c"; + fsType = "ext4"; + }; + + boot.initrd.luks.devices."luks-a4dcf57a-8925-41a8-bac6-1cfd08a90f0b".device = "/dev/disk/by-uuid/a4dcf57a-8925-41a8-bac6-1cfd08a90f0b"; + + fileSystems."/boot" = + { device = "/dev/disk/by-uuid/C0E2-037E"; + fsType = "vfat"; + options = [ "fmask=0077" "dmask=0077" ]; + }; + + 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.eno1.useDHCP = lib.mkDefault true; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} diff --git a/machines/workstation/networking.nix b/machines/workstation/networking.nix new file mode 100644 index 0000000..e336fae --- /dev/null +++ b/machines/workstation/networking.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + networking.networkmanager.enable = true; + networking.firewall.allowedUDPPorts = [ 25565 ]; + networking.firewall.allowedTCPPorts = [ 25565 ]; + hardware.bluetooth.enable = true; + hardware.bluetooth.powerOnBoot = true; +} diff --git a/machines/workstation/services.nix b/machines/workstation/services.nix new file mode 100644 index 0000000..f36a741 --- /dev/null +++ b/machines/workstation/services.nix @@ -0,0 +1,7 @@ +{ ... }: +{ + services.flatpak.enable = true; + + # Enable CUPS to print documents. + services.printing.enable = true; +} diff --git a/machines/workstation/virtualisation.nix b/machines/workstation/virtualisation.nix new file mode 100644 index 0000000..892aa0f --- /dev/null +++ b/machines/workstation/virtualisation.nix @@ -0,0 +1,10 @@ +{ currentSystemUser, ... }: +{ + virtualisation.podman.enable = true; + virtualisation.podman.dockerCompat = true; + + programs.virt-manager.enable = true; + users.groups.libvirtd.members = ["${currentSystemUser}"]; + virtualisation.libvirtd.enable = true; + virtualisation.spiceUSBRedirection.enable = true; +}