Desktop usability adjustments (#1)

Reviewed-on: #1
This commit is contained in:
2025-05-18 12:56:42 +00:00
parent 1d2b3f799d
commit d91ebe083d
42 changed files with 1649 additions and 1403 deletions

View File

@@ -0,0 +1,26 @@
{
config,
lib,
pkgs,
...
}:
{
environment.systemPackages = [
pkgs.bluez
];
hardware.bluetooth = {
enable = true;
powerOnBoot = false;
settings = {
General = {
Name = "Hello";
ControllerMode = "dual";
FastConnectable = "true";
Experimental = "true";
};
Policy = {
AutoEnable = "true";
};
};
};
}

3
modules/nixos/flakes.nix Normal file
View File

@@ -0,0 +1,3 @@
{
nix.settings.experimental-features = [ "nix-command" "flakes" ];
}

View File

@@ -0,0 +1,9 @@
{
config,
lib,
pkgs,
...
}:
{
services.flatpak.enable = true;
}

11
modules/nixos/fonts.nix Normal file
View File

@@ -0,0 +1,11 @@
{
config,
lib,
pkgs,
...
}:
{
# from here on fonts are managed on a user level
fonts.fontDir.enable = true;
fonts.fontconfig.enable = true;
}

View File

@@ -20,5 +20,8 @@
enable = true;
wayland = true;
};
security.pam.services.hyprlock = {};
security.pam.services.gdm.enableGnomeKeyring = true;
}

10
modules/nixos/nh.nix Normal file
View File

@@ -0,0 +1,10 @@
{
config,
pkgs,
...
}:
{
programs.nh = {
enable = true;
};
}

View File

@@ -1,8 +1,8 @@
{
config,
lib,
pkgs,
...
config,
lib,
pkgs,
...
}:
{
@@ -13,34 +13,34 @@
configuration = {
system.nixos.tags = [ "nvidia-enabled" ];
# Enable OpenGL
hardware.graphics = {
enable = true;
};
hardware.nvidia = {
# prime = {
# nvidiaBusId = "PCI:1:0:0";
# intelBusId = "PCI:0:2:0";
# };
hardware.graphics.enable = lib.mkForce true;
hardware.nvidia = lib.mkForce {
modesetting.enable = true;
powerManagement.enable = true;
# features not available for the old graphics card
powerManagement.finegrained = false;
open = false;
nvidiaSettings = false;
prime = {
sync.enable = true;
nvidiaBusId = "PCI:1:0:0";
intelBusId = "PCI:0:2:0";
};
package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
version = "565.77";
sha256_64bit = "sha256-CnqnQsRrzzTXZpgkAtF7PbH9s7wbiTRNcM0SPByzFHw=";
sha256_aarch64 = "sha256-LSAYUnhfnK3rcuPe1dixOwAujSof19kNOfdRHE7bToE=";
openSha256 = "sha256-Fxo0t61KQDs71YA8u7arY+503wkAc1foaa51vi2Pl5I=";
settingsSha256 = "sha256-VUetj3LlOSz/LB+DDfMCN34uA4bNTTpjDrb6C6Iwukk=";
persistencedSha256 = "sha256-wnDjC099D8d9NJSp9D0CbsL+vfHXyJFYYgU3CwcqKww=";
version = "575.51.02";
sha256_64bit = "sha256-XZ0N8ISmoAC8p28DrGHk/YN1rJsInJ2dZNL8O+Tuaa0=";
openSha256 = "sha256-NQg+QDm9Gt+5bapbUO96UFsPnz1hG1dtEwT/g/vKHkw=";
settingsSha256 = "sha256-6n9mVkEL39wJj5FB1HBml7TTJhNAhS/j5hqpNGFQE4w=";
usePersistenced = false;
};
};
# overwrite the blacklists set previously
boot.extraModprobeConfig = "";
boot.blacklistedKernelModules = [];
services.udev.extraRules = "";
services.xserver.videoDrivers = ["nvidia"];
boot.extraModprobeConfig = lib.mkForce "";
boot.blacklistedKernelModules = lib.mkForce [];
services.udev.extraRules = lib.mkForce "";
services.xserver.videoDrivers = lib.mkForce ["nvidia"];
};
};
};
@@ -51,7 +51,7 @@
blacklist nouveau
options nouveau modeset=0
'';
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"
@@ -63,34 +63,8 @@
ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", ATTR{power/control}="auto", ATTR{remove}="1"
'';
# # Remove the whole bridge responsible for the VGA/3D controller
# ACTION=="add", SUBSYSTEM=="pci", ATTR{vendor}=="0x8086", ATTR{class}=="0x060400", ATTR{power/control}="auto", ATTR{remove}="1"
# # somehow the udev rules are not enough to prevent the nouveau driver from loading
# # Also unload remove the bus by id manually
# # unload 0000:01:00.1 and 0000:01:00.0
# # at boot echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove
# # at boot echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove
# systemd.services.remove-nouveau = {
# description = "Remove Nouveau PCI devices";
# wantedBy = [ "multi-user.target" ];
# after = [ "sysinit.target" ];
# serviceConfig = {
# Type = "oneshot";
# ExecStart = "${pkgs.coreutils}/bin/echo 1 > /sys/bus/pci/devices/0000:01:00.1/remove";
# ExecStart = "${pkgs.coreutils}/bin/echo auto > /sys/bus/pci/devices/0000:00:01.0/power/control";
# ExecStart = "${pkgs.coreutils}/bin/echo 1 > /sys/bus/pci/devices/0000:01:00.0/remove";
# ExecStart = "${pkgs.coreutils}/bin/echo auto > /sys/bus/pci/devices/0000:00:01.0/power/control";
# };
# };
boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
}
# Warning: used to have
# lib.mkdDefault

30
modules/nixos/power.nix Normal file
View File

@@ -0,0 +1,30 @@
{
config,
lib,
pkgs,
...
}:
{
services.tlp = {
enable = true;
settings = {
CPU_SCALING_GOVERNOR_ON_BAT = "powersave";
CPU_SCALING_GOVERNOR_ON_AC = "performance";
CPU_ENERGY_PERF_POLICY_ON_BAT = "power";
CPU_ENERGY_PERF_POLICY_ON_AC = "performance";
CPU_MIN_PERF_ON_AC = 0;
CPU_MAX_PERF_ON_AC = 100;
CPU_MIN_PERF_ON_BAT = 0;
CPU_MAX_PERF_ON_BAT = 50;
};
};
systemd.sleep.extraConfig = ''
AllowSuspend=yes
AllowHibernation=yes
AllowHybridSleep=yes
AllowSuspendThenHibernate=yes
'';
}

11
modules/nixos/stylix.nix Normal file
View File

@@ -0,0 +1,11 @@
{
config,
lib,
pkgs,
...
}:
{
stylix.enable = true;
stylix.image = ./../../wallpapers/magicpattern-87PP9Zd7MNo-unsplash.jpg;
}