nix-bitcoin/modules
Erik Arvstedt 27c45b82cc
modules: move options to the top
This greatly improves readability and makes it easier to discover options.

This commit was genereated by running the following script inside the
repo root dir:

#!/usr/bin/env ruby

def transform(src)
  return false if src.include?('inherit options;')

  success = false

  options = nil
  src.sub!(/^  options.*?^  }.*?;/m) do |match|
    options = match
    "  inherit options;"
  end
  return false if !options

  src.sub!(/^with lib;\s*let\n+/m) do |match|
    success = true
    <<~EOF
      with lib;
      let
      #{options}

    EOF
  end

  success
end

Dir['modules/**/*.nix'].each do |f|
  src = File.read(f)
  if transform(src)
    puts "Changed file #{f}"
    File.write(f, src)
  end
end
2021-09-13 13:41:47 +02:00
..
clightning-plugins modules: move options to the top 2021-09-13 13:41:47 +02:00
deployment examples: add krops deployment method 2021-03-15 18:53:07 +01:00
presets security: update /proc restriction mechanism 2021-08-14 10:46:41 +02:00
secrets secrets: allow extending generate-secrets 2021-09-12 11:29:54 +02:00
backups.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
banlist.cli.txt banlist: update to newest version 2020-06-11 09:23:26 +00:00
bitcoind-rpc-public-whitelist.nix treewide: fix formatting 2021-02-07 22:40:10 +01:00
bitcoind.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
btcpayserver.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
charge-lnd.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
clightning.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
default.nix charge-lnd: add module 2021-07-12 17:36:31 +02:00
electrs.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
hardware-wallets.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
joinmarket-ob-watcher.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
joinmarket.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
lightning-loop.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
lightning-pool.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
liquid.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
lnd-rest-onion-service.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
lnd.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
modules.nix modules: document module dependencies 2021-08-15 22:40:35 +02:00
netns-isolation.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
nix-bitcoin.nix modules: move assertion to lnd.nix 2021-08-15 22:40:35 +02:00
nodeinfo.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
obsolete-options.nix secrets: add option 'generateSecrets' 2021-03-15 12:42:52 +00:00
onion-addresses.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
onion-services.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
operator.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
recurring-donations.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
security.nix security: update /proc restriction mechanism 2021-08-14 10:46:41 +02:00
spark-wallet.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
versioning.nix modules: move options to the top 2021-09-13 13:41:47 +02:00