mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 07:13:23 +01:00
Merge pull request #146422 from ratsclub/service-xmrig
nixos/xmrig: add kernel module msr
This commit is contained in:
commit
467c58cd11
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue