Skip to content

Instantly share code, notes, and snippets.

@Ericson2314
Created April 7, 2025 15:14
Show Gist options
  • Select an option

  • Save Ericson2314/147281788b3b31cfbd4925dc49e3d59b to your computer and use it in GitHub Desktop.

Select an option

Save Ericson2314/147281788b3b31cfbd4925dc49e3d59b to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
set -eu -o pipefail
args=()
function f {
args+=(-e "s#<nix/$1#<$2#")
args+=(-e "s#\"nix/$1#\"$2#")
}
f built-path.hh nix/cmd/built-path.hh
f command-installable-value.hh nix/cmd/command-installable-value.hh
f command.hh nix/cmd/command.hh
f common-eval-args.hh nix/cmd/common-eval-args.hh
f compatibility-settings.hh nix/cmd/compatibility-settings.hh
f editor-for.hh nix/cmd/editor-for.hh
f installable-attr-path.hh nix/cmd/installable-attr-path.hh
f installable-derived-path.hh nix/cmd/installable-derived-path.hh
f installable-flake.hh nix/cmd/installable-flake.hh
f installable-value.hh nix/cmd/installable-value.hh
f installables.hh nix/cmd/installables.hh
f legacy.hh nix/cmd/legacy.hh
f markdown.hh nix/cmd/markdown.hh
f misc-store-flags.hh nix/cmd/misc-store-flags.hh
f network-proxy.hh nix/cmd/network-proxy.hh
f repl-interacter.hh nix/cmd/repl-interacter.hh
f repl.hh nix/cmd/repl.hh
f tests/libexpr.hh nix/expr/tests/libexpr.hh
f tests/nix_api_expr.hh nix/expr/tests/nix_api_expr.hh
f tests/value/context.hh nix/expr/tests/value/context.hh
f attr-path.hh nix/expr/attr-path.hh
f attr-set.hh nix/expr/attr-set.hh
f eval-cache.hh nix/expr/eval-cache.hh
f eval-error.hh nix/expr/eval-error.hh
f eval-gc.hh nix/expr/eval-gc.hh
f eval-inline.hh nix/expr/eval-inline.hh
f eval-settings.hh nix/expr/eval-settings.hh
f eval.hh nix/expr/eval.hh
f function-trace.hh nix/expr/function-trace.hh
f gc-small-vector.hh nix/expr/gc-small-vector.hh
f get-drvs.hh nix/expr/get-drvs.hh
f json-to-value.hh nix/expr/json-to-value.hh
f lexer-helpers.hh nix/expr/lexer-helpers.hh
f nixexpr.hh nix/expr/nixexpr.hh
f parser-state.hh nix/expr/parser-state.hh
f primops.hh nix/expr/primops.hh
f print-ambiguous.hh nix/expr/print-ambiguous.hh
f print-options.hh nix/expr/print-options.hh
f print.hh nix/expr/print.hh
f repl-exit-status.hh nix/expr/repl-exit-status.hh
f search-path.hh nix/expr/search-path.hh
f symbol-table.hh nix/expr/symbol-table.hh
f value-to-json.hh nix/expr/value-to-json.hh
f value-to-xml.hh nix/expr/value-to-xml.hh
f value.hh nix/expr/value.hh
f value/context.hh nix/expr/value/context.hh
f attrs.hh nix/fetchers/attrs.hh
f cache.hh nix/fetchers/cache.hh
f fetch-settings.hh nix/fetchers/fetch-settings.hh
f fetch-to-store.hh nix/fetchers/fetch-to-store.hh
f fetchers.hh nix/fetchers/fetchers.hh
f filtering-source-accessor.hh nix/fetchers/filtering-source-accessor.hh
f git-lfs-fetch.hh nix/fetchers/git-lfs-fetch.hh
f git-utils.hh nix/fetchers/git-utils.hh
f registry.hh nix/fetchers/registry.hh
f store-path-accessor.hh nix/fetchers/store-path-accessor.hh
f tarball.hh nix/fetchers/tarball.hh
f flake-primops.hh nix/flake/flake-primops.hh
f flake.hh nix/flake/flake.hh
f flakeref.hh nix/flake/flakeref.hh
f lockfile.hh nix/flake/lockfile.hh
f settings.hh nix/flake/settings.hh
f url-name.hh nix/flake/url-name.hh
f common-args.hh nix/main/common-args.hh
f loggers.hh nix/main/loggers.hh
f plugin.hh nix/main/plugin.hh
f progress-bar.hh nix/main/progress-bar.hh
f shared.hh nix/main/shared.hh
f tests/derived-path.hh nix/store/tests/derived-path.hh
f tests/libstore.hh nix/store/tests/libstore.hh
f tests/nix_api_store.hh nix/store/tests/nix_api_store.hh
f tests/outputs-spec.hh nix/store/tests/outputs-spec.hh
f tests/path.hh nix/store/tests/path.hh
f tests/protocol.hh nix/store/tests/protocol.hh
f binary-cache-store.hh nix/store/binary-cache-store.hh
f build-result.hh nix/store/build-result.hh
f build/derivation-goal.hh nix/store/build/derivation-goal.hh
f build/drv-output-substitution-goal.hh nix/store/build/drv-output-substitution-goal.hh
f build/goal.hh nix/store/build/goal.hh
f build/substitution-goal.hh nix/store/build/substitution-goal.hh
f build/worker.hh nix/store/build/worker.hh
f builtins.hh nix/store/builtins.hh
f builtins/buildenv.hh nix/store/builtins/buildenv.hh
f common-protocol-impl.hh nix/store/common-protocol-impl.hh
f common-protocol.hh nix/store/common-protocol.hh
f common-ssh-store-config.hh nix/store/common-ssh-store-config.hh
f content-address.hh nix/store/content-address.hh
f daemon.hh nix/store/daemon.hh
f derivation-options.hh nix/store/derivation-options.hh
f derivations.hh nix/store/derivations.hh
f derived-path-map.hh nix/store/derived-path-map.hh
f derived-path.hh nix/store/derived-path.hh
f downstream-placeholder.hh nix/store/downstream-placeholder.hh
f filetransfer.hh nix/store/filetransfer.hh
f gc-store.hh nix/store/gc-store.hh
f globals.hh nix/store/globals.hh
f http-binary-cache-store.hh nix/store/http-binary-cache-store.hh
f indirect-root-store.hh nix/store/indirect-root-store.hh
f keys.hh nix/store/keys.hh
f legacy-ssh-store.hh nix/store/legacy-ssh-store.hh
f length-prefixed-protocol-helper.hh nix/store/length-prefixed-protocol-helper.hh
f local-binary-cache-store.hh nix/store/local-binary-cache-store.hh
f local-fs-store.hh nix/store/local-fs-store.hh
f local-overlay-store.hh nix/store/local-overlay-store.hh
f local-store.hh nix/store/local-store.hh
f log-store.hh nix/store/log-store.hh
f machines.hh nix/store/machines.hh
f make-content-addressed.hh nix/store/make-content-addressed.hh
f names.hh nix/store/names.hh
f nar-accessor.hh nix/store/nar-accessor.hh
f nar-info-disk-cache.hh nix/store/nar-info-disk-cache.hh
f nar-info.hh nix/store/nar-info.hh
f outputs-spec.hh nix/store/outputs-spec.hh
f parsed-derivations.hh nix/store/parsed-derivations.hh
f path-info.hh nix/store/path-info.hh
f path-references.hh nix/store/path-references.hh
f path-regex.hh nix/store/path-regex.hh
f path-with-outputs.hh nix/store/path-with-outputs.hh
f path.hh nix/store/path.hh
f pathlocks.hh nix/store/pathlocks.hh
f posix-fs-canonicalise.hh nix/store/posix-fs-canonicalise.hh
f profiles.hh nix/store/profiles.hh
f realisation.hh nix/store/realisation.hh
f remote-fs-accessor.hh nix/store/remote-fs-accessor.hh
f remote-store-connection.hh nix/store/remote-store-connection.hh
f remote-store.hh nix/store/remote-store.hh
f restricted-store.hh nix/store/restricted-store.hh
f s3-binary-cache-store.hh nix/store/s3-binary-cache-store.hh
f s3.hh nix/store/s3.hh
f serve-protocol-connection.hh nix/store/serve-protocol-connection.hh
f serve-protocol-impl.hh nix/store/serve-protocol-impl.hh
f serve-protocol.hh nix/store/serve-protocol.hh
f sqlite.hh nix/store/sqlite.hh
f ssh-store.hh nix/store/ssh-store.hh
f ssh.hh nix/store/ssh.hh
f store-api.hh nix/store/store-api.hh
f store-cast.hh nix/store/store-cast.hh
f store-dir-config.hh nix/store/store-dir-config.hh
f store-reference.hh nix/store/store-reference.hh
f uds-remote-store.hh nix/store/uds-remote-store.hh
f worker-protocol-connection.hh nix/store/worker-protocol-connection.hh
f worker-protocol-impl.hh nix/store/worker-protocol-impl.hh
f worker-protocol.hh nix/store/worker-protocol.hh
f fchmodat2-compat.hh nix/store/fchmodat2-compat.hh
f personality.hh nix/store/personality.hh
f build/child.hh nix/store/build/child.hh
f build/hook-instance.hh nix/store/build/hook-instance.hh
f build/local-derivation-goal.hh nix/store/build/local-derivation-goal.hh
f user-lock.hh nix/store/user-lock.hh
f tests/characterization.hh nix/util/tests/characterization.hh
f tests/gtest-with-params.hh nix/util/tests/gtest-with-params.hh
f tests/hash.hh nix/util/tests/hash.hh
f tests/nix_api_util.hh nix/util/tests/nix_api_util.hh
f tests/string_callback.hh nix/util/tests/string_callback.hh
f tests/tracing-file-system-object-sink.hh nix/util/tests/tracing-file-system-object-sink.hh
f abstract-setting-to-json.hh nix/util/abstract-setting-to-json.hh
f ansicolor.hh nix/util/ansicolor.hh
f archive.hh nix/util/archive.hh
f args.hh nix/util/args.hh
f args/root.hh nix/util/args/root.hh
f callback.hh nix/util/callback.hh
f canon-path.hh nix/util/canon-path.hh
f checked-arithmetic.hh nix/util/checked-arithmetic.hh
f chunked-vector.hh nix/util/chunked-vector.hh
f closure.hh nix/util/closure.hh
f comparator.hh nix/util/comparator.hh
f compression.hh nix/util/compression.hh
f compute-levels.hh nix/util/compute-levels.hh
f config-global.hh nix/util/config-global.hh
f config-impl.hh nix/util/config-impl.hh
f config.hh nix/util/configuration.hh
f current-process.hh nix/util/current-process.hh
f english.hh nix/util/english.hh
f environment-variables.hh nix/util/environment-variables.hh
f error.hh nix/util/error.hh
f exec.hh nix/util/exec.hh
f executable-path.hh nix/util/executable-path.hh
f exit.hh nix/util/exit.hh
f experimental-features.hh nix/util/experimental-features.hh
f file-content-address.hh nix/util/file-content-address.hh
f file-descriptor.hh nix/util/file-descriptor.hh
f file-path-impl.hh nix/util/file-path-impl.hh
f file-path.hh nix/util/file-path.hh
f file-system.hh nix/util/file-system.hh
f finally.hh nix/util/finally.hh
f fmt.hh nix/util/fmt.hh
f fs-sink.hh nix/util/fs-sink.hh
f git.hh nix/util/git.hh
f hash.hh nix/util/hash.hh
f hilite.hh nix/util/hilite.hh
f json-impls.hh nix/util/json-impls.hh
f json-utils.hh nix/util/json-utils.hh
f logging.hh nix/util/logging.hh
f lru-cache.hh nix/util/lru-cache.hh
f memory-source-accessor.hh nix/util/memory-source-accessor.hh
f muxable-pipe.hh nix/util/muxable-pipe.hh
f os-string.hh nix/util/os-string.hh
f pool.hh nix/util/pool.hh
f pos-idx.hh nix/util/pos-idx.hh
f pos-table.hh nix/util/pos-table.hh
f position.hh nix/util/position.hh
f posix-source-accessor.hh nix/util/posix-source-accessor.hh
f processes.hh nix/util/processes.hh
f ref.hh nix/util/ref.hh
f references.hh nix/util/references.hh
f regex-combinators.hh nix/util/regex-combinators.hh
f repair-flag.hh nix/util/repair-flag.hh
f serialise.hh nix/util/serialise.hh
f signals.hh nix/util/signals.hh
f signature/local-keys.hh nix/util/signature/local-keys.hh
f signature/signer.hh nix/util/signature/signer.hh
f source-accessor.hh nix/util/source-accessor.hh
f source-path.hh nix/util/source-path.hh
f split.hh nix/util/split.hh
f std-hash.hh nix/util/std-hash.hh
f strings-inline.hh nix/util/strings-inline.hh
f strings.hh nix/util/strings.hh
f suggestions.hh nix/util/suggestions.hh
f sync.hh nix/util/sync.hh
f tarfile.hh nix/util/tarfile.hh
f terminal.hh nix/util/terminal.hh
f thread-pool.hh nix/util/thread-pool.hh
f topo-sort.hh nix/util/topo-sort.hh
f types.hh nix/util/types.hh
f unix-domain-socket.hh nix/util/unix-domain-socket.hh
f url-parts.hh nix/util/url-parts.hh
f url.hh nix/util/url.hh
f users.hh nix/util/users.hh
f util.hh nix/util/util.hh
f variant-wrapper.hh nix/util/variant-wrapper.hh
f xml-writer.hh nix/util/xml-writer.hh
f cgroup.hh nix/util/cgroup.hh
f namespaces.hh nix/util/namespaces.hh
f monitor-fd.hh nix/util/monitor-fd.hh
f signals-impl.hh nix/util/signals-impl.hh
f signals-impl.hh nix/util/signals-impl.hh
f windows-async-pipe.hh nix/util/windows-async-pipe.hh
f windows-error.hh nix/util/windows-error.hh
sed "${args[@]}" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment