about summary refs log tree commit diff
path: root/nixpkgs/nixos/modules/services/misc/ethminer.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/nixos/modules/services/misc/ethminer.nix')
-rw-r--r--nixpkgs/nixos/modules/services/misc/ethminer.nix28
1 files changed, 14 insertions, 14 deletions
diff --git a/nixpkgs/nixos/modules/services/misc/ethminer.nix b/nixpkgs/nixos/modules/services/misc/ethminer.nix
index 95afb0460fb8..909c49866e54 100644
--- a/nixpkgs/nixos/modules/services/misc/ethminer.nix
+++ b/nixpkgs/nixos/modules/services/misc/ethminer.nix
@@ -18,61 +18,61 @@ in
       enable = mkOption {
         type = types.bool;
         default = false;
-        description = "Enable ethminer ether mining.";
+        description = lib.mdDoc "Enable ethminer ether mining.";
       };
 
       recheckInterval = mkOption {
-        type = types.int;
+        type = types.ints.unsigned;
         default = 2000;
-        description = "Interval in milliseconds between farm rechecks.";
+        description = lib.mdDoc "Interval in milliseconds between farm rechecks.";
       };
 
       toolkit = mkOption {
         type = types.enum [ "cuda" "opencl" ];
         default = "cuda";
-        description = "Cuda or opencl toolkit.";
+        description = lib.mdDoc "Cuda or opencl toolkit.";
       };
 
       apiPort = mkOption {
         type = types.int;
         default = -3333;
-        description = "Ethminer api port. minus sign puts api in read-only mode.";
+        description = lib.mdDoc "Ethminer api port. minus sign puts api in read-only mode.";
       };
 
       wallet = mkOption {
         type = types.str;
         example = "0x0123456789abcdef0123456789abcdef01234567";
-        description = "Ethereum wallet address.";
+        description = lib.mdDoc "Ethereum wallet address.";
       };
 
       pool = mkOption {
         type = types.str;
         example = "eth-us-east1.nanopool.org";
-        description = "Mining pool address.";
+        description = lib.mdDoc "Mining pool address.";
       };
 
       stratumPort = mkOption {
         type = types.port;
         default = 9999;
-        description = "Stratum protocol tcp port.";
+        description = lib.mdDoc "Stratum protocol tcp port.";
       };
 
       rig = mkOption {
         type = types.str;
         default = "mining-rig-name";
-        description = "Mining rig name.";
+        description = lib.mdDoc "Mining rig name.";
       };
 
       registerMail = mkOption {
         type = types.str;
         example = "email%40example.org";
-        description = "Url encoded email address to register with pool.";
+        description = lib.mdDoc "Url encoded email address to register with pool.";
       };
 
       maxPower = mkOption {
-        type = types.int;
+        type = types.ints.unsigned;
         default = 113;
-        description = "Miner max watt usage.";
+        description = lib.mdDoc "Miner max watt usage.";
       };
 
     };
@@ -85,7 +85,7 @@ in
   config = mkIf cfg.enable {
 
     systemd.services.ethminer = {
-      path = [ pkgs.cudatoolkit ];
+      path = optional (cfg.toolkit == "cuda") [ pkgs.cudaPackages.cudatoolkit ];
       description = "ethminer ethereum mining service";
       wantedBy = [ "multi-user.target" ];
       after = [ "network.target" ];
@@ -97,7 +97,7 @@ in
         Restart = "always";
       };
 
-      environment = {
+      environment = mkIf (cfg.toolkit == "cuda") {
         LD_LIBRARY_PATH = "${config.boot.kernelPackages.nvidia_x11}/lib";
       };