From c7262c7c68fa2ca6b1a97abe1bda005fdfeee18f Mon Sep 17 00:00:00 2001 From: Amaury Date: Thu, 12 Mar 2026 13:29:01 +0100 Subject: [PATCH] update vmgpupassthrought --- configuration-vmgaming.nix | 20 +++++++++++++++++--- hosts/vmgaming/configuration.nix | 14 +++++++++----- modules/laptop/users.nix | 6 +++++- modules/nixos/base.nix | 2 ++ modules/nixos/desktop-i3.nix | 5 +++-- 5 files changed, 36 insertions(+), 11 deletions(-) diff --git a/configuration-vmgaming.nix b/configuration-vmgaming.nix index 1c6fd3c..480da16 100644 --- a/configuration-vmgaming.nix +++ b/configuration-vmgaming.nix @@ -24,6 +24,8 @@ }; boot.loader.efi.canTouchEfiVariables = false; + boot.blacklistedKernelModules = [ "nouveau" ]; + services.spice-vdagentd.enable = true; services.qemuGuest.enable = true; @@ -47,16 +49,20 @@ # NVIDIA passthrough guest defaults. # If you pass through an AMD GPU instead, replace with: - # services.xserver.videoDrivers = [ "amdgpu" ]; services.xserver.videoDrivers = [ "nvidia" ]; + hardware.nvidia = { modesetting.enable = true; - powerManagement.enable = false; + #powerManagement.enable = false; open = false; - nvidiaSettings = true; + #nvidiaSettings = true; package = config.boot.kernelPackages.nvidiaPackages.stable; }; + services.xserver.deviceSection = '' + Option "AllowEmptyInitialConfiguration" + ''; + powerManagement.cpuFreqGovernor = lib.mkDefault "performance"; environment.systemPackages = with pkgs; [ @@ -68,4 +74,12 @@ custom.gaming.enable = true; custom.gaming.enableXpadneo = false; + + services.openssh = { + enable = true; + settings = { + PasswordAuthentication = true; + PermitRootLogin = "no"; + }; + }; } diff --git a/hosts/vmgaming/configuration.nix b/hosts/vmgaming/configuration.nix index 1fbd95d..184957e 100644 --- a/hosts/vmgaming/configuration.nix +++ b/hosts/vmgaming/configuration.nix @@ -1,6 +1,6 @@ # Do not modify this file directly on every rebuild. It should contain host # specific hardware/VM configuration for VMGaming (Proxmox guest). -{ lib, modulesPath, ... }: +{ config, lib, modulesPath, ... }: { imports = [ @@ -10,18 +10,20 @@ boot.initrd.availableKernelModules = [ "ata_piix" "uhci_hcd" "virtio_pci" "virtio_scsi" "sr_mod" ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; - boot.extraModulePackages = [ ]; + boot.extraModulePackages = with config.boot.kernelPackages; [ xone ]; + boot.kernelParams = [ "console=ttyS0,115200" ]; + services.getty.autologinUser = null; # Update these labels to match your VM disks if they differ. fileSystems."/" = { - device = "/dev/disk/by-label/nixos"; + device = "/dev/sda2"; fsType = "ext4"; }; fileSystems."/boot" = { - device = "/dev/disk/by-label/boot"; + device = "/dev/sda1"; fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; + # options = [ "fmask=0077" "dmask=0077" ]; }; swapDevices = [ ]; @@ -29,5 +31,7 @@ networking.useDHCP = lib.mkDefault true; services.qemuGuest.enable = true; + hardware.xone.enable = true; + nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; } diff --git a/modules/laptop/users.nix b/modules/laptop/users.nix index 4f7df1b..dd052bf 100644 --- a/modules/laptop/users.nix +++ b/modules/laptop/users.nix @@ -56,5 +56,9 @@ sops age ]; + + openssh.authorizedKeys.keys = [ + "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCMzLza+1iFSUgZaPzEwpRNW/CvcsbXh8vJ9RevwFntNZdZIVc/j5OLRy+GOojlZdar070PkKDO+Pmtqu1uQ4XE+onqmsxom5JGyYaSScB3l33CLL2jBT7mBqBOVDuTBj3ACLT8fS1eUolI7erShvIH9VUvrg83bZ2CvgA/DjJLHfVCpvx9EsG0Q00k27LNU7yXga8sjK1YikA+o1bKTWavCGOWkZMFXOVeEDR+arOQ440s6f6eg7C+30V02ijRLA6pWFAkj2/fMaD+44IPMVjOj96vvPUJrlL1N7BDPxBlj1rrB35+pUkpVIN4B0etqnkrJIV+IxtmSpkNHr52Y7nkTu3mOWn1P0DcOdR5OA8JZRbSkbL/QW4GzFWs3eN7CMOMwKQdO+1J/wL4U7qrmKEYwcNaprqlDF0SIPp0+l/VWNMe6uK0r5iZwp355PUSR+Zc5skf74wMsZ1LokUlihdI+E6TNGvmDgjqKx6OrI3dyP/eW7xtR7KvbdoaUjy8AE8= alice@nixos" + ]; }; -} \ No newline at end of file +} diff --git a/modules/nixos/base.nix b/modules/nixos/base.nix index 2396cb2..f05b23b 100644 --- a/modules/nixos/base.nix +++ b/modules/nixos/base.nix @@ -45,6 +45,8 @@ ntfs3g zip unzip + + scream ]; fonts.packages = with pkgs; [ diff --git a/modules/nixos/desktop-i3.nix b/modules/nixos/desktop-i3.nix index feb51c2..309d153 100644 --- a/modules/nixos/desktop-i3.nix +++ b/modules/nixos/desktop-i3.nix @@ -20,8 +20,9 @@ xss-lock dex rofi - i3status - i3blocks + # i3status + # i3blocks + polybar oh-my-posh glances arandr