chore: format using nixpkgs-fmt

This commit is contained in:
Veneficium 2024-07-03 23:20:22 +02:00
parent 8b0286d8d8
commit 87781f976a
26 changed files with 130 additions and 127 deletions

View file

@ -1,11 +1,11 @@
{ lib, config, ... }: {
options = {
settings.drivers.gpu.amd.enable = lib.mkEnableOption "enable AMD gpu drivers";
};
options = {
settings.drivers.gpu.amd.enable = lib.mkEnableOption "enable AMD gpu drivers";
};
config = lib.mkIf config.settings.drivers.gpu.amd.enable {
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" ];
};
config = lib.mkIf config.settings.drivers.gpu.amd.enable {
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" ];
};
}

View file

@ -1,24 +1,24 @@
{ lib, config, ... }: {
options = {
settings.drivers.gpu.nvidia.forceDisable = lib.mkEnableOption "force disable all nvidia drivers";
};
options = {
settings.drivers.gpu.nvidia.forceDisable = lib.mkEnableOption "force disable all nvidia drivers";
};
config = lib.mkIf config.settings.drivers.gpu.nvidia.forceDisable {
boot.extraModprobeConfig = ''
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"
# 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"
'';
boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_uvm" "nvidiafb" "nvidia_drm" "nvidia_modeset" ];
};
config = lib.mkIf config.settings.drivers.gpu.nvidia.forceDisable {
boot.extraModprobeConfig = ''
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"
# 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"
'';
boot.blacklistedKernelModules = [ "nouveau" "nvidia" "nvidia_uvm" "nvidiafb" "nvidia_drm" "nvidia_modeset" ];
};
}

View file

@ -1,25 +1,25 @@
{ lib, config, ... }: {
options = {
settings.drivers.gpu.nvidia.enable = lib.mkEnableOption "Enable Nvidia proprietary drivers";
settings.drivers.gpu.nvidia.offload = lib.mkEnableOption "Enable prime offloading";
settings.drivers.gpu.nvidia.sync = lib.mkEnableOption "Enable prime sync";
};
options = {
settings.drivers.gpu.nvidia.enable = lib.mkEnableOption "Enable Nvidia proprietary drivers";
settings.drivers.gpu.nvidia.offload = lib.mkEnableOption "Enable prime offloading";
settings.drivers.gpu.nvidia.sync = lib.mkEnableOption "Enable prime sync";
};
config = lib.mkIf config.settings.drivers.gpu.nvidia.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
prime = {
nvidiaBusId = "pci:1:0:0";
amdgpuBusId = "pci:5:0:0";
};
prime.offload = lib.mkIf config.settings.drivers.gpu.nvidia.offload {
enable = true;
enableOffloadCmd = true;
};
prime.sync.enable = lib.mkIf config.settings.drivers.gpu.nvidia.sync true;
nvidiaSettings = true;
};
config = lib.mkIf config.settings.drivers.gpu.nvidia.enable {
services.xserver.videoDrivers = [ "nvidia" ];
hardware.nvidia = {
modesetting.enable = true;
prime = {
nvidiaBusId = "pci:1:0:0";
amdgpuBusId = "pci:5:0:0";
};
prime.offload = lib.mkIf config.settings.drivers.gpu.nvidia.offload {
enable = true;
enableOffloadCmd = true;
};
prime.sync.enable = lib.mkIf config.settings.drivers.gpu.nvidia.sync true;
nvidiaSettings = true;
};
}
};
}

View file

@ -11,5 +11,5 @@
libimobiledevice
];
};
}

View file

@ -5,6 +5,6 @@
};
config = lib.mkIf config.settings.drivers.printer.M2020.enable {
services.printing.drivers = [ pkgs.samsung-unified-linux-driver_1_00_37 ];
services.printing.drivers = [ pkgs.samsung-unified-linux-driver_1_00_37 ];
};
}
}

View file

@ -6,4 +6,4 @@
config = lib.mkIf config.settings.programs.docker.enable {
virtualisation.docker.enable = true;
};
}
}

View file

@ -6,4 +6,4 @@
config = lib.mkIf config.settings.programs.powertop.enable {
powerManagement.powertop.enable = true;
};
}
}

View file

@ -6,4 +6,4 @@
config = lib.mkIf config.settings.programs.tailscale.enable {
services.tailscale.enable = true;
};
}
}

View file

@ -6,4 +6,4 @@
config = lib.mkIf config.settings.services.fstrim.enable {
services.fstrim.enable = true;
};
}
}

View file

@ -1,26 +1,26 @@
{ config, lib, pkgs, ... }: {
options = {
settings.gnome.enable = lib.mkEnableOption "enable gnome de";
};
options = {
settings.gnome.enable = lib.mkEnableOption "enable gnome de";
};
#todo make this more configurable
config = lib.mkIf config.settings.gnome.enable {
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
#todo make this more configurable
config = lib.mkIf config.settings.gnome.enable {
services.xserver = {
enable = true;
displayManager.gdm.enable = true;
desktopManager.gnome.enable = true;
};
environment.systemPackages = [ pkgs.gnome.gnome-tweaks ];
environment.systemPackages = [ pkgs.gnome.gnome-tweaks ];
#enable browser connector for installing extensions
services.gnome.gnome-browser-connector.enable = true;
#enable browser connector for installing extensions
services.gnome.gnome-browser-connector.enable = true;
# Gnome enables pulse by default smh
# make sure to have PIPEWIRE enabled!
hardware.pulseaudio.enable = false;
# Gnome enables pulse by default smh
# make sure to have PIPEWIRE enabled!
hardware.pulseaudio.enable = false;
# remove various bloat
environment.gnome.excludePackages = with pkgs.gnome; [ epiphany gnome-contacts gnome-maps gnome-music gnome-weather totem yelp pkgs.gnome-tour ];
};
}
# remove various bloat
environment.gnome.excludePackages = with pkgs.gnome; [ epiphany gnome-contacts gnome-maps gnome-music gnome-weather totem yelp pkgs.gnome-tour ];
};
}

View file

@ -21,4 +21,4 @@
layout = "it";
variant = "";
};
}
}

View file

@ -17,4 +17,4 @@
jack.enable = true;
};
};
}
}

View file

@ -6,4 +6,4 @@
config = lib.mkIf config.settings.services.switcheroo.enable {
services.switcherooControl.enable = true;
};
}
}

View file

@ -6,4 +6,4 @@
config = lib.mkIf config.settings.services.tlp.enable {
services.tlp.enable = true;
};
}
}