summary refs log tree commit diff
path: root/nixos/modules/services/networking/bitcoind.nix
diff options
context:
space:
mode:
author1000101 <b1000101@pm.me>2020-07-24 15:48:11 +0200
committer1000101 <b1000101@pm.me>2020-07-27 10:40:06 +0200
commit95440f040eacee2f7887edcee283869735a0b168 (patch)
treeb52cf755c035bee1af0baf22a5ef55cfb6cf9c90 /nixos/modules/services/networking/bitcoind.nix
parent7b76bc2c7d21c9fd75d31880f096219d8c97e02a (diff)
downloadnixpkgs-95440f040eacee2f7887edcee283869735a0b168.tar
nixpkgs-95440f040eacee2f7887edcee283869735a0b168.tar.gz
nixpkgs-95440f040eacee2f7887edcee283869735a0b168.tar.bz2
nixpkgs-95440f040eacee2f7887edcee283869735a0b168.tar.lz
nixpkgs-95440f040eacee2f7887edcee283869735a0b168.tar.xz
nixpkgs-95440f040eacee2f7887edcee283869735a0b168.tar.zst
nixpkgs-95440f040eacee2f7887edcee283869735a0b168.zip
nixos/bitcoind: minor refactoring
Diffstat (limited to 'nixos/modules/services/networking/bitcoind.nix')
-rw-r--r--nixos/modules/services/networking/bitcoind.nix16
1 files changed, 8 insertions, 8 deletions
diff --git a/nixos/modules/services/networking/bitcoind.nix b/nixos/modules/services/networking/bitcoind.nix
index 4da719ac2f2..38537ad2de7 100644
--- a/nixos/modules/services/networking/bitcoind.nix
+++ b/nixos/modules/services/networking/bitcoind.nix
@@ -16,7 +16,7 @@ let
         '';
       };
       passwordHMAC = mkOption {
-        type = with types; uniq (strMatching "[0-9a-f]+\\$[0-9a-f]{64}");
+        type = types.uniq (types.strMatching "[0-9a-f]+\\$[0-9a-f]{64}");
         example = "f7efda5c189b999524f151318c0c86$d5b51b3beffbc02b724e5d095828e0bc8b2456e9ac8757ae3211a5d9b16a22ae";
         description = ''
           Password HMAC-SHA-256 for JSON-RPC connections. Must be a string of the
@@ -45,7 +45,7 @@ let
       };
 
       configFile = mkOption {
-        type = with types; nullOr path;
+        type = types.nullOr types.path;
         default = null;
         example = "/var/lib/${name}/bitcoin.conf";
         description = "The configuration file path to supply bitcoind.";
@@ -94,10 +94,8 @@ let
               bob.passwordHMAC = "b2dd077cb54591a2f3139e69a897ac$4e71f08d48b4347cf8eff3815c0e25ae2e9a4340474079f55705f40574f4ec99";
             }
           '';
-          type = with types; attrsOf (submodule rpcUserOpts);
-          description = ''
-            RPC user information for JSON-RPC connnections.
-          '';
+          type = types.attrsOf (types.submodule rpcUserOpts);
+          description = "RPC user information for JSON-RPC connnections.";
         };
       };
 
@@ -171,9 +169,9 @@ in
 
     assertions = flatten (mapAttrsToList (bitcoindName: cfg: [
     {
-      assertion = (cfg.prune != null) -> (cfg.prune == "disable" || cfg.prune == "manual") || (cfg.prune == 0 || cfg.prune == 1) || (cfg.prune >= 550);
+      assertion = (cfg.prune != null) -> (builtins.elem cfg.prune [ "disable" "manual" 0 1 ] || (builtins.isInt cfg.prune && cfg.prune >= 550));
       message = ''
-        If set, services.bitcoind.${bitcoindName}.prune has to be "disable", "manual", 0 , 1 or >= 550
+        If set, services.bitcoind.${bitcoindName}.prune has to be "disable", "manual", 0 , 1 or >= 550.
       '';
     }
     {
@@ -258,4 +256,6 @@ in
 
   };
 
+  meta.maintainers = with maintainers; [ maintainers."1000101" ];
+
 }