forked from DGNum/liminix
feat(jitterentropy): introduce a jitterentropy module
Signed-off-by: Raito Bezarius <masterancpp@gmail.com>
This commit is contained in:
parent
f34a63d1c8
commit
664624a478
3 changed files with 40 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
|||
./bridge
|
||||
./busybox.nix
|
||||
./dhcp6c
|
||||
./jitter-rng
|
||||
./dnsmasq
|
||||
./firewall
|
||||
./hardware.nix
|
||||
|
|
21
modules/jitter-rng/default.nix
Normal file
21
modules/jitter-rng/default.nix
Normal file
|
@ -0,0 +1,21 @@
|
|||
## CPU Jitter RNG
|
||||
## ==============
|
||||
##
|
||||
## CPU Jitter RNG is a random number generator # providing non-physical true
|
||||
## random generation # that works equally for kernel and user-land. It relies
|
||||
## on the availability of a high-resolution timer.
|
||||
{ lib, pkgs, ... }:
|
||||
let
|
||||
inherit (lib) mkOption types;
|
||||
inherit (pkgs) liminix;
|
||||
in {
|
||||
options.system.service.jitter-rng = mkOption {
|
||||
type = liminix.lib.types.serviceDefn;
|
||||
};
|
||||
|
||||
config = {
|
||||
system.service.jitter-rng = pkgs.liminix.callService ./jitter-rng.nix {
|
||||
};
|
||||
};
|
||||
}
|
||||
|
18
modules/jitter-rng/jitter-rng.nix
Normal file
18
modules/jitter-rng/jitter-rng.nix
Normal file
|
@ -0,0 +1,18 @@
|
|||
{
|
||||
liminix
|
||||
, lib
|
||||
, jitterentropy-rngd
|
||||
}:
|
||||
{ }:
|
||||
let
|
||||
inherit (liminix.services) longrun;
|
||||
name = "jitterentropy-rngd";
|
||||
in
|
||||
longrun {
|
||||
# Does it need to be unique?
|
||||
inherit name;
|
||||
run = ''
|
||||
mkdir -p /run/jitterentropy-rngd
|
||||
${jitterentropy-rngd}/bin/jitterentropy-rngd -v -p /run/jitterentropy-rngd/${name}.pid
|
||||
'';
|
||||
}
|
Loading…
Reference in a new issue