This commit is contained in:
muon 2024-06-14 14:36:36 +00:00
parent 0cc9a3c8b6
commit b5e7be0747
4 changed files with 42 additions and 25 deletions

View file

@ -1,6 +1,7 @@
{ config, lib, pkgs, inputs, system, ... }: { config, lib, pkgs, inputs, system, ... }:
let let
cfg = config.mods; cfg = config.mods;
res = "2560x1440";
in { in {
# Hardware # Hardware
imports = [ imports = [
@ -41,12 +42,13 @@ in {
services.xserver.libinput.mouse.accelProfile = "flat"; services.xserver.libinput.mouse.accelProfile = "flat";
## Monitors ## Monitors
mods.monitor.main.resolution = res;
services.xserver.xrandrHeads = [ services.xserver.xrandrHeads = [
{ {
output = "DP-2"; output = "DP-2";
primary = true; primary = true;
monitorConfig = '' monitorConfig = ''
Option "PreferredMode" "2560x1440" Option "PreferredMode" "${res}"
Option "Position" "0x480" Option "Position" "0x480"
''; '';
} }

View file

@ -1,4 +1,15 @@
{ pkgs, lib, ... }: { { pkgs, lib, config, ... }: {
boot.loader.systemd-boot.enable = true; # boot.loader.systemd-boot.enable = true;
boot.loader.efi.canTouchEfiVariables = true; # boot.plymouth.enable = true;
# boot.initrd.systemd.enable = true;
# boot.kernelParams = [ "quiet" ];
boot.loader = {
efi.canTouchEfiVariables = true;
grub = {
enable = true;
efiSupport = true;
device = "nodev";
gfxmodeEfi = config.mods.monitor.main.resolution;
};
};
} }

View file

@ -1,10 +1,32 @@
{ pkgs, lib, config, ... }: { { pkgs, lib, config, ... }: {
options.mods.xorg.enable = lib.mkEnableOption "enables xorg"; options.mods = {
xorg.enable = lib.mkEnableOption "enables xorg";
monitor.main.resolution = lib.mkOption {
description = "main monitor resolution";
type = lib.types.string;
default = "1920x1080";
example = "2560x1440";
};
};
config = lib.mkIf config.mods.xorg.enable { config = let
startupTargets = [
"systemd-user-sessions.service"
"multi-user.target"
"network-online.target"
];
in lib.mkIf config.mods.xorg.enable {
services.xserver.enable = true; services.xserver.enable = true;
services.xserver.displayManager.gdm.enable = true;
services.xserver.xkb.layout = "us"; services.xserver.xkb.layout = "us";
services.xserver.xkb.options = "caps:escape"; services.xserver.xkb.options = "caps:escape";
services.xserver.displayManager.gdm.enable = true;
services.xserver.displayManager.autoLogin.enable = true;
services.xserver.displayManager.autoLogin.user =
config.mods.user.name;
systemd.services.display-manager.wants = startupTargets;
systemd.services.display-manager.after = startupTargets;
}; };
} }

View file

@ -8,7 +8,6 @@ in {
description = "enables proprietary nvidia drivers"; description = "enables proprietary nvidia drivers";
}; };
packages = lib.mkOption { packages = lib.mkOption {
# default = [ "nvidia-x11" "nvidia-settings" "nvidia-persistenced" ];
default = [ "nvidia-x11" ]; default = [ "nvidia-x11" ];
description = "unfree packages"; description = "unfree packages";
}; };
@ -26,8 +25,6 @@ in {
driSupport32Bit = true; driSupport32Bit = true;
}; };
# boot.kernelParams = [ "nvidia.NVreg_PreserveVideoMemoryAllocations=1" ];
# boot.initrd.kernelModules = [ "nvidia" ];
services.xserver.videoDrivers = [ "nvidia" "nvidia-dkms" ]; services.xserver.videoDrivers = [ "nvidia" "nvidia-dkms" ];
hardware.nvidia = { hardware.nvidia = {
@ -40,21 +37,6 @@ in {
nvidiaSettings = false; nvidiaSettings = false;
package = config.boot.kernelPackages.nvidiaPackages."${cfg.driver}"; package = config.boot.kernelPackages.nvidiaPackages."${cfg.driver}";
# package = let
# rcu_patch = pkgs.fetchpatch {
# url = "https://github.com/gentoo/gentoo/raw/c64caf53/x11-drivers/nvidia-drivers/files/nvidia-drivers-470.223.02-gpl-pfn_valid.patch";
# hash = "sha256-eZiQQp2S/asE7MfGvfe6dA/kdCvek9SYa/FFGp24dVg=";
# };
# in config.boot.kernelPackages.nvidiaPackages.mkDriver {
# version = "535.154.05";
# sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg=";
# sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k=";
# openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo=";
# settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10=";
# persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE=";
# patches = [ rcu_patch ];
# };
}; };
}; };
} }