mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-15 10:12:58 +00:00
36f1c0c2b3
ESDM 1.0.1 fixed bugs related to Linux compatibility layer with CUSE. During these fixes, the compatibility layer was simplified behind a target in order to start the necessary services together or none of them (services.esdm.linuxCompatServices). Furthermore, a small helper was added to ESDM 1.0.1 in order to deal with resume/suspend/hibernate (FUSE needs to be unblocked). Removed options are marked. Signed-off-by: Markus Theil <theil.markus@gmail.com>
54 lines
1.9 KiB
Nix
54 lines
1.9 KiB
Nix
{ lib, config, pkgs, ... }:
|
|
|
|
let
|
|
cfg = config.services.esdm;
|
|
in
|
|
{
|
|
imports = [
|
|
# removed option 'services.esdm.cuseRandomEnable'
|
|
(lib.mkRemovedOptionModule [ "services" "esdm" "cuseRandomEnable" ] ''
|
|
Use services.esdm.enableLinuxCompatServices instead.
|
|
'')
|
|
# removed option 'services.esdm.cuseUrandomEnable'
|
|
(lib.mkRemovedOptionModule [ "services" "esdm" "cuseUrandomEnable" ] ''
|
|
Use services.esdm.enableLinuxCompatServices instead.
|
|
'')
|
|
# removed option 'services.esdm.procEnable'
|
|
(lib.mkRemovedOptionModule [ "services" "esdm" "procEnable" ] ''
|
|
Use services.esdm.enableLinuxCompatServices instead.
|
|
'')
|
|
# removed option 'services.esdm.verbose'
|
|
(lib.mkRemovedOptionModule [ "services" "esdm" "verbose" ] ''
|
|
There is no replacement.
|
|
'')
|
|
];
|
|
|
|
options.services.esdm = {
|
|
enable = lib.mkEnableOption (lib.mdDoc "ESDM service configuration");
|
|
package = lib.mkPackageOption pkgs "esdm" { };
|
|
enableLinuxCompatServices = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = lib.mdDoc ''
|
|
Enable /dev/random, /dev/urandom and /proc/sys/kernel/random/* userspace wrapper.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable (
|
|
lib.mkMerge [
|
|
({
|
|
systemd.packages = [ cfg.package ];
|
|
systemd.services."esdm-server".wantedBy = [ "basic.target" ];
|
|
})
|
|
# It is necessary to set those options for these services to be started by systemd in NixOS
|
|
(lib.mkIf cfg.enableLinuxCompatServices {
|
|
systemd.targets."esdm-linux-compat".wantedBy = [ "basic.target" ];
|
|
systemd.services."esdm-server-suspend".wantedBy = [ "sleep.target" "suspend.target" "hibernate.target" ];
|
|
systemd.services."esdm-server-resume".wantedBy = [ "sleep.target" "suspend.target" "hibernate.target" ];
|
|
})
|
|
]);
|
|
|
|
meta.maintainers = with lib.maintainers; [ orichter thillux ];
|
|
}
|