nix-bitcoin/modules/clightning-plugins
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
..
clboss.nix clboss: add option for using custom package 2021-04-13 14:12:39 +00:00
default.nix modules: move options to the top 2021-09-13 13:41:47 +02:00
prometheus.nix add curated clightning plugins 2020-11-18 20:21:34 -06:00
summary.nix add curated clightning plugins 2020-11-18 20:21:34 -06:00
zmq.nix modules: move options to the top 2021-09-13 13:41:47 +02:00