aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--perl/lib/Nix/Store.xs1
-rw-r--r--src/libcmd/common-eval-args.cc1
-rw-r--r--src/libcmd/editor-for.cc1
-rw-r--r--src/libcmd/installable-attr-path.cc1
-rw-r--r--src/libcmd/installable-attr-path.hh1
-rw-r--r--src/libcmd/installable-flake.cc1
-rw-r--r--src/libcmd/installables.cc7
-rw-r--r--src/libcmd/installables.hh1
-rw-r--r--src/libcmd/markdown.cc2
-rw-r--r--src/libcmd/repl-interacter.cc7
-rw-r--r--src/libexpr/attr-path.cc1
-rw-r--r--src/libexpr/eval.cc1
-rw-r--r--src/libexpr/flake/config.cc1
-rw-r--r--src/libexpr/get-drvs.cc1
-rw-r--r--src/libexpr/nixexpr.cc1
-rw-r--r--src/libexpr/print-ambiguous.cc3
-rw-r--r--src/libexpr/search-path.cc1
-rw-r--r--src/libexpr/value-to-json.cc1
-rw-r--r--src/libexpr/value-to-xml.cc4
-rw-r--r--src/libexpr/value/context.hh1
-rw-r--r--src/libfetchers/fetch-settings.hh1
-rw-r--r--src/libfetchers/fetch-to-store.hh1
-rw-r--r--src/libmain/common-args.cc1
-rw-r--r--src/libmain/loggers.cc1
-rw-r--r--src/libmain/progress-bar.cc1
-rw-r--r--src/libmain/shared.cc1
-rw-r--r--src/libmain/shared.hh1
-rw-r--r--src/libstore/build/derivation-goal.cc1
-rw-r--r--src/libstore/common-protocol.cc3
-rw-r--r--src/libstore/crypto.hh2
-rw-r--r--src/libstore/derivations.cc1
-rw-r--r--src/libstore/derived-path.hh2
-rw-r--r--src/libstore/filetransfer.cc1
-rw-r--r--src/libstore/filetransfer.hh3
-rw-r--r--src/libstore/gc.cc6
-rw-r--r--src/libstore/globals.cc5
-rw-r--r--src/libstore/local-store.hh2
-rw-r--r--src/libstore/nar-info-disk-cache.cc1
-rw-r--r--src/libstore/optimise-store.cc1
-rw-r--r--src/libstore/outputs-spec.cc1
-rw-r--r--src/libstore/path-references.cc4
-rw-r--r--src/libstore/pathlocks.cc4
-rw-r--r--src/libstore/remote-store.cc1
-rw-r--r--src/libstore/serve-protocol.cc2
-rw-r--r--src/libstore/sqlite.cc3
-rw-r--r--src/libstore/store-api.cc2
-rw-r--r--src/libstore/store-api.hh1
-rw-r--r--src/libstore/worker-protocol.cc1
-rw-r--r--src/libutil/archive.cc2
-rw-r--r--src/libutil/args.cc1
-rw-r--r--src/libutil/args.hh8
-rw-r--r--src/libutil/comparator.hh2
-rw-r--r--src/libutil/compression.cc3
-rw-r--r--src/libutil/config-impl.hh2
-rw-r--r--src/libutil/config.cc1
-rw-r--r--src/libutil/error.cc2
-rw-r--r--src/libutil/experimental-features.cc1
-rw-r--r--src/libutil/file-descriptor.cc1
-rw-r--r--src/libutil/file-system.cc1
-rw-r--r--src/libutil/hash.cc3
-rw-r--r--src/libutil/logging.cc3
-rw-r--r--src/libutil/meson.build1
-rw-r--r--src/libutil/references.cc4
-rw-r--r--src/libutil/serialise.cc1
-rw-r--r--src/libutil/serialise.hh1
-rw-r--r--src/libutil/signals.cc1
-rw-r--r--src/libutil/signals.hh2
-rw-r--r--src/libutil/split.hh2
-rw-r--r--src/libutil/suggestions.cc1
-rw-r--r--src/libutil/suggestions.hh5
-rw-r--r--src/libutil/tarfile.cc1
-rw-r--r--src/libutil/thread-pool.cc1
-rw-r--r--src/libutil/thread-pool.hh3
-rw-r--r--src/libutil/url-name.cc1
-rw-r--r--src/libutil/url-name.hh3
-rw-r--r--src/libutil/util.hh40
-rw-r--r--src/nix-build/nix-build.cc1
-rw-r--r--src/nix-env/user-env.cc1
-rw-r--r--src/nix-instantiate/nix-instantiate.cc1
-rw-r--r--src/nix-store/dotgraph.cc1
-rw-r--r--src/nix-store/graphml.cc1
-rw-r--r--src/nix-store/nix-store.cc1
-rw-r--r--src/nix/daemon.cc1
-rw-r--r--src/nix/develop.cc1
-rw-r--r--src/nix/doctor.cc1
-rw-r--r--tests/functional/repl_characterization/repl_characterization.cc3
-rw-r--r--tests/unit/libcmd/args.cc1
-rw-r--r--tests/unit/libstore-support/tests/test-data.hh2
-rw-r--r--tests/unit/libutil-support/tests/characterization.hh1
-rw-r--r--tests/unit/libutil-support/tests/cli-literate-parser.cc2
-rw-r--r--tests/unit/libutil/logging.cc1
-rw-r--r--tests/unit/libutil/tests.cc3
92 files changed, 50 insertions, 161 deletions
diff --git a/perl/lib/Nix/Store.xs b/perl/lib/Nix/Store.xs
index e96885e4c..4bef020d3 100644
--- a/perl/lib/Nix/Store.xs
+++ b/perl/lib/Nix/Store.xs
@@ -11,7 +11,6 @@
#include "derivations.hh"
#include "globals.hh"
#include "store-api.hh"
-#include "util.hh"
#include "crypto.hh"
#include <sodium.h>
diff --git a/src/libcmd/common-eval-args.cc b/src/libcmd/common-eval-args.cc
index 9beea5aa2..e86213020 100644
--- a/src/libcmd/common-eval-args.cc
+++ b/src/libcmd/common-eval-args.cc
@@ -2,7 +2,6 @@
#include "common-eval-args.hh"
#include "shared.hh"
#include "filetransfer.hh"
-#include "util.hh"
#include "eval.hh"
#include "fetchers.hh"
#include "registry.hh"
diff --git a/src/libcmd/editor-for.cc b/src/libcmd/editor-for.cc
index a56a7065e..67653d9c9 100644
--- a/src/libcmd/editor-for.cc
+++ b/src/libcmd/editor-for.cc
@@ -1,4 +1,3 @@
-#include "util.hh"
#include "editor-for.hh"
#include "environment-variables.hh"
#include "source-path.hh"
diff --git a/src/libcmd/installable-attr-path.cc b/src/libcmd/installable-attr-path.cc
index 06e507872..eb15fecc3 100644
--- a/src/libcmd/installable-attr-path.cc
+++ b/src/libcmd/installable-attr-path.cc
@@ -1,7 +1,6 @@
#include "globals.hh"
#include "installable-attr-path.hh"
#include "outputs-spec.hh"
-#include "util.hh"
#include "command.hh"
#include "attr-path.hh"
#include "common-eval-args.hh"
diff --git a/src/libcmd/installable-attr-path.hh b/src/libcmd/installable-attr-path.hh
index e9f0c33da..86c2f8219 100644
--- a/src/libcmd/installable-attr-path.hh
+++ b/src/libcmd/installable-attr-path.hh
@@ -4,7 +4,6 @@
#include "globals.hh"
#include "installable-value.hh"
#include "outputs-spec.hh"
-#include "util.hh"
#include "command.hh"
#include "attr-path.hh"
#include "common-eval-args.hh"
diff --git a/src/libcmd/installable-flake.cc b/src/libcmd/installable-flake.cc
index 46bdd411b..b1ebd339e 100644
--- a/src/libcmd/installable-flake.cc
+++ b/src/libcmd/installable-flake.cc
@@ -2,7 +2,6 @@
#include "installable-flake.hh"
#include "installable-derived-path.hh"
#include "outputs-spec.hh"
-#include "util.hh"
#include "command.hh"
#include "attr-path.hh"
#include "common-eval-args.hh"
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index 2c18653e4..ab0e4fd1c 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -3,26 +3,21 @@
#include "installable-derived-path.hh"
#include "installable-attr-path.hh"
#include "installable-flake.hh"
+#include "logging.hh"
#include "outputs-spec.hh"
-#include "util.hh"
#include "command.hh"
#include "attr-path.hh"
#include "common-eval-args.hh"
#include "derivations.hh"
-#include "eval-inline.hh"
#include "eval.hh"
#include "eval-settings.hh"
-#include "get-drvs.hh"
#include "store-api.hh"
#include "shared.hh"
#include "flake/flake.hh"
#include "eval-cache.hh"
-#include "url.hh"
#include "registry.hh"
#include "build-result.hh"
-#include <regex>
-#include <queue>
#include <nlohmann/json.hpp>
diff --git a/src/libcmd/installables.hh b/src/libcmd/installables.hh
index ad5b4f759..95e8841ca 100644
--- a/src/libcmd/installables.hh
+++ b/src/libcmd/installables.hh
@@ -1,7 +1,6 @@
#pragma once
///@file
-#include "util.hh"
#include "path.hh"
#include "outputs-spec.hh"
#include "derived-path.hh"
diff --git a/src/libcmd/markdown.cc b/src/libcmd/markdown.cc
index 8b3bbc1b5..dbaab8c19 100644
--- a/src/libcmd/markdown.cc
+++ b/src/libcmd/markdown.cc
@@ -1,5 +1,5 @@
#include "markdown.hh"
-#include "util.hh"
+#include "error.hh"
#include "finally.hh"
#include "terminal.hh"
diff --git a/src/libcmd/repl-interacter.cc b/src/libcmd/repl-interacter.cc
index 41589cda1..0cf4e34b8 100644
--- a/src/libcmd/repl-interacter.cc
+++ b/src/libcmd/repl-interacter.cc
@@ -1,3 +1,7 @@
+#include "error.hh"
+#include "file-system.hh"
+#include "logging.hh"
+#include <csignal>
#include <cstdio>
#include <iostream>
#include <string>
@@ -18,11 +22,8 @@ extern "C" {
}
#endif
-#include "signals.hh"
#include "finally.hh"
#include "repl-interacter.hh"
-#include "util.hh"
-#include "repl.hh"
namespace nix {
diff --git a/src/libexpr/attr-path.cc b/src/libexpr/attr-path.cc
index f4da99a9a..3e60f295d 100644
--- a/src/libexpr/attr-path.cc
+++ b/src/libexpr/attr-path.cc
@@ -1,6 +1,5 @@
#include "attr-path.hh"
#include "eval-inline.hh"
-#include "util.hh"
namespace nix {
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index a8b37325b..c9a624eeb 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -5,7 +5,6 @@
#include "print-options.hh"
#include "shared.hh"
#include "types.hh"
-#include "util.hh"
#include "store-api.hh"
#include "derivations.hh"
#include "downstream-placeholder.hh"
diff --git a/src/libexpr/flake/config.cc b/src/libexpr/flake/config.cc
index 35c605de2..b330d96f9 100644
--- a/src/libexpr/flake/config.cc
+++ b/src/libexpr/flake/config.cc
@@ -1,4 +1,5 @@
#include "flake.hh"
+#include "logging.hh"
#include "users.hh"
#include "fetch-settings.hh"
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc
index e686ffe8c..8c8e142b8 100644
--- a/src/libexpr/get-drvs.cc
+++ b/src/libexpr/get-drvs.cc
@@ -1,5 +1,4 @@
#include "get-drvs.hh"
-#include "util.hh"
#include "eval-inline.hh"
#include "derivations.hh"
#include "store-api.hh"
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 72a8764e6..6a1aa8f35 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -2,7 +2,6 @@
#include "derivations.hh"
#include "eval.hh"
#include "symbol-table.hh"
-#include "util.hh"
#include "print.hh"
#include "escape-string.hh"
diff --git a/src/libexpr/print-ambiguous.cc b/src/libexpr/print-ambiguous.cc
index ec30f5073..bcf86b5c6 100644
--- a/src/libexpr/print-ambiguous.cc
+++ b/src/libexpr/print-ambiguous.cc
@@ -1,6 +1,7 @@
#include "print-ambiguous.hh"
+#include "attr-set.hh"
+#include "logging.hh"
#include "print.hh"
-#include "eval.hh"
#include "signals.hh"
#include "escape-string.hh"
diff --git a/src/libexpr/search-path.cc b/src/libexpr/search-path.cc
index 180d5f8b1..a25767496 100644
--- a/src/libexpr/search-path.cc
+++ b/src/libexpr/search-path.cc
@@ -1,5 +1,4 @@
#include "search-path.hh"
-#include "util.hh"
namespace nix {
diff --git a/src/libexpr/value-to-json.cc b/src/libexpr/value-to-json.cc
index ebb3379a8..5743d9057 100644
--- a/src/libexpr/value-to-json.cc
+++ b/src/libexpr/value-to-json.cc
@@ -1,6 +1,5 @@
#include "value-to-json.hh"
#include "eval-inline.hh"
-#include "util.hh"
#include "signals.hh"
#include "store-api.hh"
diff --git a/src/libexpr/value-to-xml.cc b/src/libexpr/value-to-xml.cc
index 5d1fbd28d..fda360eff 100644
--- a/src/libexpr/value-to-xml.cc
+++ b/src/libexpr/value-to-xml.cc
@@ -1,11 +1,7 @@
#include "value-to-xml.hh"
#include "xml-writer.hh"
-#include "eval-inline.hh"
-#include "util.hh"
#include "signals.hh"
-#include <cstdlib>
-
namespace nix {
diff --git a/src/libexpr/value/context.hh b/src/libexpr/value/context.hh
index 998b70e36..7f23cd3a4 100644
--- a/src/libexpr/value/context.hh
+++ b/src/libexpr/value/context.hh
@@ -1,7 +1,6 @@
#pragma once
///@file
-#include "util.hh"
#include "comparator.hh"
#include "derived-path.hh"
#include "variant-wrapper.hh"
diff --git a/src/libfetchers/fetch-settings.hh b/src/libfetchers/fetch-settings.hh
index c67a75082..2dc2834fb 100644
--- a/src/libfetchers/fetch-settings.hh
+++ b/src/libfetchers/fetch-settings.hh
@@ -3,7 +3,6 @@
#include "types.hh"
#include "config.hh"
-#include "util.hh"
#include <map>
#include <limits>
diff --git a/src/libfetchers/fetch-to-store.hh b/src/libfetchers/fetch-to-store.hh
index 717450944..b74879637 100644
--- a/src/libfetchers/fetch-to-store.hh
+++ b/src/libfetchers/fetch-to-store.hh
@@ -3,7 +3,6 @@
#include "source-path.hh"
#include "store-api.hh"
-#include "util.hh"
#include "repair-flag.hh"
#include "content-address.hh"
diff --git a/src/libmain/common-args.cc b/src/libmain/common-args.cc
index 12ce289c5..af7f46296 100644
--- a/src/libmain/common-args.cc
+++ b/src/libmain/common-args.cc
@@ -2,6 +2,7 @@
#include "args/root.hh"
#include "globals.hh"
#include "loggers.hh"
+#include "logging.hh"
namespace nix {
diff --git a/src/libmain/loggers.cc b/src/libmain/loggers.cc
index 7e80a31f1..80080d616 100644
--- a/src/libmain/loggers.cc
+++ b/src/libmain/loggers.cc
@@ -1,7 +1,6 @@
#include "environment-variables.hh"
#include "loggers.hh"
#include "progress-bar.hh"
-#include "util.hh"
namespace nix {
diff --git a/src/libmain/progress-bar.cc b/src/libmain/progress-bar.cc
index f3700f103..11b2fe800 100644
--- a/src/libmain/progress-bar.cc
+++ b/src/libmain/progress-bar.cc
@@ -1,5 +1,4 @@
#include "progress-bar.hh"
-#include "util.hh"
#include "sync.hh"
#include "store-api.hh"
#include "names.hh"
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 377cd6abd..f99777a20 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -2,7 +2,6 @@
#include "shared.hh"
#include "store-api.hh"
#include "gc-store.hh"
-#include "util.hh"
#include "signals.hh"
#include "loggers.hh"
#include "progress-bar.hh"
diff --git a/src/libmain/shared.hh b/src/libmain/shared.hh
index 907f336f1..b791980fa 100644
--- a/src/libmain/shared.hh
+++ b/src/libmain/shared.hh
@@ -1,7 +1,6 @@
#pragma once
///@file
-#include "util.hh"
#include "args.hh"
#include "args/root.hh"
#include "common-args.hh"
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc
index 5fa5deb7c..97ba994ad 100644
--- a/src/libstore/build/derivation-goal.cc
+++ b/src/libstore/build/derivation-goal.cc
@@ -5,7 +5,6 @@
#include "builtins/buildenv.hh"
#include "references.hh"
#include "finally.hh"
-#include "util.hh"
#include "archive.hh"
#include "compression.hh"
#include "common-protocol.hh"
diff --git a/src/libstore/common-protocol.cc b/src/libstore/common-protocol.cc
index f906814bc..456ad2b1f 100644
--- a/src/libstore/common-protocol.cc
+++ b/src/libstore/common-protocol.cc
@@ -1,11 +1,8 @@
#include "serialise.hh"
-#include "util.hh"
#include "path-with-outputs.hh"
#include "store-api.hh"
-#include "build-result.hh"
#include "common-protocol.hh"
#include "common-protocol-impl.hh"
-#include "archive.hh"
#include "derivations.hh"
#include <nlohmann/json.hpp>
diff --git a/src/libstore/crypto.hh b/src/libstore/crypto.hh
index 35216d470..22588cf97 100644
--- a/src/libstore/crypto.hh
+++ b/src/libstore/crypto.hh
@@ -1,9 +1,9 @@
#pragma once
///@file
-#include "types.hh"
#include <map>
+#include <string>
namespace nix {
diff --git a/src/libstore/derivations.cc b/src/libstore/derivations.cc
index fef680421..4e70804e5 100644
--- a/src/libstore/derivations.cc
+++ b/src/libstore/derivations.cc
@@ -3,7 +3,6 @@
#include "store-api.hh"
#include "globals.hh"
#include "types.hh"
-#include "util.hh"
#include "split.hh"
#include "common-protocol.hh"
#include "common-protocol-impl.hh"
diff --git a/src/libstore/derived-path.hh b/src/libstore/derived-path.hh
index 4d7033df2..c87cf2004 100644
--- a/src/libstore/derived-path.hh
+++ b/src/libstore/derived-path.hh
@@ -1,7 +1,7 @@
#pragma once
///@file
-#include "util.hh"
+#include "config.hh"
#include "path.hh"
#include "outputs-spec.hh"
#include "comparator.hh"
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc
index dc656f444..cc1656a17 100644
--- a/src/libstore/filetransfer.cc
+++ b/src/libstore/filetransfer.cc
@@ -19,7 +19,6 @@
#include <algorithm>
#include <cmath>
#include <cstring>
-#include <iostream>
#include <queue>
#include <random>
#include <thread>
diff --git a/src/libstore/filetransfer.hh b/src/libstore/filetransfer.hh
index 3f55995ef..c692f1485 100644
--- a/src/libstore/filetransfer.hh
+++ b/src/libstore/filetransfer.hh
@@ -1,8 +1,9 @@
#pragma once
///@file
+#include "logging.hh"
+#include "serialise.hh"
#include "types.hh"
-#include "hash.hh"
#include "config.hh"
#include <string>
diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc
index 722452b8d..d58e3c8eb 100644
--- a/src/libstore/gc.cc
+++ b/src/libstore/gc.cc
@@ -1,18 +1,14 @@
-#include "derivations.hh"
#include "globals.hh"
#include "local-store.hh"
+#include "pathlocks.hh"
#include "processes.hh"
#include "signals.hh"
#include "finally.hh"
#include "unix-domain-socket.hh"
-#include <functional>
#include <queue>
-#include <algorithm>
#include <regex>
-#include <random>
-#include <climits>
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 8ef25c469..993a8cfa5 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -1,14 +1,15 @@
#include "environment-variables.hh"
#include "globals.hh"
+#include "file-system.hh"
+#include "logging.hh"
+#include "strings.hh"
#include "users.hh"
-#include "archive.hh"
#include "args.hh"
#include "abstract-setting-to-json.hh"
#include "compute-levels.hh"
#include "current-process.hh"
#include <algorithm>
-#include <map>
#include <mutex>
#include <thread>
#include <dlfcn.h>
diff --git a/src/libstore/local-store.hh b/src/libstore/local-store.hh
index 14f024ca9..808fdc202 100644
--- a/src/libstore/local-store.hh
+++ b/src/libstore/local-store.hh
@@ -3,11 +3,9 @@
#include "sqlite.hh"
-#include "pathlocks.hh"
#include "store-api.hh"
#include "indirect-root-store.hh"
#include "sync.hh"
-#include "util.hh"
#include <chrono>
#include <future>
diff --git a/src/libstore/nar-info-disk-cache.cc b/src/libstore/nar-info-disk-cache.cc
index 0413abbf1..169b63819 100644
--- a/src/libstore/nar-info-disk-cache.cc
+++ b/src/libstore/nar-info-disk-cache.cc
@@ -1,4 +1,5 @@
#include "nar-info-disk-cache.hh"
+#include "logging.hh"
#include "sync.hh"
#include "sqlite.hh"
#include "globals.hh"
diff --git a/src/libstore/optimise-store.cc b/src/libstore/optimise-store.cc
index e09072e90..4f02296c3 100644
--- a/src/libstore/optimise-store.cc
+++ b/src/libstore/optimise-store.cc
@@ -1,4 +1,3 @@
-#include "util.hh"
#include "local-store.hh"
#include "globals.hh"
#include "signals.hh"
diff --git a/src/libstore/outputs-spec.cc b/src/libstore/outputs-spec.cc
index 4422bcd21..0d740c324 100644
--- a/src/libstore/outputs-spec.cc
+++ b/src/libstore/outputs-spec.cc
@@ -5,7 +5,6 @@
#include "outputs-spec.hh"
#include "path-regex.hh"
#include "strings.hh"
-#include "util.hh"
namespace nix {
diff --git a/src/libstore/path-references.cc b/src/libstore/path-references.cc
index 33cf66ce3..8a02e9006 100644
--- a/src/libstore/path-references.cc
+++ b/src/libstore/path-references.cc
@@ -1,12 +1,8 @@
#include "path-references.hh"
#include "hash.hh"
-#include "util.hh"
#include "archive.hh"
#include <map>
-#include <cstdlib>
-#include <mutex>
-#include <algorithm>
namespace nix {
diff --git a/src/libstore/pathlocks.cc b/src/libstore/pathlocks.cc
index 3e654c1c9..ced0f30bb 100644
--- a/src/libstore/pathlocks.cc
+++ b/src/libstore/pathlocks.cc
@@ -1,10 +1,8 @@
#include "pathlocks.hh"
-#include "util.hh"
+#include "logging.hh"
#include "signals.hh"
-#include "sync.hh"
#include <cerrno>
-#include <cstdlib>
#include <fcntl.h>
#include <sys/types.h>
diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc
index 22d87b027..93b1afabd 100644
--- a/src/libstore/remote-store.cc
+++ b/src/libstore/remote-store.cc
@@ -1,5 +1,4 @@
#include "serialise.hh"
-#include "util.hh"
#include "signals.hh"
#include "path-with-outputs.hh"
#include "gc-store.hh"
diff --git a/src/libstore/serve-protocol.cc b/src/libstore/serve-protocol.cc
index 2e15d28d5..603137c81 100644
--- a/src/libstore/serve-protocol.cc
+++ b/src/libstore/serve-protocol.cc
@@ -1,11 +1,9 @@
#include "serialise.hh"
-#include "util.hh"
#include "path-with-outputs.hh"
#include "store-api.hh"
#include "build-result.hh"
#include "serve-protocol.hh"
#include "serve-protocol-impl.hh"
-#include "archive.hh"
#include "path-info.hh"
#include <nlohmann/json.hpp>
diff --git a/src/libstore/sqlite.cc b/src/libstore/sqlite.cc
index 4bd425b46..f40217734 100644
--- a/src/libstore/sqlite.cc
+++ b/src/libstore/sqlite.cc
@@ -1,12 +1,11 @@
#include "sqlite.hh"
#include "globals.hh"
-#include "util.hh"
+#include "logging.hh"
#include "signals.hh"
#include "url.hh"
#include <sqlite3.h>
-#include <atomic>
namespace nix {
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc
index c5631dfd8..eb9b5c3ef 100644
--- a/src/libstore/store-api.cc
+++ b/src/libstore/store-api.cc
@@ -1,9 +1,7 @@
-#include "crypto.hh"
#include "fs-accessor.hh"
#include "globals.hh"
#include "derivations.hh"
#include "store-api.hh"
-#include "util.hh"
#include "nar-info-disk-cache.hh"
#include "thread-pool.hh"
#include "url.hh"
diff --git a/src/libstore/store-api.hh b/src/libstore/store-api.hh
index 745fce594..397ebe759 100644
--- a/src/libstore/store-api.hh
+++ b/src/libstore/store-api.hh
@@ -1,6 +1,7 @@
#pragma once
///@file
+#include "logging.hh"
#include "nar-info.hh"
#include "realisation.hh"
#include "path.hh"
diff --git a/src/libstore/worker-protocol.cc b/src/libstore/worker-protocol.cc
index ad94c79ee..d76a8d2b8 100644
--- a/src/libstore/worker-protocol.cc
+++ b/src/libstore/worker-protocol.cc
@@ -1,5 +1,4 @@
#include "serialise.hh"
-#include "util.hh"
#include "path-with-outputs.hh"
#include "store-api.hh"
#include "build-result.hh"
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index c3f39d4b3..1b42ee4b5 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -13,8 +13,8 @@
#include "archive.hh"
#include "file-system.hh"
-#include "util.hh"
#include "config.hh"
+#include "logging.hh"
#include "signals.hh"
namespace nix {
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index bcff653c5..4983e49af 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -5,6 +5,7 @@
#include "environment-variables.hh"
#include "experimental-features-json.hh"
+#include "logging.hh"
#include <glob.h>
diff --git a/src/libutil/args.hh b/src/libutil/args.hh
index 77f7ff2a8..35a5238c0 100644
--- a/src/libutil/args.hh
+++ b/src/libutil/args.hh
@@ -1,13 +1,17 @@
#pragma once
///@file
-#include <iostream>
+#include "experimental-features.hh"
+#include "types.hh"
+#include <functional>
#include <map>
#include <memory>
+#include <limits>
#include <nlohmann/json_fwd.hpp>
+#include <optional>
+#include <set>
-#include "util.hh"
namespace nix {
diff --git a/src/libutil/comparator.hh b/src/libutil/comparator.hh
index cbc2bb4fd..136a3f742 100644
--- a/src/libutil/comparator.hh
+++ b/src/libutil/comparator.hh
@@ -1,6 +1,8 @@
#pragma once
///@file
+#include <tuple>
+
#define DECLARE_ONE_CMP(PRE, QUAL, COMPARATOR, MY_TYPE) \
PRE bool QUAL operator COMPARATOR(const MY_TYPE & other) const;
#define DECLARE_EQUAL(prefix, qualification, my_type) \
diff --git a/src/libutil/compression.cc b/src/libutil/compression.cc
index 575a03712..678557a58 100644
--- a/src/libutil/compression.cc
+++ b/src/libutil/compression.cc
@@ -1,7 +1,5 @@
#include "compression.hh"
#include "tarfile.hh"
-#include "util.hh"
-#include "finally.hh"
#include "signals.hh"
#include "logging.hh"
@@ -13,7 +11,6 @@
#include <brotli/decode.h>
#include <brotli/encode.h>
-#include <iostream>
namespace nix {
diff --git a/src/libutil/config-impl.hh b/src/libutil/config-impl.hh
index 9f69e8444..756175f95 100644
--- a/src/libutil/config-impl.hh
+++ b/src/libutil/config-impl.hh
@@ -12,7 +12,9 @@
* instantiation.
*/
+#include "args.hh"
#include "config.hh"
+#include "logging.hh"
namespace nix {
diff --git a/src/libutil/config.cc b/src/libutil/config.cc
index 729b4e596..8180886ce 100644
--- a/src/libutil/config.cc
+++ b/src/libutil/config.cc
@@ -3,6 +3,7 @@
#include "abstract-setting-to-json.hh"
#include "experimental-features.hh"
#include "file-system.hh"
+#include "logging.hh"
#include "strings.hh"
#include "config-impl.hh"
diff --git a/src/libutil/error.cc b/src/libutil/error.cc
index 2a7fd3d0e..e5d6a9fa8 100644
--- a/src/libutil/error.cc
+++ b/src/libutil/error.cc
@@ -1,11 +1,11 @@
#include "environment-variables.hh"
#include "error.hh"
+#include "logging.hh"
#include "position.hh"
#include "terminal.hh"
#include <iostream>
#include <optional>
-#include "serialise.hh"
#include <sstream>
namespace nix {
diff --git a/src/libutil/experimental-features.cc b/src/libutil/experimental-features.cc
index 8ebec2956..f1cbfdb16 100644
--- a/src/libutil/experimental-features.cc
+++ b/src/libutil/experimental-features.cc
@@ -2,7 +2,6 @@
// Required for instances of to_json and from_json for ExperimentalFeature
#include "experimental-features-json.hh"
#include "strings.hh"
-#include "util.hh"
#include "nlohmann/json.hpp"
diff --git a/src/libutil/file-descriptor.cc b/src/libutil/file-descriptor.cc
index ec22f17ab..a19ceaf2a 100644
--- a/src/libutil/file-descriptor.cc
+++ b/src/libutil/file-descriptor.cc
@@ -1,5 +1,6 @@
#include "file-system.hh"
#include "finally.hh"
+#include "logging.hh"
#include "serialise.hh"
#include "signals.hh"
diff --git a/src/libutil/file-system.cc b/src/libutil/file-system.cc
index 721bf97e2..d573b22b4 100644
--- a/src/libutil/file-system.cc
+++ b/src/libutil/file-system.cc
@@ -6,6 +6,7 @@
#include "file-descriptor.hh"
#include "file-system.hh"
#include "finally.hh"
+#include "logging.hh"
#include "serialise.hh"
#include "signals.hh"
#include "types.hh"
diff --git a/src/libutil/hash.cc b/src/libutil/hash.cc
index 2c36d9d94..006b5000c 100644
--- a/src/libutil/hash.cc
+++ b/src/libutil/hash.cc
@@ -1,4 +1,3 @@
-#include <iostream>
#include <cstring>
#include <openssl/crypto.h>
@@ -8,8 +7,8 @@
#include "args.hh"
#include "hash.hh"
#include "archive.hh"
+#include "logging.hh"
#include "split.hh"
-#include "util.hh"
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc
index 8d9e18d09..febbfdb55 100644
--- a/src/libutil/logging.cc
+++ b/src/libutil/logging.cc
@@ -1,15 +1,12 @@
#include "environment-variables.hh"
#include "file-descriptor.hh"
#include "logging.hh"
-#include "util.hh"
#include "config.hh"
-#include "source-path.hh"
#include "position.hh"
#include "terminal.hh"
#include <atomic>
#include <nlohmann/json.hpp>
-#include <iostream>
namespace nix {
diff --git a/src/libutil/meson.build b/src/libutil/meson.build
index 64d84c714..96450fbe2 100644
--- a/src/libutil/meson.build
+++ b/src/libutil/meson.build
@@ -110,7 +110,6 @@ libutil_headers = files(
'url-name.hh',
'url.hh',
'users.hh',
- 'util.hh',
'variant-wrapper.hh',
'xml-writer.hh',
)
diff --git a/src/libutil/references.cc b/src/libutil/references.cc
index 7f59b4c09..6189f69b9 100644
--- a/src/libutil/references.cc
+++ b/src/libutil/references.cc
@@ -1,9 +1,7 @@
#include "references.hh"
#include "hash.hh"
-#include "util.hh"
-#include "archive.hh"
+#include "logging.hh"
-#include <map>
#include <cstdlib>
#include <mutex>
#include <algorithm>
diff --git a/src/libutil/serialise.cc b/src/libutil/serialise.cc
index a6cc919d2..3a8a01f16 100644
--- a/src/libutil/serialise.cc
+++ b/src/libutil/serialise.cc
@@ -1,5 +1,4 @@
#include "serialise.hh"
-#include "util.hh"
#include "signals.hh"
#include <cstring>
diff --git a/src/libutil/serialise.hh b/src/libutil/serialise.hh
index e46c5624a..c9294ba2d 100644
--- a/src/libutil/serialise.hh
+++ b/src/libutil/serialise.hh
@@ -5,7 +5,6 @@
#include "strings.hh"
#include "types.hh"
-#include "util.hh"
#include "file-descriptor.hh"
namespace boost::context { struct stack_context; }
diff --git a/src/libutil/signals.cc b/src/libutil/signals.cc
index c0e66f6ed..a94c2802a 100644
--- a/src/libutil/signals.cc
+++ b/src/libutil/signals.cc
@@ -1,5 +1,4 @@
#include "signals.hh"
-#include "util.hh"
#include "error.hh"
#include "sync.hh"
#include "terminal.hh"
diff --git a/src/libutil/signals.hh b/src/libutil/signals.hh
index 71593df95..02f8d2ca3 100644
--- a/src/libutil/signals.hh
+++ b/src/libutil/signals.hh
@@ -1,7 +1,6 @@
#pragma once
/// @file
-#include "types.hh"
#include "error.hh"
#include <sys/types.h>
@@ -12,7 +11,6 @@
#include <atomic>
#include <functional>
-#include <sstream>
namespace nix {
diff --git a/src/libutil/split.hh b/src/libutil/split.hh
index 4ff940eef..5455b6bff 100644
--- a/src/libutil/split.hh
+++ b/src/libutil/split.hh
@@ -4,8 +4,6 @@
#include <optional>
#include <string_view>
-#include "util.hh"
-
namespace nix {
/**
diff --git a/src/libutil/suggestions.cc b/src/libutil/suggestions.cc
index 63dcf84b5..cae52cf29 100644
--- a/src/libutil/suggestions.cc
+++ b/src/libutil/suggestions.cc
@@ -4,6 +4,7 @@
#include <algorithm>
#include <ostream>
+#include <vector>
namespace nix {
diff --git a/src/libutil/suggestions.hh b/src/libutil/suggestions.hh
index 9abf5ee5f..3cac1371e 100644
--- a/src/libutil/suggestions.hh
+++ b/src/libutil/suggestions.hh
@@ -2,8 +2,11 @@
///@file
#include "comparator.hh"
-#include "types.hh"
+
#include <set>
+#include <string_view>
+#include <string>
+#include <variant>
namespace nix {
diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc
index cabb7af9b..760a5a65a 100644
--- a/src/libutil/tarfile.cc
+++ b/src/libutil/tarfile.cc
@@ -2,6 +2,7 @@
#include <archive_entry.h>
#include "file-system.hh"
+#include "logging.hh"
#include "serialise.hh"
#include "tarfile.hh"
diff --git a/src/libutil/thread-pool.cc b/src/libutil/thread-pool.cc
index a25769d9b..0ff83e997 100644
--- a/src/libutil/thread-pool.cc
+++ b/src/libutil/thread-pool.cc
@@ -1,4 +1,5 @@
#include "thread-pool.hh"
+#include "logging.hh"
#include "signals.hh"
namespace nix {
diff --git a/src/libutil/thread-pool.hh b/src/libutil/thread-pool.hh
index 0e09fae97..3db7ce88f 100644
--- a/src/libutil/thread-pool.hh
+++ b/src/libutil/thread-pool.hh
@@ -1,13 +1,12 @@
#pragma once
///@file
+#include "error.hh"
#include "sync.hh"
-#include "util.hh"
#include <queue>
#include <functional>
#include <thread>
-#include <map>
#include <atomic>
namespace nix {
diff --git a/src/libutil/url-name.cc b/src/libutil/url-name.cc
index 7c526752c..12c55db9a 100644
--- a/src/libutil/url-name.cc
+++ b/src/libutil/url-name.cc
@@ -1,4 +1,3 @@
-#include <iostream>
#include <regex>
#include "url-name.hh"
diff --git a/src/libutil/url-name.hh b/src/libutil/url-name.hh
index 3a3f88e76..dabd23ca1 100644
--- a/src/libutil/url-name.hh
+++ b/src/libutil/url-name.hh
@@ -5,9 +5,6 @@
#include <optional>
#include "url.hh"
-#include "url-parts.hh"
-#include "util.hh"
-#include "split.hh"
namespace nix {
diff --git a/src/libutil/util.hh b/src/libutil/util.hh
deleted file mode 100644
index 1066f212a..000000000
--- a/src/libutil/util.hh
+++ /dev/null
@@ -1,40 +0,0 @@
-#pragma once
-///@file
-
-#include "types.hh"
-#include "error.hh"
-#include "logging.hh"
-#include "ansicolor.hh"
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
-#include <dirent.h>
-#include <unistd.h>
-#include <signal.h>
-
-#include <boost/lexical_cast.hpp>
-
-#include <atomic>
-#include <functional>
-#include <map>
-#include <sstream>
-#include <optional>
-
-#ifndef HAVE_STRUCT_DIRENT_D_TYPE
-#define DT_UNKNOWN 0
-#define DT_REG 1
-#define DT_LNK 2
-#define DT_DIR 3
-#endif
-
-namespace nix {
-
-struct Sink;
-struct Source;
-
-
-
-
-
-}
diff --git a/src/nix-build/nix-build.cc b/src/nix-build/nix-build.cc
index f1c7bbfb8..31d4ac9ff 100644
--- a/src/nix-build/nix-build.cc
+++ b/src/nix-build/nix-build.cc
@@ -15,7 +15,6 @@
#include "globals.hh"
#include "current-process.hh"
#include "derivations.hh"
-#include "util.hh"
#include "shared.hh"
#include "path-with-outputs.hh"
#include "eval.hh"
diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc
index f0131a458..530039ac6 100644
--- a/src/nix-env/user-env.cc
+++ b/src/nix-env/user-env.cc
@@ -1,5 +1,4 @@
#include "user-env.hh"
-#include "util.hh"
#include "derivations.hh"
#include "store-api.hh"
#include "path-with-outputs.hh"
diff --git a/src/nix-instantiate/nix-instantiate.cc b/src/nix-instantiate/nix-instantiate.cc
index 3b99b73b4..c0b251ae4 100644
--- a/src/nix-instantiate/nix-instantiate.cc
+++ b/src/nix-instantiate/nix-instantiate.cc
@@ -7,7 +7,6 @@
#include "attr-path.hh"
#include "value-to-xml.hh"
#include "value-to-json.hh"
-#include "util.hh"
#include "store-api.hh"
#include "local-fs-store.hh"
#include "common-eval-args.hh"
diff --git a/src/nix-store/dotgraph.cc b/src/nix-store/dotgraph.cc
index 577cadceb..2c530999b 100644
--- a/src/nix-store/dotgraph.cc
+++ b/src/nix-store/dotgraph.cc
@@ -1,5 +1,4 @@
#include "dotgraph.hh"
-#include "util.hh"
#include "store-api.hh"
#include <iostream>
diff --git a/src/nix-store/graphml.cc b/src/nix-store/graphml.cc
index 439557658..3e789a2d8 100644
--- a/src/nix-store/graphml.cc
+++ b/src/nix-store/graphml.cc
@@ -1,5 +1,4 @@
#include "graphml.hh"
-#include "util.hh"
#include "store-api.hh"
#include "derivations.hh"
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 75d8b6c6d..b38e4f4f8 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -11,7 +11,6 @@
#include "serve-protocol.hh"
#include "serve-protocol-impl.hh"
#include "shared.hh"
-#include "util.hh"
#include "graphml.hh"
#include "legacy.hh"
#include "path-with-outputs.hh"
diff --git a/src/nix/daemon.cc b/src/nix/daemon.cc
index 113e23bd1..f1cc1ee9c 100644
--- a/src/nix/daemon.cc
+++ b/src/nix/daemon.cc
@@ -5,7 +5,6 @@
#include "local-store.hh"
#include "remote-store.hh"
#include "remote-store-connection.hh"
-#include "util.hh"
#include "serialise.hh"
#include "archive.hh"
#include "globals.hh"
diff --git a/src/nix/develop.cc b/src/nix/develop.cc
index b5543447e..cd32bb20a 100644
--- a/src/nix/develop.cc
+++ b/src/nix/develop.cc
@@ -8,7 +8,6 @@
#include "derivations.hh"
#include "progress-bar.hh"
#include "run.hh"
-#include "util.hh"
#include <iterator>
#include <memory>
diff --git a/src/nix/doctor.cc b/src/nix/doctor.cc
index da7a1d7a0..4e1cfe8c0 100644
--- a/src/nix/doctor.cc
+++ b/src/nix/doctor.cc
@@ -6,7 +6,6 @@
#include "shared.hh"
#include "store-api.hh"
#include "local-fs-store.hh"
-#include "util.hh"
#include "worker-protocol.hh"
using namespace nix;
diff --git a/tests/functional/repl_characterization/repl_characterization.cc b/tests/functional/repl_characterization/repl_characterization.cc
index 4cc1e7e37..c91d6c1e3 100644
--- a/tests/functional/repl_characterization/repl_characterization.cc
+++ b/tests/functional/repl_characterization/repl_characterization.cc
@@ -6,12 +6,9 @@
#include <string_view>
#include <unistd.h>
-#include "escape-string.hh"
#include "test-session.hh"
#include "tests/characterization.hh"
#include "tests/cli-literate-parser.hh"
-#include "tests/terminal-code-eater.hh"
-#include "util.hh"
#include "strings.hh"
using namespace std::string_literals;
diff --git a/tests/unit/libcmd/args.cc b/tests/unit/libcmd/args.cc
index 73550dacf..886467ea0 100644
--- a/tests/unit/libcmd/args.cc
+++ b/tests/unit/libcmd/args.cc
@@ -10,7 +10,6 @@
#include "filetransfer.hh"
#include "shared.hh"
#include "store-api.hh"
-#include "util.hh"
constexpr std::string_view INVALID_CHANNEL = "channel:example";
constexpr std::string_view CHANNEL_URL = "https://nixos.org/channels/example/nixexprs.tar.xz";
diff --git a/tests/unit/libstore-support/tests/test-data.hh b/tests/unit/libstore-support/tests/test-data.hh
index 7aa1dd90d..1fec6f912 100644
--- a/tests/unit/libstore-support/tests/test-data.hh
+++ b/tests/unit/libstore-support/tests/test-data.hh
@@ -1,6 +1,6 @@
#pragma once
-#include "util.hh"
+#include "environment-variables.hh"
#include "types.hh"
namespace nix {
diff --git a/tests/unit/libutil-support/tests/characterization.hh b/tests/unit/libutil-support/tests/characterization.hh
index 472fdba3b..db82476da 100644
--- a/tests/unit/libutil-support/tests/characterization.hh
+++ b/tests/unit/libutil-support/tests/characterization.hh
@@ -8,7 +8,6 @@
#include <filesystem>
-#include "util.hh"
#include "types.hh"
namespace nix {
diff --git a/tests/unit/libutil-support/tests/cli-literate-parser.cc b/tests/unit/libutil-support/tests/cli-literate-parser.cc
index 69bf9fb46..f74fe85eb 100644
--- a/tests/unit/libutil-support/tests/cli-literate-parser.cc
+++ b/tests/unit/libutil-support/tests/cli-literate-parser.cc
@@ -3,7 +3,6 @@
#include "escape-char.hh"
#include "libexpr/print.hh"
#include "types.hh"
-#include "util.hh"
#include <ranges>
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/trim.hpp>
@@ -18,7 +17,6 @@
#include "libexpr/print.hh"
#include "shlex.hh"
#include "types.hh"
-#include "util.hh"
#include "strings.hh"
static constexpr const bool DEBUG_PARSER = false;
diff --git a/tests/unit/libutil/logging.cc b/tests/unit/libutil/logging.cc
index 94cbe9c51..f99f49527 100644
--- a/tests/unit/libutil/logging.cc
+++ b/tests/unit/libutil/logging.cc
@@ -2,7 +2,6 @@
#include "logging.hh"
#include "nixexpr.hh"
-#include "util.hh"
#include <fstream>
#include <gtest/gtest.h>
diff --git a/tests/unit/libutil/tests.cc b/tests/unit/libutil/tests.cc
index 324ebd335..9a44ad59b 100644
--- a/tests/unit/libutil/tests.cc
+++ b/tests/unit/libutil/tests.cc
@@ -3,7 +3,6 @@
#include "strings.hh"
#include "types.hh"
#include "terminal.hh"
-#include "util.hh"
#include <gtest/gtest.h>
@@ -11,7 +10,7 @@
namespace nix {
-/* ----------- tests for util.hh ------------------------------------------------*/
+/* ----------- tests for libutil ------------------------------------------------*/
/* ----------------------------------------------------------------------------
* absPath