summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2021-12-05 20:40:24 +0100
committerpennae <github@quasiparticle.net>2021-12-09 01:12:13 +0100
commite24a8775a86905ad001c4c965a7d180b41c10c52 (patch)
tree62da74c469bec798898d88029919f2bbd9f01442 /nixos/modules/hardware
parent70b105d1d062369c7489b0045df5a8b86bac5dd6 (diff)
downloadnixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar
nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.gz
nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.bz2
nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.lz
nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.xz
nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.tar.zst
nixpkgs-e24a8775a86905ad001c4c965a7d180b41c10c52.zip
treewide: set defaultText for options using simple path defaults
adds defaultText for all options that set their default to a path expression
using the ubiquitous `cfg` shortcut bindings.
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r--nixos/modules/hardware/system-76.nix8
1 files changed, 6 insertions, 2 deletions
diff --git a/nixos/modules/hardware/system-76.nix b/nixos/modules/hardware/system-76.nix
index d4896541dba..ca40ee0ebb3 100644
--- a/nixos/modules/hardware/system-76.nix
+++ b/nixos/modules/hardware/system-76.nix
@@ -1,8 +1,9 @@
-{ config, lib, pkgs, ... }:
+{ config, lib, options, pkgs, ... }:
 
 let
-  inherit (lib) mkOption mkEnableOption types mkIf mkMerge optional versionOlder;
+  inherit (lib) literalExpression mkOption mkEnableOption types mkIf mkMerge optional versionOlder;
   cfg = config.hardware.system76;
+  opt = options.hardware.system76;
 
   kpkgs = config.boot.kernelPackages;
   modules = [ "system76" "system76-io" ] ++ (optional (versionOlder kpkgs.kernel.version "5.5") "system76-acpi");
@@ -60,6 +61,7 @@ in {
 
       firmware-daemon.enable = mkOption {
         default = cfg.enableAll;
+        defaultText = literalExpression "config.${opt.enableAll}";
         example = true;
         description = "Whether to enable the system76 firmware daemon";
         type = types.bool;
@@ -67,6 +69,7 @@ in {
 
       kernel-modules.enable = mkOption {
         default = cfg.enableAll;
+        defaultText = literalExpression "config.${opt.enableAll}";
         example = true;
         description = "Whether to make the system76 out-of-tree kernel modules available";
         type = types.bool;
@@ -74,6 +77,7 @@ in {
 
       power-daemon.enable = mkOption {
         default = cfg.enableAll;
+        defaultText = literalExpression "config.${opt.enableAll}";
         example = true;
         description = "Whether to enable the system76 power daemon";
         type = types.bool;