nixos-config/nixos/configs/workhorse/mining.nix

53 lines
1.1 KiB
Nix
Raw Normal View History

2021-05-02 05:11:07 +02:00
{ pkgs, config, ... }:
let
maxPower = 90;
pool = "eu1.ethermine.org";
toolkit = "opencl";
wallet = "";
rig = config.networking.hostName;
recheckInterval = 2000;
package = pkgs.ethminer;
2021-11-01 09:20:42 +01:00
in
{
2021-05-02 05:11:07 +02:00
systemd.services.ethminer = {
description = "ethminer ethereum mining service";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
serviceConfig = {
DynamicUser = true;
ExecStartPre = "${package}/bin/.ethminer-wrapped --list-devices";
Restart = "always";
};
script = ''
${package}/bin/.ethminer-wrapped \
--farm-recheck ${toString recheckInterval} \
--report-hashrate \
--${toolkit} \
--pool stratum1+tcp://${wallet}.${rig}@${pool}:4444
'';
};
2021-05-06 15:02:42 +02:00
# https://wiki.archlinux.org/title/GPGPU#Intel
2021-05-02 05:11:07 +02:00
hardware.opengl = {
enable = true;
2021-05-15 11:27:34 +02:00
extraPackages = with pkgs; [ intel-ocl intel-compute-runtime beignet ];
2021-05-02 05:11:07 +02:00
driSupport = true;
driSupport32Bit = true;
};
environment.systemPackages = with pkgs; [
package
# go-ethereum
go-ethereum
# to check opencl config
clinfo
# check temperature
i7z
];
}