nixos/xmrig: add kernel module msr

This commit is contained in:
Victor Freire 2021-11-17 16:08:38 -03:00
parent 80e6ae766a
commit 47f638403e

View file

@ -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;
};
};
};