Merge pull request #146422 from ratsclub/service-xmrig

nixos/xmrig: add kernel module msr
This commit is contained in:
Thiago Kenji Okada 2021-11-17 20:08:55 -03:00 committed by GitHub
commit 467c58cd11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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