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

@ -42,13 +42,49 @@
LC_TIME = "nl_NL.UTF-8";
};
services.xserver = {
services = {
displayManager.sddm.enable = false;
displayManager.defaultSession = "gnome";
desktopManager.plasma6.enable = true;
xserver = {
enable = true; # Enable the deprecated X11 teletype terminal connection system.
# Specify first device section to use nvidia GPU
#deviceSection = ''
# # Pick the 1070
# BusID "PCI:1:0:0"
# 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;
@ -59,15 +95,12 @@
# Enable Gnome Session
gnome.enable = true;
# Disable fuckshit plasma
plasma6.enable = false;
};
# Configure Display Manager
displayManager = {
gdm.enable = false;
sddm.enable = false;
gdm.enable = true;
# Enable lightdm
lightdm.enable = true;
defaultSession = "xfce";
lightdm.enable = false;
};
# Configure keymap in X11
xkb = {
@ -75,6 +108,7 @@
variant = "intl";
};
};
};
# services.xserver.displayManager.defaultSession = "gnome-x11"; # services.xserver.displayManager.autoLogin.enable = true;
# services.xserver.displayManager.autoLogin.user = "andreas";
# systemd.services."getty@tty1".enable = false;

View File

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

View File

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