···8383 VirtualBox settings (Machine / Settings / Shared Folders, then click on the8484 "Add" icon). Add the following to the8585 <literal>/etc/nixos/configuration.nix</literal> to auto-mount them. If you do8686- not add <literal>"nofail"</literal>, the system will not boot properly. The8787- same goes for disabling <literal>rngd</literal> which is normally used to get8888- randomness but this does not work in virtual machines.8686+ not add <literal>"nofail"</literal>, the system will not boot properly.8987 </para>90889189<programlisting>9290{ config, pkgs, ...} :9391{9494- security.rngd.enable = false; // otherwise vm will not boot9595- ...9696-9792 fileSystems."/virtualboxshare" = {9893 fsType = "vboxsf";9994 device = "nameofthesharedfolder";
+9
nixos/doc/manual/release-notes/rl-2105.xml
···509509 <varname>services.flashpolicyd</varname> module.510510 </para>511511 </listitem>512512+ <listitem>513513+ <para>514514+ The <literal>security.rngd</literal> module has been removed.515515+ It was disabled by default in 20.09 as it was functionally redundant516516+ with krngd in the linux kernel. It is not necessary for any device that the kernel recognises517517+ as an hardware RNG, as it will automatically run the krngd task to periodically collect random518518+ data from the device and mix it into the kernel's RNG.519519+ </para>520520+ </listitem>512521 </itemizedlist>513522 </section>514523
-2
nixos/modules/config/swap.nix
···185185 { description = "Initialisation of swap device ${sw.device}";186186 wantedBy = [ "${realDevice'}.swap" ];187187 before = [ "${realDevice'}.swap" ];188188- # If swap is encrypted, depending on rngd resolves a possible entropy starvation during boot189189- after = mkIf (config.security.rngd.enable && sw.randomEncryption.enable) [ "rngd.service" ];190188 path = [ pkgs.util-linux ] ++ optional sw.randomEncryption.enable pkgs.cryptsetup;191189192190 script =
+12-52
nixos/modules/security/rngd.nix
···11-{ config, lib, pkgs, ... }:22-33-with lib;44-11+{ lib, ... }:52let66- cfg = config.security.rngd;33+ removed = k: lib.mkRemovedOptionModule [ "security" "rngd" k ];74in85{99- options = {1010- security.rngd = {1111- enable = mkOption {1212- type = types.bool;1313- default = false;1414- description = ''1515- Whether to enable the rng daemon. Devices that the kernel recognises1616- as entropy sources are handled automatically by krngd.1717- '';1818- };1919- debug = mkOption {2020- type = types.bool;2121- default = false;2222- description = "Whether to enable debug output (-d).";2323- };2424- };2525- };2626-2727- config = mkIf cfg.enable {2828- systemd.services.rngd = {2929- bindsTo = [ "dev-random.device" ];3030-3131- after = [ "dev-random.device" ];3232-3333- # Clean shutdown without DefaultDependencies3434- conflicts = [ "shutdown.target" ];3535- before = [3636- "sysinit.target"3737- "shutdown.target"3838- ];3939-4040- description = "Hardware RNG Entropy Gatherer Daemon";4141-4242- # rngd may have to start early to avoid entropy starvation during boot with encrypted swap4343- unitConfig.DefaultDependencies = false;4444- serviceConfig = {4545- ExecStart = "${pkgs.rng-tools}/sbin/rngd -f"4646- + optionalString cfg.debug " -d";4747- # PrivateTmp would introduce a circular dependency if /tmp is on tmpfs and swap is encrypted,4848- # thus depending on rngd before swap, while swap depends on rngd to avoid entropy starvation.4949- NoNewPrivileges = true;5050- PrivateNetwork = true;5151- ProtectSystem = "full";5252- ProtectHome = true;5353- };5454- };5555- };66+ imports = [77+ (removed "enable" ''88+ rngd is not necessary for any device that the kernel recognises99+ as an hardware RNG, as it will automatically run the krngd task1010+ to periodically collect random data from the device and mix it1111+ into the kernel's RNG.1212+ '')1313+ (removed "debug"1414+ "The rngd module was removed, so its debug option does nothing.")1515+ ];5616}