Compare commits

...

3 Commits

Author SHA1 Message Date
Andreas Schaafsma
3fad8fcf16 try to fix x11 on amd only 2024-12-31 17:58:35 +01:00
Andreas Schaafsma
415ea15ea0 commit changes 2024-12-31 17:58:22 +01:00
Andreas Schaafsma
48f1d774c9 add amd-igpu only config 2024-12-31 17:52:10 +01:00
5 changed files with 163 additions and 69 deletions

66
flake.lock generated
View File

@ -19,11 +19,11 @@
"flake-compat_2": { "flake-compat_2": {
"flake": false, "flake": false,
"locked": { "locked": {
"lastModified": 1696426674, "lastModified": 1733328505,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=", "narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra", "owner": "edolstra",
"repo": "flake-compat", "repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33", "rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -53,11 +53,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1726560853, "lastModified": 1731533236,
"narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -128,11 +128,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733484277, "lastModified": 1735381016,
"narHash": "sha256-i5ay20XsvpW91N4URET/nOc0VQWOAd4c4vbqYtcH8Rc=", "narHash": "sha256-CyCZFhMUkuYbSD6bxB/r43EdmDE7hYeZZPTCv0GudO4=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "d00c6f6d0ad16d598bf7e2956f52c1d9d5de3c3a", "rev": "10e99c43cdf4a0713b4e81d90691d22c6a58bdf2",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -149,11 +149,11 @@
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
}, },
"locked": { "locked": {
"lastModified": 1733621779, "lastModified": 1735608992,
"narHash": "sha256-oeBPiHmg8T/Qsf4qMkUqOrn6/xkJwREGo1jA+4xDssk=", "narHash": "sha256-NkzMjar9Sz0pLJxVfp9Hchf48YCuQQ1AnGVYGNfzwVA=",
"owner": "lilyinstarlight", "owner": "lilyinstarlight",
"repo": "nixos-cosmic", "repo": "nixos-cosmic",
"rev": "b9ec66ed4e1430061ca044e938bb10f3ab629ba3", "rev": "af6900c2f6e68439c5f4aaaa8bb1a6d54bf04025",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -169,11 +169,11 @@
"nixpkgs": "nixpkgs_3" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1733516684, "lastModified": 1733854371,
"narHash": "sha256-yz3mZyTnPlxZW2f51kJyfofDsBeX7WxAPvTXZtr2lW4=", "narHash": "sha256-K9qGHniYBbjqVcEiwXyiofj/IFf78L5F0/FCf+CKyr0=",
"owner": "nix-community", "owner": "nix-community",
"repo": "NixOS-WSL", "repo": "NixOS-WSL",
"rev": "dd20ebde771edbdececade73dbb8791ff987d0db", "rev": "dee4425dcee3149475ead0cb6a616b8a028c5888",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -201,11 +201,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1733412085, "lastModified": 1735531152,
"narHash": "sha256-FillH0qdWDt/nlO6ED7h4cmN+G9uXwGjwmCnHs0QVYM=", "narHash": "sha256-As8I+ebItDKtboWgDXYZSIjGlKeqiLBvjxsQHUmAf1Q=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4dc2fc4e62dbf62b84132fe526356fbac7b03541", "rev": "3ffbbdbac0566a0977da3d2657b89cbcfe9a173b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -217,11 +217,11 @@
}, },
"nixpkgs_2": { "nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1733392399, "lastModified": 1735471104,
"narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=", "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661", "rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -233,11 +233,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1729973466, "lastModified": 1733384649,
"narHash": "sha256-knnVBGfTCZlQgxY1SgH0vn2OyehH9ykfF8geZgS95bk=", "narHash": "sha256-K5DJ2LpPqht7K76bsxetI+YHhGGRyVteTPRQaIIKJpw=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "cd3e8833d70618c4eea8df06f95b364b016d4950", "rev": "190c31a89e5eec80dd6604d7f9e5af3802a58a13",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -249,11 +249,11 @@
}, },
"nixpkgs_4": { "nixpkgs_4": {
"locked": { "locked": {
"lastModified": 1733392399, "lastModified": 1735471104,
"narHash": "sha256-kEsTJTUQfQFIJOcLYFt/RvNxIK653ZkTBIs4DG+cBns=", "narHash": "sha256-0q9NGQySwDQc7RhAV2ukfnu7Gxa5/ybJ2ANT8DQrQrs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "d0797a04b81caeae77bcff10a9dde78bc17f5661", "rev": "88195a94f390381c6afcdaa933c2f6ff93959cb4",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -300,11 +300,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733538766, "lastModified": 1735525800,
"narHash": "sha256-FEDfBpM82XGdHDbLDJC4lV+QXSVN1rERt1MqtBGJZds=", "narHash": "sha256-pcN8LAL021zdC99a9F7iEiFCI1wmrE4DpIYUgKpB/jY=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "66526479b295ad238843a8a7367d2da7ec102757", "rev": "10faa81b4c0135a04716cbd1649260d82b2890cd",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -342,11 +342,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1733128155, "lastModified": 1735468296,
"narHash": "sha256-m6/qwJAJYcidGMEdLqjKzRIjapK4nUfMq7rDCTmZajc=", "narHash": "sha256-ZjUjbvS06jf4fElOF4ve8EHjbpbRVHHypStoY8HGzk8=",
"owner": "mic92", "owner": "mic92",
"repo": "sops-nix", "repo": "sops-nix",
"rev": "c6134b6fff6bda95a1ac872a2a9d5f32e3c37856", "rev": "bcb8b65aa596866eb7e5c3e1a6cccbf5d1560b27",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@ -0,0 +1,57 @@
{ config
, lib
, pkgs
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.my-namespace) disabled enabled;
cfg = config.my-namespace.hardware.graphics-amd-igpu-only;
in
{
options.my-namespace.hardware.graphics-amd-igpu-only = {
enable = mkEnableOption "Enable nvidia";
};
config = mkIf cfg.enable {
# Enable NVIDIA driver for X11 and Wayland
# without modesetting, x server will be run by nvidia
services.xserver.videoDrivers = [
"amdgpu"
];
# Enable OpenGL
hardware.graphics = {
enable = true;
# extraPackages = with pkgs; [ nvidia-vaapi-driver ];
};
hardware.graphics.enable32Bit = true; # For 32 bit applications
boot.loader.systemd-boot.consoleMode = "max";
# Enable required Kernel Modules
boot.initrd.kernelModules = [
"amdgpu"
];
boot.kernelParams = [
"amdgpu.modeset=1"
"amd_iommu=on"
];
# Blacklist intel and nouveau
boot.blacklistedKernelModules = [
"nouveau"
];
# Modesetting is required.
# Add user to extra groups
users.users.andreas = {
extraGroups = [ "video" "render" ];
};
};
}

View File

@ -6,7 +6,7 @@
{ {
imports = imports =
[ [
./hardware/hardware-configuration.nix ./hardware/hardware-configuration.nix
]; ];
@ -42,37 +42,71 @@
LC_TIME = "nl_NL.UTF-8"; LC_TIME = "nl_NL.UTF-8";
}; };
services.xserver = { services = {
enable = true; # Enable the deprecated X11 teletype terminal connection system. displayManager.sddm.enable = false;
# Specify first device section to use nvidia GPU displayManager.defaultSession = "gnome";
#deviceSection = '' desktopManager.plasma6.enable = true;
# # Pick the 1070 xserver = {
# BusID "PCI:1:0:0" enable = true; # Enable the deprecated X11 teletype terminal connection system.
#''; # Specify first device section to use nvidia GPU
desktopManager = {
# Disable xterm
xterm.enable = false;
# Enable xfce session
xfce = {
enable = true; # services.xserver.config = lib.mkForce ''
# Section "ServerLayout"
# Identifier "layout"
# Screen 0 "amdgpu"
# Inactive "nvidia"
# Option "AllowNVIDIAGPUScreens"
# EndSection
# Section "Device"
# Identifier "nvidia"
# Driver "nvidia"
# BusID "PCI:01:0:0"
# EndSection
# Section "Screen"
# Identifier "nvidia"
# Device "nvidia"
# EndSection
# Section "Device"
# Identifier "amdgpu"
# Driver "amdgpu"
# BusID "PCI:50:0:0"
# EndSection
# Section "Screen"
# Identifier "amdgpu"
# Device "amdgpu"
# EndSection
# '';
desktopManager = {
# Disable xterm
xterm.enable = false;
# Enable xfce session
xfce = {
enable = true;
};
# Enable Gnome Session
gnome.enable = true;
# Disable fuckshit plasma
};
# Configure Display Manager
displayManager = {
gdm.enable = true;
# Enable lightdm
lightdm.enable = false;
};
# Configure keymap in X11
xkb = {
layout = "us";
variant = "intl";
}; };
# Enable Gnome Session
gnome.enable = true;
# Disable fuckshit plasma
plasma6.enable = false;
};
# Configure Display Manager
displayManager = {
gdm.enable = false;
sddm.enable = false;
# Enable lightdm
lightdm.enable = true;
defaultSession = "xfce";
};
# Configure keymap in X11
xkb = {
layout = "us";
variant = "intl";
}; };
}; };
# services.xserver.displayManager.defaultSession = "gnome-x11"; # services.xserver.displayManager.autoLogin.enable = true; # services.xserver.displayManager.defaultSession = "gnome-x11"; # services.xserver.displayManager.autoLogin.enable = true;
@ -116,8 +150,8 @@
# List packages installed in system profile. To search, run: # List packages installed in system profile. To search, run:
# $ nix search wget # $ nix search wget
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
# vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default. # vim # Do not forget to add an editor to edit configuration.nix! The Nano editor is also installed by default.
# wget # wget
xfce.xfce4-whiskermenu-plugin xfce.xfce4-whiskermenu-plugin
gnome-tweaks gnome-tweaks
]; ];
@ -136,7 +170,7 @@
# services.openssh.enable = true; # services.openssh.enable = true;
# Open ports in the firewall. # Open ports in the firewall.
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
24800 #Synergy 24800 #Synergy
]; ];
networking.firewall.allowedUDPPorts = [ networking.firewall.allowedUDPPorts = [

View File

@ -75,10 +75,12 @@ in
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
59010 #SoundWireServer 59010 #SoundWireServer
3389 #RDP 3389 #RDP
22 #ssh
]; ];
networking.firewall.allowedUDPPorts = [ networking.firewall.allowedUDPPorts = [
59010 #SoundWireServer 59010 #SoundWireServer
3389 #RDP 3389 #RDP
22 #ssh
]; ];
# Or disable the firewall altogether. # Or disable the firewall altogether.
# networking.firewall.enable = false; # networking.firewall.enable = false;
@ -91,7 +93,7 @@ in
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
git git
wine wine
bottles # bottles
gparted gparted
ntfs3g ntfs3g
ntfsprogs ntfsprogs

View File

@ -5,6 +5,7 @@ in
{ {
my-namespace.hardware = { my-namespace.hardware = {
# graphics-nvidia-prime-amd = enabled; # graphics-nvidia-prime-amd = enabled;
graphics-nvidia-prime-amd-testing = enabled; # graphics-nvidia-prime-amd-testing = enabled;
graphics-amd-igpu-only = enabled;
}; };
} }