Compare commits

...

7 Commits

Author SHA1 Message Date
Andreas Schaafsma
48e9ae18ef remove unused patch file 2025-11-30 04:22:45 +01:00
Andreas Schaafsma
793b7e1a30 fixed wallpaper engine 2025-11-30 04:22:20 +01:00
Andreas Schaafsma
051b48d3ba changes 2025-11-30 03:48:54 +01:00
Andreas Schaafsma
47ff5618e9 changes 2025-11-30 03:48:43 +01:00
Andreas Schaafsma
ad7fb01791 remove remaining cosmic references 2025-11-30 00:32:38 +01:00
Andreas Schaafsma
1e6daa09f6 updates 2025-11-30 00:32:11 +01:00
Andreas Schaafsma
1557caba8b add intel nvidia hybrid graphics 2025-11-29 23:12:09 +01:00
18 changed files with 220 additions and 835 deletions

224
flake.lock generated
View File

@ -2,11 +2,11 @@
"nodes": {
"crane": {
"locked": {
"lastModified": 1731098351,
"narHash": "sha256-HQkYvKvaLQqNa10KEFGgWHfMAbWBfFp+4cAgkut+NNE=",
"lastModified": 1754269165,
"narHash": "sha256-0tcS8FHd4QjbCVoxN9jI+PjHgA4vc/IjkUSp+N3zy0U=",
"owner": "ipetkov",
"repo": "crane",
"rev": "ef80ead953c1b28316cc3f8613904edc2eb90c28",
"rev": "444e81206df3f7d92780680e45858e31d2f07a08",
"type": "github"
},
"original": {
@ -18,11 +18,11 @@
"flake-compat": {
"flake": false,
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"lastModified": 1747046372,
"narHash": "sha256-CIVLLkVgvHYbgI2UpXvIIBJ12HWgX+fjA8Xf8PUmqCY=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"rev": "9100a0f413b0c601e0533d1d94ffd501ce2e7885",
"type": "github"
},
"original": {
@ -34,36 +34,20 @@
"flake-compat_2": {
"flake": false,
"locked": {
"lastModified": 1746162366,
"narHash": "sha256-5SSSZ/oQkwfcAz/o/6TlejlVGqeK08wyREBQ5qFFPhM=",
"owner": "nix-community",
"lastModified": 1761588595,
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "0f158086a2ecdbb138cd0429410e44994f1b7e4b",
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
"type": "github"
},
"original": {
"owner": "nix-community",
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_3": {
"flake": false,
"locked": {
"lastModified": 1733328505,
"narHash": "sha256-NeCCThCEP3eCl2l/+27kNNK7QrwZB1IJCrXfrbv5oqU=",
"owner": "edolstra",
"repo": "flake-compat",
"rev": "ff81ac966bb2cae68946d5ed5fc4994f96d0ffec",
"type": "github"
},
"original": {
"owner": "edolstra",
"repo": "flake-compat",
"type": "github"
}
},
"flake-compat_4": {
"flake": false,
"locked": {
"lastModified": 1650374568,
@ -87,11 +71,11 @@
]
},
"locked": {
"lastModified": 1730504689,
"narHash": "sha256-hgmguH29K2fvs9szpq2r3pz2/8cJd2LPS+b4tfNFCwE=",
"lastModified": 1754091436,
"narHash": "sha256-XKqDMN1/Qj1DKivQvscI4vmHfDfvYR2pfuFOJiCeewM=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "506278e768c2a08bec68eb62932193e341f55c90",
"rev": "67df8c627c2c39c41dbec76a1f201929929ab0bd",
"type": "github"
},
"original": {
@ -184,11 +168,11 @@
]
},
"locked": {
"lastModified": 1749160002,
"narHash": "sha256-IM3xKjsKxhu7Y1WdgTltrLKiOJS8nW7D4SUDEMNr7CI=",
"lastModified": 1764361670,
"narHash": "sha256-jgWzgpIaHbL3USIq0gihZeuy1lLf2YSfwvWEwnfAJUw=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "68cc9eeb3875ae9682c04629f20738e1e79d72aa",
"rev": "780be8ef503a28939cf9dc7996b48ffb1a3e04c6",
"type": "github"
},
"original": {
@ -205,11 +189,11 @@
]
},
"locked": {
"lastModified": 1743604125,
"narHash": "sha256-ZD61DNbsBt1mQbinAaaEqKaJk2RFo9R/j+eYWeGMx7A=",
"lastModified": 1762964643,
"narHash": "sha256-RYHN8O/Aja59XDji6WSJZPkJpYVUfpSkyH+PEupBJqM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "180fd43eea296e62ae68e079fcf56aba268b9a1a",
"rev": "827f2a23373a774a8805f84ca5344654c31f354b",
"type": "github"
},
"original": {
@ -226,11 +210,11 @@
"utils": "utils"
},
"locked": {
"lastModified": 1745057346,
"narHash": "sha256-71cyYKUul9owRzbcObXkzhTBcmnXJsvmk1gq0RbP5PQ=",
"lastModified": 1755098995,
"narHash": "sha256-6FN7XEf27DenQHDIKjrjOW3tGIaJlyqRlXarmt1v+M0=",
"owner": "taj-ny",
"repo": "kwin-effects-forceblur",
"rev": "fea9f80f27389aa8a62befb5babf40b28fed328d",
"rev": "51a1d49d7fd7df3ce40ccf6ba4c4410cf6f510e1",
"type": "github"
},
"original": {
@ -251,52 +235,31 @@
"rust-overlay": "rust-overlay"
},
"locked": {
"lastModified": 1737639419,
"narHash": "sha256-AEEDktApTEZ5PZXNDkry2YV2k6t0dTgLPEmAZbnigXU=",
"lastModified": 1762205063,
"narHash": "sha256-If6vQ+KvtKs3ARBO9G3l+4wFSCYtRBrwX1z+I+B61wQ=",
"owner": "nix-community",
"repo": "lanzaboote",
"rev": "a65905a09e2c43ff63be8c0e86a93712361f871e",
"rev": "88b8a563ff5704f4e8d8e5118fb911fa2110ca05",
"type": "github"
},
"original": {
"owner": "nix-community",
"ref": "v0.4.2",
"ref": "v0.4.3",
"repo": "lanzaboote",
"type": "github"
}
},
"nixos-cosmic": {
"inputs": {
"flake-compat": "flake-compat_2",
"nixpkgs": "nixpkgs_2",
"nixpkgs-stable": "nixpkgs-stable_2",
"rust-overlay": "rust-overlay_2"
},
"locked": {
"lastModified": 1749121763,
"narHash": "sha256-TVFiyMBs+3KEzZVwf/n1zedUWzPrMPzud/2Jiho8dcE=",
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"rev": "c89df80b72b4e1802fd91a35f4857868c953c1c0",
"type": "github"
},
"original": {
"owner": "lilyinstarlight",
"repo": "nixos-cosmic",
"type": "github"
}
},
"nixos-wsl": {
"inputs": {
"flake-compat": "flake-compat_3",
"nixpkgs": "nixpkgs_3"
"flake-compat": "flake-compat_2",
"nixpkgs": "nixpkgs_2"
},
"locked": {
"lastModified": 1746453552,
"narHash": "sha256-r66UGha+7KVHkI7ksrcMjnw/mm9Sg4l5bQlylxHwdGU=",
"lastModified": 1764072830,
"narHash": "sha256-ezkjlUCohD9o9c47Ey0/I4CamSS0QEORTqGvyGqMud0=",
"owner": "nix-community",
"repo": "NixOS-WSL",
"rev": "be618645aa0adf461f778500172b6896d5ab2d01",
"rev": "c7832dd786175e20f2697179e0e03efadffe4201",
"type": "github"
},
"original": {
@ -322,45 +285,13 @@
"type": "github"
}
},
"nixpkgs-stable": {
"locked": {
"lastModified": 1730741070,
"narHash": "sha256-edm8WG19kWozJ/GqyYx2VjW99EdhjKwbY3ZwdlPAAlo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d063c1dd113c91ab27959ba540c0d9753409edf3",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.05",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs-stable_2": {
"locked": {
"lastModified": 1748995628,
"narHash": "sha256-bFufQGSAEYQgjtc4wMrobS5HWN0hDP+ZX+zthYcml9U=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "8eb3b6a2366a7095939cd22f0dc0e9991313294b",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1748929857,
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=",
"lastModified": 1763678758,
"narHash": "sha256-+hBiJ+kG5IoffUOdlANKFflTT5nO3FrrR2CA3178Y5s=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4",
"rev": "117cc7f94e8072499b0a7aa4c52084fa4e11cc9b",
"type": "github"
},
"original": {
@ -372,27 +303,11 @@
},
"nixpkgs_3": {
"locked": {
"lastModified": 1742937945,
"narHash": "sha256-lWc+79eZRyvHp/SqMhHTMzZVhpxkRvthsP1Qx6UCq0E=",
"lastModified": 1764242076,
"narHash": "sha256-sKoIWfnijJ0+9e4wRvIgm/HgE27bzwQxcEmo2J/gNpI=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "d02d88f8de5b882ccdde0465d8fa2db3aa1169f7",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-24.11",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_4": {
"locked": {
"lastModified": 1748929857,
"narHash": "sha256-lcZQ8RhsmhsK8u7LIFsJhsLh/pzR9yZ8yqpTzyGdj+Q=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c2a03962b8e24e669fb37b7df10e7c79531ff1a4",
"rev": "2fad6eac6077f03fe109c4d4eb171cf96791faa4",
"type": "github"
},
"original": {
@ -402,13 +317,13 @@
"type": "github"
}
},
"nixpkgs_5": {
"nixpkgs_4": {
"locked": {
"lastModified": 1743448293,
"narHash": "sha256-bmEPmSjJakAp/JojZRrUvNcDX2R5/nuX6bm+seVaGhs=",
"lastModified": 1762977756,
"narHash": "sha256-4PqRErxfe+2toFJFgcRKZ0UI9NSIOJa+7RXVtBhy4KE=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "77b584d61ff80b4cef9245829a6f1dfad5afdfa3",
"rev": "c5ae371f1a6a7fd27823bc500d9390b38c05fa55",
"type": "github"
},
"original": {
@ -428,15 +343,14 @@
"nixpkgs": [
"lanzaboote",
"nixpkgs"
],
"nixpkgs-stable": "nixpkgs-stable"
]
},
"locked": {
"lastModified": 1731363552,
"narHash": "sha256-vFta1uHnD29VUY4HJOO/D6p6rxyObnf+InnSMT4jlMU=",
"lastModified": 1750779888,
"narHash": "sha256-wibppH3g/E2lxU43ZQHC5yA/7kIKLGxVEnsnVK1BtRg=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "cd1af27aa85026ac759d5d3fccf650abe7e1bbf0",
"rev": "16ec914f6fb6f599ce988427d9d94efddf25fe6d",
"type": "github"
},
"original": {
@ -451,9 +365,8 @@
"home-manager": "home-manager",
"kwin-effects-forceblur": "kwin-effects-forceblur",
"lanzaboote": "lanzaboote",
"nixos-cosmic": "nixos-cosmic",
"nixos-wsl": "nixos-wsl",
"nixpkgs": "nixpkgs_4",
"nixpkgs": "nixpkgs_3",
"snowfall-lib": "snowfall-lib",
"sops-nix": "sops-nix",
"trilium-next-pr": "trilium-next-pr",
@ -469,32 +382,11 @@
]
},
"locked": {
"lastModified": 1731897198,
"narHash": "sha256-Ou7vLETSKwmE/HRQz4cImXXJBr/k9gp4J4z/PF8LzTE=",
"lastModified": 1761791894,
"narHash": "sha256-myRIDh+PxaREz+z9LzbqBJF+SnTFJwkthKDX9zMyddY=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "0be641045af6d8666c11c2c40e45ffc9667839b5",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"type": "github"
}
},
"rust-overlay_2": {
"inputs": {
"nixpkgs": [
"nixos-cosmic",
"nixpkgs"
]
},
"locked": {
"lastModified": 1749091064,
"narHash": "sha256-TGtYjzRX0sueFhwYsnNNFF5TTKnpnloznpIghLzxeXo=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "12419593ce78f2e8e1e89a373c6515885e218acb",
"rev": "59c45eb69d9222a4362673141e00ff77842cd219",
"type": "github"
},
"original": {
@ -505,7 +397,7 @@
},
"snowfall-lib": {
"inputs": {
"flake-compat": "flake-compat_4",
"flake-compat": "flake-compat_3",
"flake-utils-plus": "flake-utils-plus",
"nixpkgs": [
"nixpkgs"
@ -532,11 +424,11 @@
]
},
"locked": {
"lastModified": 1747603214,
"narHash": "sha256-lAblXm0VwifYCJ/ILPXJwlz0qNY07DDYdLD+9H+Wc8o=",
"lastModified": 1764021963,
"narHash": "sha256-1m84V2ROwNEbqeS9t37/mkry23GBhfMt8qb6aHHmjuc=",
"owner": "mic92",
"repo": "sops-nix",
"rev": "8d215e1c981be3aa37e47aeabd4e61bb069548fd",
"rev": "c482a1c1bbe030be6688ed7dc84f7213f304f1ec",
"type": "github"
},
"original": {
@ -629,14 +521,14 @@
"zen-browser": {
"inputs": {
"home-manager": "home-manager_2",
"nixpkgs": "nixpkgs_5"
"nixpkgs": "nixpkgs_4"
},
"locked": {
"lastModified": 1749093358,
"narHash": "sha256-Clx1BzHsSSzIXbnCW9KM3m5gW3SFgemcW9/4XH4epeM=",
"lastModified": 1764414951,
"narHash": "sha256-pZ2m2JmTTMyqiKB8WSigsSvAeoShI6OSRhzBuRO9SVY=",
"owner": "0xc000022070",
"repo": "zen-browser-flake",
"rev": "d4cf0ac2e860be17036a376ae99b233a115826bc",
"rev": "10d2aa53ada9b14f6df2f9877d6a057f0a2b262f",
"type": "github"
},
"original": {

View File

@ -11,7 +11,6 @@
inputs.nixpkgs.follows = "nixpkgs";
};
game-of-life.url = "github:local-interloper/game-of-life";
nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";
# Add sops-nix for secrets management
sops-nix = {
url = "github:mic92/sops-nix";
@ -24,7 +23,7 @@
};
trilium-next-pr.url = "github:FliegendeWurst/nixpkgs/trilium-next";
lanzaboote = {
url = "github:nix-community/lanzaboote/v0.4.2";
url = "github:nix-community/lanzaboote/v0.4.3";
# Optional but recommended to limit the size of your system closure.
inputs.nixpkgs.follows = "nixpkgs";
@ -119,7 +118,9 @@
channels-config = {
# Allow unfree packages.
allowUnfree = true;
permittedInsecurePackages = [
"mbedtls-2.28.10" # needed for haxe 4.3.6
];
# # Allow certain insecure packages
# permittedInsecurePackages = [
# "firefox-100.0.0"

View File

@ -1,32 +0,0 @@
{ config
, lib
, inputs
, pkgs
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.my-namespace) disabled enabled;
cfg = config.my-namespace.cosmic-desktop;
# moduleImports = {
# "enabled" = [inputs.nixos-cosmic.nixosModules.default];
# "disabled" = [];
# };
# optionalImports = { imports = []; };
in
{
options.my-namespace.cosmic-desktop = {
enable = mkEnableOption "Enable cosmic";
};
imports = [ inputs.nixos-cosmic.nixosModules.default ];
config = mkIf cfg.enable {
nix.settings = {
substituters = [ "https://cosmic.cachix.org/" ];
trusted-public-keys = [ "cosmic.cachix.org-1:Dya9IyXD4xdBehWjrkPv6rtxpmMdRel02smYzA85dPE=" ];
};
services.desktopManager.cosmic.enable = true;
services.displayManager.cosmic-greeter.enable = true;
};
}

View File

@ -1,57 +0,0 @@
{ 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

@ -1,176 +0,0 @@
{ config
, lib
, pkgs
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.my-namespace) disabled enabled;
cfg = config.my-namespace.hardware.graphics-nvidia-prime-amd-testing;
in
{
options.my-namespace.hardware.graphics-nvidia-prime-amd-testing = {
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 = [
"nvidia"
# "nvidia-drm"
# "nvidia-uvm"
# "nvidia-modeset"
# "nvidiafb"
"amdgpu"
# "modesetting"
];
# Enable OpenGL
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [ nvidia-vaapi-driver ];
};
hardware.graphics.enable32Bit = true; # For 32 bit applications
# Enable Switcheroo
services.switcherooControl.enable = true;
# Use Beta Driver Package
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11_beta ];
boot.loader.systemd-boot.consoleMode = "max";
# Enable required Kernel Modules
boot.initrd.kernelModules = [
"nvidia"
"nvidia-drm"
"nvidia-uvm"
"nvidia-modeset"
"nvidiafb"
"amdgpu"
# # "i2c-nvidia_gpu"
];
boot.kernelParams = [
# "amdgpu.modeset=1"
# "nvidia-drm.fbdev=1"
# "nvidia-drm.modeset=1"
# # "nvidia.NVreg_PreserveVideoMemoryAllocations=0"
"amd_iommu=on"
# "vfio-pci.ids=\"10de:2489,10de:228b\""
# "nomodeset"
# "nvidia_drm.modeset=1"
];
# Blacklist intel and nouveau
boot.blacklistedKernelModules = [
# "i915"
"nouveau"
# "nvidia"
# "nvidia-drm"
# "nvidia-uvm"
# "nvidiafb"
# "nvidia_drm"
# "nvidia_modeset"
];
# Extra blacklist nouveau
# boot.extraModprobeConfig = ''
# blacklist nouveau
# options nouveau modeset=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
# '';
# Configure NVIDIA driver
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
package = config.boot.kernelPackages.nvidiaPackages.beta;
# package = config.boot.kernelPackages.nvidiaPackages.none;
# package = config.boot.kernelPackages.nvidiaPackages.production;
nvidiaPersistenced = true;
forceFullCompositionPipeline = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
# sync.enable=true;
# reverseSync.enable = false;
# Make sure to use the correct Bus ID values for your system!
# intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:1:0:0";
amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
};
};
# Add user to extra groups
users.users.andreas = {
extraGroups = [ "video" "render" ];
};
};
}

View File

@ -1,170 +0,0 @@
{ config
, lib
, pkgs
, ...
}:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.my-namespace) disabled enabled;
cfg = config.my-namespace.hardware.graphics-nvidia-prime-amd;
in
{
options.my-namespace.hardware.graphics-nvidia-prime-amd = {
enable = mkEnableOption "Enable nvidia";
};
config = mkIf cfg.enable {
# Enable NVIDIA driver for X11 and Wayland
services.xserver.videoDrivers = [ "amdgpu" "nvidia" ];
services.xserver.displayManager.xserverArgs = [ "-config" "/opt/x11/xserver.conf" ];
services.xserver.config = lib.mkAfter ''
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
'';
services.switcherooControl.enable = true;
# Enable OpenGL
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [ nvidia-vaapi-driver ];
};
# Use Beta Driver Package
boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
boot.loader.systemd-boot.consoleMode = "max";
# Enable required Kernel Modules
boot.initrd.kernelModules = [
"nvidia-modeset"
"nvidia"
# "amdgpu"
"nvidia-drm"
# "nvidiafb"
# "nvidia-uvm"
# "i2c-nvidia_gpu"
];
boot.kernelParams = [
# "amdgpu.modeset=1"
"nvidia-drm.fbdev=1"
"nvidia-drm.modeset=1"
# "nvidia.NVreg_PreserveVideoMemoryAllocations=0"
# "amd_iommu=on"
# "vfio-pci.ids=\"10de:2489,10de:228b\""
# "nomodeset"
# "nvidia_drm.modeset=1"
];
# Blacklist intel and nouveau
boot.blacklistedKernelModules = [
"i915"
"nouveau"
# "nvidia"
# "nvidia-drm"
# "nvidia-uvm"
# "nvidiafb"
# "nvidia_drm"
# "nvidia_modeset"
];
# Extra blacklist nouveau
boot.extraModprobeConfig = ''
blacklist nouveau
options nouveau modeset=0
'';
# Configure NVIDIA driver
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
# package = config.boot.kernelPackages.nvidiaPackages.beta;
package = config.boot.kernelPackages.nvidiaPackages.stable;
# package = config.boot.kernelPackages.nvidiaPackages.none;
# package = config.boot.kernelPackages.nvidiaPackages.production;
forceFullCompositionPipeline = false;
prime = {
offload = {
enable = lib.mkForce true;
enableOffloadCmd = lib.mkForce true;
};
reverseSync.enable = lib.mkForce false;
sync.enable = lib.mkForce false;
# Make sure to use the correct Bus ID values for your system!
# intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:01:0:0";
amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
};
};
# Add user to extra groups
users.users.andreas = {
extraGroups = [ "video" "render" ];
};
};
}

View File

@ -1,151 +0,0 @@
{ config, lib, pkgs, modulesPath, ... }:
let
inherit (lib) mkEnableOption mkIf;
inherit (lib.my-namespace) disabled enabled;
cfg = config.my-namespace.hardware.graphics-nvidia-specializations;
in
{
options.my-namespace.hardware.graphics-nvidia-specializations = {
enable = mkEnableOption "Enable nvidia";
};
options.nvidia-sync.enable = lib.mkEnableOption "Enable NVIDIA prime sync mode";
options.nvidia-offload.enable = lib.mkEnableOption "Enable NVIDIA prime sync mode";
config = {
specialisation."NVIDIA-SYNC".configuration = {
system.nixos.tags = [ "with-nvidia-sync" ];
nvidia-sync.enable = true;
};
specialisation."NVIDIA-OFFLOAD".configuration = {
system.nixos.tags = [ "with-nvidia-offload" ];
nvidia-offload.enable = true;
};
services.xserver.videoDrivers = [ "nvidia" "amdgpu" ];
hardware.graphics = {
extraPackages = with pkgs; [ nvidia-vaapi-driver ];
};
boot.kernelParams = [
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
"nvidia-drm.fbdev=0"
"nvidia-drm.modeset=0"
"amdgpu.modeset=1"
];
boot.initrd.kernelModules = [
# "amdgpu"
"nvidia"
"nvidia-drm"
"nvidia_drm"
"nvidia-uvm"
"nvidia_uvm"
# "nvidia-modeset"
# "i2c-nvidia_gpu"
];
hardware.nvidia = {
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
powerManagement.finegrained = false;
# Use the NVidia open source kernel module (not to be confused with the
# independent third-party "nouveau" open source driver).
# Support is limited to the Turing and later architectures. Full list of
# supported GPUs is at:
# https://github.com/NVIDIA/open-gpu-kernel-modules#compatible-gpus
# Only available from driver 515.43.04+
# Currently alpha-quality/buggy, so false is currently the recommended setting.
open = false;
# Enable the Nvidia settings menu,
# accessible via `nvidia-settings`.
nvidiaSettings = true;
# Optionally, you may need to select the appropriate driver version for your specific GPU.
# package = config.boot.kernelPackages.nvidiaPackages.beta;
package = config.boot.kernelPackages.nvidiaPackages.production;
prime = {
amdgpuBusId = "PCI:50:0:0";
nvidiaBusId = "PCI:1:0:0";
} // lib.optionalAttrs config.nvidia-sync.enable {
sync.enable = false;
} // lib.optionalAttrs (config.nvidia-offload.enable) {
offload = {
enable = true;
enableOffloadCmd = true;
};
};
};
services.xserver.config = lib.mkAfter ''
Section "ServerLayout"
Identifier "layout"
Screen 0 "amdgpu"
Inactive "nvidia"
Option "AllowNVIDIAGPUScreens"
Option "AllowEmptyInitialConfiguration" "True"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:01:0:0"
Option "AllowEmptyInitialConfiguration" "True"
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration" "True"
EndSection
Section "Device"
Identifier "amdgpu"
Driver "amdgpu"
BusID "PCI:50:0:0"
#Option "AllowNVIDIAGPUScreens"
#Option "AllowEmptyInitialConfiguration" "True"
EndSection
Section "Screen"
Identifier "amdgpu"
Device "amdgpu"
#Option "AllowEmptyInitialConfiguration" "True"
EndSection
'';
# 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
# '';
};
}

View File

@ -43,7 +43,7 @@ in
age
wget
sops
bitwarden
bitwarden-desktop #replaced bitwarden
bitwarden-cli
cowsay
remmina

View File

@ -104,6 +104,32 @@ pkgs.kdePackages.mkKdeDerivation rec {
# Fix Qt6 deprecation warning in qthelper.hpp
sed -i 's|v.type()|v.metaType().id()|g' src/backend_mpv/qthelper.hpp
# Fix Qt6 qplatformnativeinterface.h removal in MpvBackend.cpp
# Wrap the Qt5-only header in version check
sed -i '/# include <qpa\/qplatformnativeinterface.h>/{
i\#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
a\#endif
}' src/backend_mpv/MpvBackend.cpp
# Remove TODO comments
sed -i '/TODO.*QX11Application/d' src/backend_mpv/MpvBackend.cpp
sed -i '/same for wayland/d' src/backend_mpv/MpvBackend.cpp
# Fix X11 display access for Qt6
sed -i '/params\[2\].type = MPV_RENDER_PARAM_X11_DISPLAY;/,/params\[2\].data = QX11Info::display();/{
s|auto\* native = QGuiApplication::platformNativeInterface();|auto* x11App = qApp->nativeInterface<QNativeInterface::QX11Application>();|
s|params\[2\].data = native->nativeResourceForWindow("display", nullptr);|params[2].data = x11App ? x11App->display() : nullptr;|
}' src/backend_mpv/MpvBackend.cpp
# Fix Wayland display access for Qt6
sed -i '/params\[2\].type = MPV_RENDER_PARAM_WL_DISPLAY;/,/params\[2\].data = native->nativeResourceForWindow("display", nullptr);/{
/params\[2\].type = MPV_RENDER_PARAM_WL_DISPLAY;/a\#if (QT_VERSION >= QT_VERSION_CHECK(6, 0, 0))\
auto* waylandApp = qApp->nativeInterface<QNativeInterface::QWaylandApplication>();\
params[2].data = waylandApp ? waylandApp->display() : nullptr;\
#else
/params\[2\].data = native->nativeResourceForWindow/a\#endif
}' src/backend_mpv/MpvBackend.cpp
'';
cmakeFlags = [

View File

@ -7,7 +7,7 @@ pkgs.mkShellNoCC {
packages = with pkgs; [
cowsay
lolcat
bitwarden
bitwarden-desktop #replaced bitwarden
bitwarden-cli
sops
];

View File

@ -47,18 +47,16 @@
desktopManager.gnome.enable = true;
displayManager.gdm.enable = false;
displayManager.sddm.enable = true;
displayManager.sddm.wayland.enable = true;
displayManager.defaultSession = "gnome";
desktopManager.plasma6.enable = true;
xserver = {
enable = true; # Enable the deprecated X11 teletype terminal connection system.
desktopManager = {
# Disable xterm
xterm.enable = false;
# Enable xfce session
xfce = {
enable = true;
};
# Disable fuckshit plasma
};
# Configure Display Manager
@ -145,6 +143,8 @@
# Install firefox.
programs.firefox.enable = true;
programs.xwayland.enable = true;
# Allow unfree packages
nixpkgs.config.allowUnfree = true;
@ -157,12 +157,28 @@
kdePackages.qtwebsockets
kdePackages.qtwebchannel
qt6.qtwebengine
xfce.xfce4-whiskermenu-plugin
gnome-tweaks
qemu
mpv
krita
];
environment.etc."xdg/autostart/xwaylandvideobridge.desktop".text = ''
[Desktop Entry]
Hidden=true
'';
virtualisation.libvirtd = {
enable = true;
qemu = {
package = pkgs.qemu_kvm;
runAsRoot = true;
swtpm.enable = true;
};
};
systemd.tmpfiles.rules = [ "L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware" ];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;

View File

@ -43,12 +43,11 @@ in
users.users.andreas = {
isNormalUser = true;
description = "Andreas Schaafsma";
extraGroups = [ "networkmanager" "wheel" ] ;
extraGroups = [ "networkmanager" "wheel" "libvirtd" ] ;
packages = with pkgs; [
# Packages from inputs
inputs.game-of-life.packages.x86_64-linux.default
inputs.zen-browser.packages.x86_64-linux.default
inputs.nixos-cosmic
inputs.trilium-next-pr.legacyPackages.x86_64-linux.trilium-next-desktop
# We want flatpak support
flatpak
@ -61,14 +60,14 @@ in
vscode
spotify
appimage-run
minecraft
prismlauncher #replaces broken minecraft package
trilium-desktop
terraform
virt-manager
# thunderbird
];
};
services.gnome.gnome-remote-desktop.enable = true;
my-namespace.cosmic-desktop.enable = false;
my-namespace.wallpaper-engine-kde-plugin.enable = true;
# lib.my-namespace.home.stream-tools.enable = true;
@ -118,7 +117,7 @@ in
++ installedPackages.packages;
programs.nix-ld = {
enable = true;
package = pkgs.nix-ld-rs;
package = pkgs.nix-ld; #replaces nix-ld-rs
};
services.flatpak.enable = true;
systemd.services.flatpak-repo = {

View File

@ -1,7 +1,7 @@
{ config, lib, pkgs, ... }:
{
# boot.kernelParams = [ "drm.edid_firmware=DP-1:edid/edid.bin,DP-2:edid/edid.bin,DP-3:edid/edid.bin,DP-4:edid/edid.bin" ];
boot.kernelParams = [ "drm.edid_firmware=DP-1:edid/edid.bin,DP-2:edid/edid.bin,DP-3:edid/edid.bin" ];
boot.kernelParams = [ "drm.edid_firmware=DP-2:edid/edid.bin" ];
hardware.firmware = [

View File

@ -0,0 +1,74 @@
{ config, lib, pkgs, ... }:
{
############################
## Display + Mesa Settings
############################
# hardware.enableRedistributableFirmware = true;
hardware.firmware = [
pkgs.linux-firmware
# pkgs.firmwareLinuxNonfree
# pkgs.firmwareLinuxStrict
# pkgs.firmwareLinuxLatest
];
# boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelParams = [
"console=tty0"
"efifb=off"
"xe.force_probe=*"
"nvidia-drm.modeset=1"
];
hardware.graphics = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver # Intel VAAPI
vpl-gpu-rt # oneVPL runtime
intel-vaapi-driver # fallback
];
};
# Ensure Arc driver is available (usually auto-loaded)
boot.kernelModules = [ "xe" ];
boot.blacklistedKernelModules = [ "nouveau" ];
############################
## X / Wayland GPU Drivers
############################
# Only specify NVIDIA. Intel Arc uses the modesetting driver automatically.
services.xserver.videoDrivers = [ "nvidia" ];
############################
## NVIDIA Configuration
############################
hardware.nvidia = {
modesetting.enable = true; # REQUIRED if any displays are on NVIDIA
open = false; # GTX 1070 → must be the proprietary driver
nvidiaSettings = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
prime = {
offload.enable = false; # not a laptop, must be disabled
sync.enable = false;
};
# Correct way to pick the driver
package = config.boot.kernelPackages.nvidiaPackages.production;
};
# Remove → hardware.nvidia handles module packages
# boot.extraModulePackages = [ config.boot.kernelPackages.nvidia_x11 ];
############################
## User Access
############################
users.users.andreas.extraGroups = [ "video" "render" ];
}

View File

@ -4,7 +4,7 @@ let
in
{
my-namespace.hardware = {
graphics-nvidia-specializations = enabled;
# graphics-nvidia-specializations.enabled = false;
# graphics-nvidia-prime-amd = enabled;
# graphics-nvidia-prime-amd-testing = enabled;
# graphics-amd-igpu-only = enabled;

View File

@ -16,11 +16,11 @@
boot.loader.systemd-boot.consoleMode = "max";
boot.kernelParams = [
"amdgpu.modeset=1"
# "amdgpu.modeset=0"
"nvidia-drm.fbdev=1"
"nvidia-drm.modeset=0"
# "nvidia.NVreg_PreserveVideoMemoryAllocations=0"
"amd_iommu=on"
"nvidia-drm.modeset=1"
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
# "amd_iommu=on"
# "vfio-pci.ids=\"10de:2489,10de:228b\""
# "nomodeset"
# "nvidia_drm.modeset=1"
@ -28,60 +28,22 @@
boot.blacklistedKernelModules = [
"i915"
"nouveau"
# "nvidia"
# "nvidia-drm"
# "nvidia-uvm"
# "nvidiafb"
# "nvidia_drm"
# "nvidia_modeset"
"amdgpu"
];
# boot.extraModprobeConfig = ''
# blacklist nvidia
# blacklist nvidia-drm
# blacklist nvidia_drm
# blacklist nvidia-uvm
# blacklist nvidia_uvm
# blacklist nvidia_modeset
# blacklist nvidiafb
# blacklist nouveau
# options nouveau modeset=0
# '';
boot.extraModprobeConfig = ''
blacklist nouveau
options nouveau modeset=0
'';
# services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.videoDrivers = [ "amdgpu" "nvidia" ];
# services.udev.extraRules = ''
# # Remove NVIDIA USB xHCI Host Controller devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c0330", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA USB Type-C UCSI devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x0c8000", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA Audio devices, if present
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x040300", ATTR{power/control}="auto", ATTR{remove}="1"
# # Remove NVIDIA VGA/3D controller devices
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x03[0-9]*", ATTR{power/control}="auto", ATTR{remove}="1"
# '';
services.xserver.videoDrivers = [ "nvidia" ];
boot.initrd.kernelModules = [
"amdgpu"
"nvidia"
# "nvidia-drm"
"nvidiafb"
# "nvidia-uvm"
# "nvidia-modeset"
# "i2c-nvidia_gpu"
"nvidia_drm"
];
hardware.nvidia = {
# Modesetting is required.
modesetting.enable = true;
# Nvidia power management. Experimental, and can cause sleep/suspend to fail.
# Enable this if you have graphical corruption issues or application crashes after waking
# up from sleep. This fixes it by saving the entire VRAM memory to /tmp/ instead
# of just the bare essentials.
powerManagement.enable = true;
powerManagement.enable = false;
# Fine-grained power management. Turns off GPU when not in use.
# Experimental and only works on modern Nvidia GPUs (Turing or newer).
@ -105,19 +67,19 @@
# package = config.boot.kernelPackages.nvidiaPackages.none;
# package = config.boot.kernelPackages.nvidiaPackages.production;
forceFullCompositionPipeline = false;
forceFullCompositionPipeline = true;
prime = {
offload = {
enable = true;
enableOffloadCmd = true;
};
reverseSync.enable = false;
# Make sure to use the correct Bus ID values for your system!
# intelBusId = "PCI:0:2:0";
nvidiaBusId = "PCI:01:0:0";
amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
};
# prime = {
# offload = {
# enable = true;
# enableOffloadCmd = true;
# };
# reverseSync.enable = false;
# # Make sure to use the correct Bus ID values for your system!
# # intelBusId = "PCI:0:2:0";
# nvidiaBusId = "PCI:01:0:0";
# amdgpuBusId = "PCI:50:0:0"; #For AMD GPU
# };
};
users.users.andreas = {

View File

@ -7,18 +7,19 @@
imports =
[
(modulesPath + "/installer/scan/not-detected.nix")
./graphics/nvidia-stable.nix
./graphics/intel_nvidia.nix
# ./graphics/nvidia.nix
./acer-monitor-edid.nix
];
#boot.kernelPackages = pkgs.linuxPackages_latest;
boot.kernelPackages = pkgs.linuxPackages_latest;
hardware.enableRedistributableFirmware = true;
# boot.kernelPackages = pkgs.linuxKernel.packages.linux_xanmod_latest;
boot.kernelPackages = pkgs.linuxPackages;
# boot.kernelPackages = pkgs.linuxPackages;
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" ];
boot.kernelModules = [ "kvm-amd" "4vl2loopback" ];
boot.extraModulePackages = [ pkgs.linuxPackages.v4l2loopback ];
boot.extraModulePackages = [ config.boot.kernelPackages.v4l2loopback ];
boot.supportedFilesystems = [ "ntfs" ];
boot.blacklistedKernelModules = [ ];
fileSystems."/" =
{ device = "/dev/disk/by-uuid/563805a1-5277-4488-bbdd-c1a7ed37be76";

View File

@ -5,7 +5,7 @@
];
boot.extraModulePackages = [
pkgs.linuxPackages.v4l2loopback # Webcam loopback
config.boot.kernelPackages.v4l2loopback # Webcam loopback
];
boot.extraModprobeConfig = ''