1 { lib, config, pkgs, ... }:
4 cfg = config.services.esdm;
8 # removed option 'services.esdm.cuseRandomEnable'
9 (lib.mkRemovedOptionModule [ "services" "esdm" "cuseRandomEnable" ] ''
10 Use services.esdm.enableLinuxCompatServices instead.
12 # removed option 'services.esdm.cuseUrandomEnable'
13 (lib.mkRemovedOptionModule [ "services" "esdm" "cuseUrandomEnable" ] ''
14 Use services.esdm.enableLinuxCompatServices instead.
16 # removed option 'services.esdm.procEnable'
17 (lib.mkRemovedOptionModule [ "services" "esdm" "procEnable" ] ''
18 Use services.esdm.enableLinuxCompatServices instead.
20 # removed option 'services.esdm.verbose'
21 (lib.mkRemovedOptionModule [ "services" "esdm" "verbose" ] ''
22 There is no replacement.
26 options.services.esdm = {
27 enable = lib.mkEnableOption "ESDM service configuration";
28 package = lib.mkPackageOption pkgs "esdm" { };
29 enableLinuxCompatServices = lib.mkOption {
30 type = lib.types.bool;
33 Enable /dev/random, /dev/urandom and /proc/sys/kernel/random/* userspace wrapper.
38 config = lib.mkIf cfg.enable (
41 systemd.packages = [ cfg.package ];
42 systemd.services."esdm-server".wantedBy = [ "basic.target" ];
44 # It is necessary to set those options for these services to be started by systemd in NixOS
45 (lib.mkIf cfg.enableLinuxCompatServices {
46 systemd.targets."esdm-linux-compat".wantedBy = [ "basic.target" ];
47 systemd.services."esdm-server-suspend".wantedBy = [ "sleep.target" "suspend.target" "hibernate.target" ];
48 systemd.services."esdm-server-resume".wantedBy = [ "sleep.target" "suspend.target" "hibernate.target" ];
52 meta.maintainers = with lib.maintainers; [ orichter thillux ];