summary refs log tree commit diff
path: root/nixos/modules/services/security/frandom.nix
blob: 2d43d12e541db8cacf74d6fc2dd3c1a3164e4115 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{lib, config, ...}:

let kernel = config.boot.kernelPackages;
in

{

  ###### interface

  options = {

    services.frandom.enable = lib.mkOption {
      default = false;
      type = lib.types.bool;
      description = ''
        enable the /dev/frandom device (a very fast random number generator)
      '';
    };

  };


  ###### implementation

  config = lib.mkIf config.services.frandom.enable {
    boot.kernelModules = [ "frandom" ];
    boot.extraModulePackages = [ kernel.frandom ];
    services.udev.packages = [ kernel.frandom ];
  };

}