tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
nixos/services.infnoise: remove `with lib;`
Felix Buehler
1 year ago
bd92ad17
3bb7989e
+5
-8
1 changed file
expand all
collapse all
unified
split
nixos
modules
services
security
infnoise.nix
+5
-8
nixos/modules/services/security/infnoise.nix
···
4
4
pkgs,
5
5
...
6
6
}:
7
7
-
8
8
-
with lib;
9
9
-
10
7
let
11
8
cfg = config.services.infnoise;
12
9
in
13
10
{
14
11
options = {
15
12
services.infnoise = {
16
16
-
enable = mkEnableOption "the Infinite Noise TRNG driver";
13
13
+
enable = lib.mkEnableOption "the Infinite Noise TRNG driver";
17
14
18
18
-
fillDevRandom = mkOption {
15
15
+
fillDevRandom = lib.mkOption {
19
16
description = ''
20
17
Whether to run the infnoise driver as a daemon to refill /dev/random.
21
18
22
19
If disabled, you can use the `infnoise` command-line tool to
23
20
manually obtain randomness.
24
21
'';
25
25
-
type = types.bool;
22
22
+
type = lib.types.bool;
26
23
default = true;
27
24
};
28
25
};
29
26
};
30
27
31
31
-
config = mkIf cfg.enable {
28
28
+
config = lib.mkIf cfg.enable {
32
29
environment.systemPackages = [ pkgs.infnoise ];
33
30
34
31
services.udev.extraRules = ''
35
32
SUBSYSTEM=="usb", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6015", SYMLINK+="infnoise", TAG+="systemd", GROUP="dialout", MODE="0664", ENV{SYSTEMD_WANTS}="infnoise.service"
36
33
'';
37
34
38
38
-
systemd.services.infnoise = mkIf cfg.fillDevRandom {
35
35
+
systemd.services.infnoise = lib.mkIf cfg.fillDevRandom {
39
36
description = "Infinite Noise TRNG driver";
40
37
41
38
bindsTo = [ "dev-infnoise.device" ];