From 09e2e74d594ee9be8fe72f3e1efd5a33de1638cb Mon Sep 17 00:00:00 2001 From: chaos Date: Mon, 12 Aug 2024 16:54:39 +0100 Subject: [PATCH] format files --- modules/nixos/encryptedDriveMod/filesystems.nix | 2 +- modules/nixos/encryptedDriveMod/kernelModules.nix | 2 +- modules/nixos/encryptedDriveMod/options.nix | 14 +------------- modules/nixos/encryptedDriveMod/sshMode.nix | 10 +--------- modules/nixos/encryptedDriveMod/usbMode.nix | 3 --- presets/nixos/serverEncryptedDrive.nix | 8 +------- 6 files changed, 5 insertions(+), 34 deletions(-) diff --git a/modules/nixos/encryptedDriveMod/filesystems.nix b/modules/nixos/encryptedDriveMod/filesystems.nix index 2f03bf0..85785ee 100644 --- a/modules/nixos/encryptedDriveMod/filesystems.nix +++ b/modules/nixos/encryptedDriveMod/filesystems.nix @@ -10,7 +10,7 @@ cfg = config.boot.encryptedDrive; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { boot.initrd.luks.devices = { "${driveData.mapperName}" = { device = "${driveData.encryptedPath}"; diff --git a/modules/nixos/encryptedDriveMod/kernelModules.nix b/modules/nixos/encryptedDriveMod/kernelModules.nix index a7683a0..2af91d8 100644 --- a/modules/nixos/encryptedDriveMod/kernelModules.nix +++ b/modules/nixos/encryptedDriveMod/kernelModules.nix @@ -9,7 +9,7 @@ cfg = config.boot.encryptedDrive; in { - config = mkIf (cfg.enable) { + config = mkIf cfg.enable { boot.initrd.availableKernelModules = flatten [ diff --git a/modules/nixos/encryptedDriveMod/options.nix b/modules/nixos/encryptedDriveMod/options.nix index 4cd92da..6a84ff1 100644 --- a/modules/nixos/encryptedDriveMod/options.nix +++ b/modules/nixos/encryptedDriveMod/options.nix @@ -1,18 +1,6 @@ -{ - self, - config, - lib, - ... -}: let - inherit (lib.modules) mkIf mkBefore; +{lib, ...}: let inherit (lib.options) mkOption mkEnableOption; - inherit (lib.lists) optionals; inherit (lib) types; - - encryptedUSB = import "${self}/data/drives/encryptedUSB.nix"; - driveData = import "${self}/data/drives/encryptedDrive.nix"; - - cfg = config.boot.encryptedDrive; in { options.boot.encryptedDrive = { enable = mkEnableOption "encrypted drive support for servers and other devices"; diff --git a/modules/nixos/encryptedDriveMod/sshMode.nix b/modules/nixos/encryptedDriveMod/sshMode.nix index b7a2da8..d9cc7e3 100644 --- a/modules/nixos/encryptedDriveMod/sshMode.nix +++ b/modules/nixos/encryptedDriveMod/sshMode.nix @@ -1,17 +1,9 @@ { config, lib, - self, - tree, ... }: let - inherit (lib.modules) mkIf mkBefore mkDefault mkOverride mkForce; - inherit (lib.options) mkOption mkEnableOption; - inherit (lib.lists) optionals; - inherit (lib) types; - - encryptedUSB = import "${self}/data/drives/encryptedUSB.nix"; - driveData = import "${self}/data/drives/encryptedDrive.nix"; + inherit (lib.modules) mkIf mkForce; cfg = config.boot.encryptedDrive; in { diff --git a/modules/nixos/encryptedDriveMod/usbMode.nix b/modules/nixos/encryptedDriveMod/usbMode.nix index de1833e..017a095 100644 --- a/modules/nixos/encryptedDriveMod/usbMode.nix +++ b/modules/nixos/encryptedDriveMod/usbMode.nix @@ -5,9 +5,6 @@ ... }: let inherit (lib.modules) mkIf mkBefore; - inherit (lib.options) mkOption mkEnableOption; - inherit (lib.lists) optionals; - inherit (lib) types; encryptedUSB = import "${self}/data/drives/encryptedUSB.nix"; driveData = import "${self}/data/drives/encryptedDrive.nix"; diff --git a/presets/nixos/serverEncryptedDrive.nix b/presets/nixos/serverEncryptedDrive.nix index 358e5b8..70beae0 100644 --- a/presets/nixos/serverEncryptedDrive.nix +++ b/presets/nixos/serverEncryptedDrive.nix @@ -1,10 +1,4 @@ -{ - self, - tree, - ... -}: let - driveData = import "${self}/data/drives/encryptedDrive.nix"; -in { +{tree, ...}: { imports = with tree; [ profiles.nixos.sshd ];