From bd92ad1747ccfb73ee38cfe349aa0a7b1db2585d Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Sun, 29 Dec 2024 21:50:37 +0100 Subject: [PATCH] nixos/services.infnoise: remove `with lib;` --- nixos/modules/services/security/infnoise.nix | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/security/infnoise.nix b/nixos/modules/services/security/infnoise.nix index 36dce8bb3e03..0a71f16d9ffa 100644 --- a/nixos/modules/services/security/infnoise.nix +++ b/nixos/modules/services/security/infnoise.nix @@ -4,38 +4,35 @@ pkgs, ... }: - -with lib; - let cfg = config.services.infnoise; in { options = { services.infnoise = { - enable = mkEnableOption "the Infinite Noise TRNG driver"; + enable = lib.mkEnableOption "the Infinite Noise TRNG driver"; - fillDevRandom = mkOption { + fillDevRandom = lib.mkOption { description = '' Whether to run the infnoise driver as a daemon to refill /dev/random. If disabled, you can use the `infnoise` command-line tool to manually obtain randomness. ''; - type = types.bool; + type = lib.types.bool; default = true; }; }; }; - config = mkIf cfg.enable { + config = lib.mkIf cfg.enable { environment.systemPackages = [ pkgs.infnoise ]; services.udev.extraRules = '' SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", SYMLINK+="infnoise", TAG+="systemd", GROUP="dialout", MODE="0664", ENV{SYSTEMD_WANTS}="infnoise.service" ''; - systemd.services.infnoise = mkIf cfg.fillDevRandom { + systemd.services.infnoise = lib.mkIf cfg.fillDevRandom { description = "Infinite Noise TRNG driver"; bindsTo = [ "dev-infnoise.device" ];