chore: format repo using treefmt-nix and nixfmt-rfc-style

This commit is contained in:
Andre 2025-06-04 12:11:03 -04:00
parent fc7c471412
commit 51e51e6014
266 changed files with 3721 additions and 2733 deletions

View file

@ -1,6 +1,5 @@
{ config, lib, ... }:
{
hardware.cpu.amd.updateMicrocode =
lib.mkDefault config.hardware.enableRedistributableFirmware;
hardware.cpu.amd.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View file

@ -8,23 +8,13 @@ in
imports = [ ./. ];
boot = lib.mkMerge [
(lib.mkIf
(
(lib.versionAtLeast kver "5.17")
&& (lib.versionOlder kver "6.1")
)
{
kernelParams = [ "initcall_blacklist=acpi_cpufreq_init" ];
kernelModules = [ "amd-pstate" ];
})
(lib.mkIf
(
(lib.versionAtLeast kver "6.1")
&& (lib.versionOlder kver "6.3")
)
{
kernelParams = [ "amd_pstate=passive" ];
})
(lib.mkIf ((lib.versionAtLeast kver "5.17") && (lib.versionOlder kver "6.1")) {
kernelParams = [ "initcall_blacklist=acpi_cpufreq_init" ];
kernelModules = [ "amd-pstate" ];
})
(lib.mkIf ((lib.versionAtLeast kver "6.1") && (lib.versionOlder kver "6.3")) {
kernelParams = [ "amd_pstate=passive" ];
})
(lib.mkIf (lib.versionAtLeast kver "6.3") {
kernelParams = [ "amd_pstate=active" ];
})

View file

@ -6,9 +6,18 @@
# Backward-compat for 24.05, can be removed after we drop 24.05 support
imports = lib.optionals (lib.versionOlder lib.version "24.11pre") [
(lib.mkAliasOptionModule [ "hardware" "graphics" "enable" ] [ "hardware" "opengl" "enable" ])
(lib.mkAliasOptionModule [ "hardware" "graphics" "extraPackages" ] [ "hardware" "opengl" "extraPackages" ])
(lib.mkAliasOptionModule [ "hardware" "graphics" "extraPackages32" ] [ "hardware" "opengl" "extraPackages32" ])
(lib.mkAliasOptionModule [ "hardware" "graphics" "enable32Bit" ] [ "hardware" "opengl" "driSupport32Bit" ])
(lib.mkAliasOptionModule
[ "hardware" "graphics" "extraPackages" ]
[ "hardware" "opengl" "extraPackages" ]
)
(lib.mkAliasOptionModule
[ "hardware" "graphics" "extraPackages32" ]
[ "hardware" "opengl" "extraPackages32" ]
)
(lib.mkAliasOptionModule
[ "hardware" "graphics" "enable32Bit" ]
[ "hardware" "opengl" "driSupport32Bit" ]
)
(lib.mkAliasOptionModule [ "hardware" "graphics" "package" ] [ "hardware" "opengl" "package" ])
(lib.mkAliasOptionModule [ "hardware" "graphics" "package32" ] [ "hardware" "opengl" "package32" ])
];

View file

@ -1,5 +1,8 @@
{
imports = [ ../. ];
# Explicitly set amdgpu support in place of radeon
boot.kernelParams = [ "radeon.cik_support=0" "amdgpu.cik_support=1" ];
boot.kernelParams = [
"radeon.cik_support=0"
"amdgpu.cik_support=1"
];
}

View file

@ -1,5 +1,8 @@
{
imports = [ ../. ];
# Explicitly set amdgpu support in place of radeon
boot.kernelParams = [ "radeon.si_support=0" "amdgpu.si_support=1" ];
boot.kernelParams = [
"radeon.si_support=0"
"amdgpu.si_support=1"
];
}

View file

@ -45,11 +45,15 @@
intel-vaapi-driver = (pkgs.intel-vaapi-driver or pkgs.vaapiIntel).override {
enableHybridCodec = cfg.enableHybridCodec;
};
intel-vaapi-driver-32 = (pkgs.driversi686Linux.intel-vaapi-driver or pkgs.driversi686Linux.vaapiIntel).override {
enableHybridCodec = cfg.enableHybridCodec;
};
intel-vaapi-driver-32 =
(pkgs.driversi686Linux.intel-vaapi-driver or pkgs.driversi686Linux.vaapiIntel).override
{
enableHybridCodec = cfg.enableHybridCodec;
};
useIntelOcl = useIntelVaapiDriver && (config.hardware.enableAllFirmware or config.nixpkgs.config.allowUnfree or false);
useIntelOcl =
useIntelVaapiDriver
&& (config.hardware.enableAllFirmware or config.nixpkgs.config.allowUnfree or false);
intel-ocl = pkgs.intel-ocl;
useIntelMediaDriver = cfg.vaapiDriver == "intel-media-driver" || cfg.vaapiDriver == null;

View file

@ -1,4 +1,4 @@
{lib, config, ...}:
{ lib, config, ... }:
let
nvidiaPackage = config.hardware.nvidia.package;
in

View file

@ -1,4 +1,4 @@
{lib, config, ...}:
{ lib, config, ... }:
let
nvidiaPackage = config.hardware.nvidia.package;
in

View file

@ -8,7 +8,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"
@ -22,5 +22,10 @@
# 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"
'';
boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_drm" "nvidia_modeset" ];
boot.blacklistedKernelModules = [
"nouveau"
"nvidia"
"nvidia_drm"
"nvidia_modeset"
];
}

View file

@ -1,4 +1,4 @@
{lib, ...}:
{ lib, ... }:
{
imports = [ ../. ];

View file

@ -1,4 +1,4 @@
{lib, ...}:
{ lib, ... }:
{
imports = [ ../. ];

View file

@ -1,4 +1,4 @@
{lib, ...}:
{ lib, ... }:
{
imports = [ ../. ];

View file

@ -19,7 +19,7 @@
specialisation = lib.mkIf config.hardware.nvidia.primeBatterySaverSpecialisation {
battery-saver.configuration = {
system.nixos.tags = ["battery-saver"];
system.nixos.tags = [ "battery-saver" ];
imports = [
# Leave only the integrated GPU enabled
./disable.nix
@ -28,7 +28,7 @@
prime.offload.enable = lib.mkForce false;
powerManagement = {
enable = lib.mkForce false;
finegrained = lib.mkForce false;
finegrained = lib.mkForce false;
};
};
};

View file

@ -1,4 +1,4 @@
{lib, config, ...}:
{ lib, config, ... }:
let
nvidiaPackage = config.hardware.nvidia.package;
in

View file

@ -6,6 +6,8 @@
# Gnome 40 introduced a new way of managing power, without tlp.
# However, these 2 services clash when enabled simultaneously.
# https://github.com/NixOS/nixos-hardware/issues/260
services.tlp.enable = lib.mkDefault ((lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|| !config.services.power-profiles-daemon.enable);
services.tlp.enable = lib.mkDefault (
(lib.versionOlder (lib.versions.majorMinor lib.version) "21.05")
|| !config.services.power-profiles-daemon.enable
);
}