diff options
Diffstat (limited to 'hosts/nixios')
| -rw-r--r-- | hosts/nixios/default.nix | 124 | ||||
| -rw-r--r-- | hosts/nixios/hardware-configuration.nix | 49 |
2 files changed, 173 insertions, 0 deletions
diff --git a/hosts/nixios/default.nix b/hosts/nixios/default.nix new file mode 100644 index 0000000..2f39cc5 --- /dev/null +++ b/hosts/nixios/default.nix @@ -0,0 +1,124 @@ +{ + systemState, + user, + hostname, +}: +{ + pkgs, + config, + inputs, + lib, + ... +}: +{ + imports = [ + ./hardware-configuration.nix + (import ../common.nix { inherit user; }) + ]; + + # REMOVE LATER + virtualisation.vmVariant = { + users.users.${user}.password = "1"; + users.users.root.password = "1"; + + virtualisation.memorySize = 4096; + virtualisation.cores = 4; + services.displayManager.ly.enable = lib.mkForce false; + + services.getty.helpLine = ">> WELCOME <<"; + services.getty.autologinUser = user; + }; + # REMOVE LATER + + boot.kernelPackages = pkgs.linuxPackages_zen; + + programs.dconf.enable = true; + security.pam.services.swaylock = { }; + + xdg.portal = lib.mkForce { + enable = true; + extraPortals = [ + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-wlr + ]; + config = { + common = { + default = [ "gtk" ]; + "org.freedesktop.impl.portal.Secret" = [ "gnome-keyring" ]; + }; + mango = { + "org.freedesktop.impl.portal.ScreenCast" = [ "wlr" ]; + "org.freedesktop.impl.portal.Screenshot" = [ "wlr" ]; + }; + }; + }; + + programs.gamemode.enable = config.programs.steam.enable; + programs.gamescope = { + enable = config.programs.steam.enable; + capSysNice = true; + }; + programs.steam = { + enable = false; + gamescopeSession.enable = false; + remotePlay.openFirewall = true; + dedicatedServer.openFirewall = true; + localNetworkGameTransfers.openFirewall = true; + }; + + users.users.${user} = { + isNormalUser = true; + shell = pkgs.fish; + extraGroups = [ + "networkmanager" + "wheel" + ]; + }; + + environment.sessionVariables = { }; + + networking.hostName = hostname; + networking.firewall.allowedTCPPorts = [ ]; + networking.firewall.allowedUDPPorts = [ ]; + networking.firewall.enable = true; + + environment.systemPackages = with pkgs; [ + libva-utils + vulkan-tools + pciutils + direnv + mangohud + ]; + + services.xserver.videoDrivers = [ "nvidia" ]; + hardware = { + graphics = { + enable = true; + enable32Bit = true; + extraPackages = with pkgs; [ + libvdpau-va-gl + nvidia-vaapi-driver + ]; + }; + + nvidia = { + modesetting.enable = true; + powerManagement.enable = true; + powerManagement.finegrained = true; + open = false; + nvidiaSettings = false; + + prime = { + offload.enable = true; + offload.enableOffloadCmd = true; + offload.offloadCmdMainProgram = "prime-run"; + nvidiaBusId = "PCI:1:0:0"; + amdgpuBusId = "PCI:5:0:0"; + }; + + package = config.boot.kernelPackages.nvidiaPackages.latest; # or stable + }; + }; + + system.stateVersion = systemState; # check flake.nix +} diff --git a/hosts/nixios/hardware-configuration.nix b/hosts/nixios/hardware-configuration.nix new file mode 100644 index 0000000..7e2a1c3 --- /dev/null +++ b/hosts/nixios/hardware-configuration.nix @@ -0,0 +1,49 @@ +# 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. + +# yes i did modify it. +{ + config, + lib, + pkgs, + modulesPath, + ... +}: +{ + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; + + boot.initrd.availableKernelModules = [ + "nvme" + "xhci_pci" + "usb_storage" + "usbhid" + "sd_mod" + ]; + boot.initrd.kernelModules = [ ]; + boot.kernelModules = [ "kvm-amd" ]; + boot.extraModulePackages = [ ]; + + fileSystems."/" = { + device = "/dev/disk/by-label/NIXROOT"; + fsType = "ext4"; + }; + + fileSystems."/boot" = { + device = "/dev/disk/by-label/NIXBOOT"; + fsType = "vfat"; + options = [ + "fmask=0022" + "dmask=0022" + ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/NIXSWAP"; } + ]; + + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; + hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware; +} |
