anchor.diff:  with lib;
   
   let
  -  cfg = config.services.bitcoind;
  -  pidFile = "${cfg.dataDir}/bitcoind.pid";
  -  configFile = pkgs.writeText "bitcoin.conf" ''
  -    ${optionalString cfg.testnet "testnet=1"}
  -    ${optionalString (cfg.dbCache != null) "dbcache=${toString cfg.dbCache}"}
  -    ${optionalString (cfg.prune != null) "prune=${toString cfg.prune}"}
  -
  -    # Connection options
  -    ${optionalString (cfg.port != null) "port=${toString cfg.port}"}
  -
  -    # RPC server options
  -    ${optionalString (cfg.rpc.port != null) "rpcport=${toString cfg.rpc.port}"}
  -    ${concatMapStringsSep  "\n"
  -      (rpcUser: "rpcauth=${rpcUser.name}:${rpcUser.passwordHMAC}")
  -      (attrValues cfg.rpc.users)
  -    }
  -
  -    # Extra config options (from bitcoind nixos service)
  -    ${cfg.extraConfig}
  -  '';
  -  cmdlineOptions = escapeShellArgs [
  -    "-conf=${cfg.configFile}"
  -    "-datadir=${cfg.dataDir}"
  -    "-pid=${pidFile}"
  -  ];
  +
  +  eachBitcoind = config.services.bitcoind;
   
     rpcUserOpts = { name, ... }: {
       options = {
  
positive.code:       name = mkDefault name;
      };
    };
  in {
    options = {
  
      services.bitcoind = {
        enable = mkEnableOption "Bitcoin daemon";
  
        package = mkOption {
  
negative.code:         description = ''
            Password HMAC-SHA-256 for JSON-RPC connections. Must be a string of the
            format &lt;SALT-HEX&gt;$&lt;HMAC-HEX&gt;.
  
            Tool (Python script) for HMAC generation is available here:
            <link xlink:href="https://github.com/bitcoin/bitcoin/blob/master/share/rpcauth/rpcauth.py"/>
          '';
        };
      };
  