This commit is contained in:
4DBug
2026-01-17 15:48:12 -06:00
parent 124c9586cc
commit a33c3f37be

View File

@@ -1,4 +1,4 @@
{ lib, config, inputs, pkgs, desktop, ... }: { lib, config, inputs, pkgs, options, desktop, ... }:
let let
nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz"); nix-gaming = import (builtins.fetchTarball "https://github.com/fufexan/nix-gaming/archive/master.tar.gz");
@@ -46,9 +46,28 @@ in
libva-utils libva-utils
libglvnd libglvnd
mesa mesa
]; ] ++ (if desktop then [
nvidia-vaapi-driver
] else [
]);
}; };
nvidia = if (desktop) then {
modesetting.enable = true;
powerManagement.enable = false;
powerManagement.finegrained = false;
open = false;
nvidiaSettings = true;
package = config.boot.kernelPackages.nvidiaPackages.latest;
nvidiaPersistenced = false;
} else {};
enableRedistributableFirmware = true; enableRedistributableFirmware = true;
}; };
@@ -56,7 +75,6 @@ in
DefaultEnvironment="PATH=/run/current-system/sw/bin" DefaultEnvironment="PATH=/run/current-system/sw/bin"
''; '';
#systemd.extraConfig = "DefaultTimeoutStopSec=10s";
systemd.services.monitord.wantedBy = [ "multi-user.target" ]; systemd.services.monitord.wantedBy = [ "multi-user.target" ];
systemd.services.mpd.environment = { systemd.services.mpd.environment = {
@@ -64,6 +82,8 @@ in
}; };
boot = { boot = {
kernelParams = if desktop then ["nvidia_drm.fbdev=1"] else [];
kernelPackages = pkgs.linuxPackages_zen; kernelPackages = pkgs.linuxPackages_zen;
kernel.sysctl = { kernel.sysctl = {
@@ -75,13 +95,6 @@ in
loader = { loader = {
grub.splashImage = null; grub.splashImage = null;
#grub = {
# enable = true;
# device = "nodev";
# efiSupport = true;
# gfxmodeEfi = "5120x1440";
#};
systemd-boot.enable = true; systemd-boot.enable = true;
systemd-boot.configurationLimit = 25; systemd-boot.configurationLimit = 25;
@@ -373,7 +386,8 @@ in
samrewritten samrewritten
impression impression
bambu-studio bambu-studio
resources # resources
mission-center
authenticator authenticator
@@ -389,7 +403,14 @@ in
environment = { environment = {
variables = { variables = {
MICRO_TRUECOLOR = 1; MICRO_TRUECOLOR = 1;
}; } // (if desktop then {
WGPU_BACKEND = "gl";
GBM_BACKEND = "nvidia-drm";
LIBVA_DRIVER_NAME = "nvidia";
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
} else {
});
sessionVariables = { sessionVariables = {
BROWSER = "firefox"; BROWSER = "firefox";
@@ -492,6 +513,7 @@ in
config = { config = {
allowUnfree = true; allowUnfree = true;
cudaSupport = desktop; cudaSupport = desktop;
nvidia.acceptLicense = desktop;
}; };
overlays = [ overlays = [
@@ -571,9 +593,10 @@ ssh -R \"$\{name}:80:localhost:$\{port}\" tuns.sh'\'' _";
nix-ld = { nix-ld = {
enable = true; enable = true;
libraries = with pkgs; [
stdenv.cc.cc libraries = options.programs.nix-ld.libraries.default ++ (with pkgs; [
];
]);
}; };
}; };
} }