diff --git a/nixos/modules/services/hardware/freefall.nix b/nixos/modules/services/hardware/freefall.nix index 4ac7c54d4d8a..fe017bb17f7e 100644 --- a/nixos/modules/services/hardware/freefall.nix +++ b/nixos/modules/services/hardware/freefall.nix @@ -1,7 +1,4 @@ { config, lib, pkgs, utils, ... }: - -with lib; - let cfg = config.services.freefall; @@ -10,18 +7,18 @@ in { options.services.freefall = { - enable = mkOption { - type = types.bool; + enable = lib.mkOption { + type = lib.types.bool; default = false; description = '' Whether to protect HP/Dell laptop hard drives (not SSDs) in free fall. ''; }; - package = mkPackageOption pkgs "freefall" { }; + package = lib.mkPackageOption pkgs "freefall" { }; - devices = mkOption { - type = types.listOf types.str; + devices = lib.mkOption { + type = lib.types.listOf lib.types.str; default = [ "/dev/sda" ]; description = '' Device paths to all internal spinning hard drives. @@ -35,7 +32,7 @@ in { mkService = dev: assert dev != ""; let dev' = utils.escapeSystemdPath dev; in - nameValuePair "freefall-${dev'}" { + lib.nameValuePair "freefall-${dev'}" { description = "Free-fall protection for ${dev}"; after = [ "${dev'}.device" ]; wantedBy = [ "${dev'}.device" ]; @@ -46,7 +43,7 @@ in { }; }; - in mkIf cfg.enable { + in lib.mkIf cfg.enable { environment.systemPackages = [ cfg.package ];