From fcb9d76ead20fe9ff7cbed64e88672166e48d355 Mon Sep 17 00:00:00 2001 From: Yegor Timoshenko Date: Sun, 24 Dec 2017 01:20:36 +0000 Subject: [PATCH] thinkpad: use lib.mkDefault on all unmergable options --- lenovo/thinkpad/default.nix | 10 +++------- lenovo/thinkpad/t410/default.nix | 4 ++-- lenovo/thinkpad/t440p/default.nix | 4 ++-- lenovo/thinkpad/t460s/default.nix | 6 +++--- lenovo/thinkpad/x140e/default.nix | 2 +- lenovo/thinkpad/x220/default.nix | 4 ++-- 6 files changed, 13 insertions(+), 17 deletions(-) diff --git a/lenovo/thinkpad/default.nix b/lenovo/thinkpad/default.nix index e51a575..aba9596 100644 --- a/lenovo/thinkpad/default.nix +++ b/lenovo/thinkpad/default.nix @@ -1,16 +1,12 @@ { lib, pkgs, ... }: -let - inherit (lib) mkDefault; -in - { boot = { kernelModules = [ "tp_smapi" ]; extraModulePackages = with config.boot.kernelPackages; [ tp_smapi ]; }; - hardware.trackpoint.enable = mkDefault true; - services.tlp.enable = mkDefault true; - services.xserver.libinput.enable = mkDefault true; + hardware.trackpoint.enable = lib.mkDefault true; + services.tlp.enable = lib.mkDefault true; + services.xserver.libinput.enable = lib.mkDefault true; } diff --git a/lenovo/thinkpad/t410/default.nix b/lenovo/thinkpad/t410/default.nix index 3dbc4e5..b7a765d 100644 --- a/lenovo/thinkpad/t410/default.nix +++ b/lenovo/thinkpad/t410/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: { imports = [ ../. ]; @@ -28,7 +28,7 @@ ]; }; - hardware.cpu.intel.updateMicrocode = true; + hardware.cpu.intel.updateMicrocode = lib.mkDefault true; systemd.services.tune-powermanagement = { description = "Tune Powermanagement"; diff --git a/lenovo/thinkpad/t440p/default.nix b/lenovo/thinkpad/t440p/default.nix index 262638a..ddf6bd8 100644 --- a/lenovo/thinkpad/t440p/default.nix +++ b/lenovo/thinkpad/t440p/default.nix @@ -1,10 +1,10 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: { imports = [ ../. ]; boot = { - extraModprobeConfig = '' + extraModprobeConfig = lib.mkDefault '' options bbswitch use_acpi_to_detect_card_state=1 ''; kernelModules = [ "tpm-rng" ]; diff --git a/lenovo/thinkpad/t460s/default.nix b/lenovo/thinkpad/t460s/default.nix index 3e51709..039b6a4 100644 --- a/lenovo/thinkpad/t460s/default.nix +++ b/lenovo/thinkpad/t460s/default.nix @@ -1,4 +1,4 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: { imports = [ @@ -7,8 +7,8 @@ ]; # Use the gummiboot efi boot loader. (From default generated configuration.nix) - boot.loader.systemd-boot.enable = true; - boot.loader.efi.canTouchEfiVariables = true; + boot.loader.systemd-boot.enable = lib.mkDefault true; + boot.loader.efi.canTouchEfiVariables = lib.mkDefault true; # https://wiki.archlinux.org/index.php/Lenovo_ThinkPad_T460s kernelAtleast = [ diff --git a/lenovo/thinkpad/x140e/default.nix b/lenovo/thinkpad/x140e/default.nix index 38f3460..31b0bb3 100644 --- a/lenovo/thinkpad/x140e/default.nix +++ b/lenovo/thinkpad/x140e/default.nix @@ -9,7 +9,7 @@ extraModulePackages = [ config.boot.kernelPackages.broadcom_sta ]; # audio device - extraModprobeConfig = '' + extraModprobeConfig = lib.mkDefault '' options snd_hda_intel enable=0,1 ''; }; diff --git a/lenovo/thinkpad/x220/default.nix b/lenovo/thinkpad/x220/default.nix index 81fec06..285d13e 100644 --- a/lenovo/thinkpad/x220/default.nix +++ b/lenovo/thinkpad/x220/default.nix @@ -1,10 +1,10 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: { imports = [ ../. ]; # hard disk protection if the laptop falls - services.hdapsd.enable = true; + services.hdapsd.enable = lib.mkDefault true; # fingerprint reader: login and unlock with fingerprint (if you add one with `fprintd-enroll`) #services.fprintd.enable = true;