2014-05-05 19:58:51 +01:00
|
|
|
{lib, config, ...}:
|
2012-02-06 19:14:37 +00:00
|
|
|
|
|
|
|
let kernel = config.boot.kernelPackages;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
###### interface
|
|
|
|
|
|
|
|
options = {
|
|
|
|
|
2014-05-05 19:58:51 +01:00
|
|
|
services.frandom.enable = lib.mkOption {
|
2012-02-06 19:14:37 +00:00
|
|
|
default = false;
|
2014-05-05 19:58:51 +01:00
|
|
|
type = lib.types.bool;
|
2012-02-06 19:14:37 +00:00
|
|
|
description = ''
|
|
|
|
enable the /dev/frandom device (a very fast random number generator)
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
2014-05-05 19:58:51 +01:00
|
|
|
config = lib.mkIf config.services.frandom.enable {
|
2012-02-06 19:14:37 +00:00
|
|
|
boot.kernelModules = [ "frandom" ];
|
|
|
|
boot.extraModulePackages = [ kernel.frandom ];
|
|
|
|
services.udev.packages = [ kernel.frandom ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|