{ pkgs ? import { }, modules ? [ ], outdir ? ".", inputs ? null, outputs ? null, do-not-edit ? null, import-tree ? ( pkgs.fetchFromGitHub { owner = "vic"; repo = "import-tree"; rev = "c968d3b54d12cf5d9c13f16f7c545a06c9d1fde6"; hash = "sha256-oYO4poyw0Sb/db2PigqugMlDwsvwLg6CSpFrMUWxA3Q="; } ), ... }: let inherit (pkgs) lib; tree = (import import-tree) modules; attrsOpt = lib.mkOption { default = { }; type = lib.types.submodule { freeformType = lib.types.lazyAttrsOf lib.types.unspecified; }; }; module = { imports = [ tree ./../default.nix ./../options ./../npins ./../unflake ./../nixlock ./../write-inputs.nix ./../write-flake.nix ./../write-lock.nix ./../flake-options.nix (lib.optionalAttrs (inputs != null) { flake-file.inputs = inputs; }) (lib.optionalAttrs (outputs != null) { flake-file.outputs = strOrFile outputs; }) (lib.optionalAttrs (do-not-edit != null) { flake-file.do-not-edit = strOrFile do-not-edit; }) bootstrap-app ]; config.flake-file.intoPath = outdir; options = { lib = attrsOpt; templates = attrsOpt; flakeModules = attrsOpt; }; }; strOrFile = str: if builtins.isPath str then builtins.readFile str else str; bootstrap-app = { flake-file.apps.bootstrap = pkgs: let inputs = ''{ flake-file.url = "github:vic/flake-file"; }''; notice = pkgs.writeText "notice" '' # DO-NOT-EDIT. Generated by github:vic/flake-file from flake-file.nix. Regen with: # nix-shell https://github.com/vic/flake-file/archive/main.zip -A flake-file.sh --run bootstrap ''; in pkgs.writeShellApplication { name = "bootstrap"; text = '' if ! test -f flake-file.nix; then cp flake.nix flake-file.nix fi nix-shell ${../..} -A flake-file.sh --run write-flake \ --arg modules ./flake-file.nix \ --arg do-not-edit ${notice} \ --argstr outputs flake-module \ --arg inputs '${inputs}' ''; }; }; evaled = lib.evalModules { modules = [ module ]; }; in evaled.config