diff --git a/nixos/modules/services/misc/xmrig.nix b/nixos/modules/services/misc/xmrig.nix index 4f0af8ca9f4e..cf01bb119e89 100644 --- a/nixos/modules/services/misc/xmrig.nix +++ b/nixos/modules/services/misc/xmrig.nix @@ -51,6 +51,8 @@ with lib; }; config = mkIf cfg.enable { + boot.kernelModules = [ "msr" ]; + systemd.services.xmrig = { wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; @@ -58,7 +60,11 @@ with lib; serviceConfig = { ExecStartPre = "${cfg.package}/bin/xmrig --config=${configFile} --dry-run"; ExecStart = "${cfg.package}/bin/xmrig --config=${configFile}"; - DynamicUser = true; + # https://xmrig.com/docs/miner/randomx-optimization-guide/msr + # If you use recent XMRig with root privileges (Linux) or admin + # privileges (Windows) the miner configure all MSR registers + # automatically. + DynamicUser = lib.mkDefault false; }; }; };