summaryrefslogtreecommitdiff
path: root/modules/nixos/personal/hardware.nix
diff options
context:
space:
mode:
authoraristote <quentin.aristote@irif.fr>2025-07-29 15:25:11 +0200
committeraristote <quentin.aristote@irif.fr>2025-07-29 15:25:11 +0200
commitfc019d789523ce5f89436b8dbc458cf3b79abf43 (patch)
treeec56fd1b1ed9fc75096c0b09db48a152975e4d53 /modules/nixos/personal/hardware.nix
parenta3d19bc509d9f39fb41256cd55d2bd7706de202f (diff)
reformat everything with nixfmt
Diffstat (limited to 'modules/nixos/personal/hardware.nix')
-rw-r--r--modules/nixos/personal/hardware.nix44
1 files changed, 25 insertions, 19 deletions
diff --git a/modules/nixos/personal/hardware.nix b/modules/nixos/personal/hardware.nix
index 6f1183d..dfab964 100644
--- a/modules/nixos/personal/hardware.nix
+++ b/modules/nixos/personal/hardware.nix
@@ -3,9 +3,11 @@
lib,
pkgs,
...
-}: let
+}:
+let
cfg = config.personal.hardware;
-in {
+in
+{
options.personal.hardware = {
usb.enable = lib.mkEnableOption "usb";
disks.crypted = lib.mkOption {
@@ -20,24 +22,26 @@ in {
default = "fr";
};
};
- backlights = let
- mkBacklightOption = name:
- lib.mkOption {
- type = with lib.types; nullOr str;
- default = null;
- description = "Whether to allow all users to change hardware the ${name} brightness.";
- };
- in {
- screen = mkBacklightOption "screen";
- keyboard = mkBacklightOption "keyboard";
- };
+ backlights =
+ let
+ mkBacklightOption =
+ name:
+ lib.mkOption {
+ type = with lib.types; nullOr str;
+ default = null;
+ description = "Whether to allow all users to change hardware the ${name} brightness.";
+ };
+ in
+ {
+ screen = mkBacklightOption "screen";
+ keyboard = mkBacklightOption "keyboard";
+ };
sound.enable = lib.mkEnableOption "sound";
};
config = lib.mkMerge [
{
- hardware.firmware =
- lib.optional cfg.firmwareNonFree.enable pkgs.firmwareLinuxNonfree;
+ hardware.firmware = lib.optional cfg.firmwareNonFree.enable pkgs.firmwareLinuxNonfree;
boot.initrd.availableKernelModules = lib.optional cfg.usb.enable "usb_storage";
services.udev.extraRules =
@@ -49,15 +53,17 @@ in {
'';
}
- (let
- crypt = cfg.disks.crypted;
- in
+ (
+ let
+ crypt = cfg.disks.crypted;
+ in
lib.mkIf (crypt != null) {
boot.initrd.luks.devices.crypt = {
device = crypt;
preLVM = true;
};
- })
+ }
+ )
(lib.mkIf cfg.sound.enable {
security.rtkit.enable = true;