From 97d41bd9af02f6ba950a844118a620208cef8605 Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sat, 24 Aug 2024 22:05:31 +0200 Subject: [PATCH] nixos/hardware.bumblebee: remove `with lib;` --- nixos/modules/hardware/video/bumblebee.nix | 28 ++++++++++------------ 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/nixos/modules/hardware/video/bumblebee.nix b/nixos/modules/hardware/video/bumblebee.nix index b6af4f80445a..b5339f0dda53 100644 --- a/nixos/modules/hardware/video/bumblebee.nix +++ b/nixos/modules/hardware/video/bumblebee.nix @@ -1,6 +1,4 @@ { config, lib, pkgs, ... }: - -with lib; let cfg = config.hardware.bumblebee; @@ -26,9 +24,9 @@ in options = { hardware.bumblebee = { - enable = mkOption { + enable = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Enable the bumblebee daemon to manage Optimus hybrid video cards. This should power off secondary GPU until its use is requested @@ -36,16 +34,16 @@ in ''; }; - group = mkOption { + group = lib.mkOption { default = "wheel"; example = "video"; - type = types.str; + type = lib.types.str; description = "Group for bumblebee socket"; }; - connectDisplay = mkOption { + connectDisplay = lib.mkOption { default = false; - type = types.bool; + type = lib.types.bool; description = '' Set to true if you intend to connect your discrete card to a monitor. This option will set up your Nvidia card for EDID @@ -55,17 +53,17 @@ in ''; }; - driver = mkOption { + driver = lib.mkOption { default = "nvidia"; - type = types.enum [ "nvidia" "nouveau" ]; + type = lib.types.enum [ "nvidia" "nouveau" ]; description = '' Set driver used by bumblebeed. Supported are nouveau and nvidia. ''; }; - pmMethod = mkOption { + pmMethod = lib.mkOption { default = "auto"; - type = types.enum [ "auto" "bbswitch" "switcheroo" "none" ]; + type = lib.types.enum [ "auto" "bbswitch" "switcheroo" "none" ]; description = '' Set preferred power management method for unused card. ''; @@ -74,10 +72,10 @@ in }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { boot.blacklistedKernelModules = [ "nvidia-drm" "nvidia" "nouveau" ]; - boot.kernelModules = optional useBbswitch "bbswitch"; - boot.extraModulePackages = optional useBbswitch kernel.bbswitch ++ optional useNvidia kernel.nvidia_x11.bin; + boot.kernelModules = lib.optional useBbswitch "bbswitch"; + boot.extraModulePackages = lib.optional useBbswitch kernel.bbswitch ++ lib.optional useNvidia kernel.nvidia_x11.bin; environment.systemPackages = [ bumblebee primus ];