Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packaging/dev-shell.nix
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ pkgs.nixComponents2.nix-util.overrideAttrs (
(pkgs.writeScriptBin "pre-commit-hooks-install" modular.pre-commit.settings.installationScript)
pkgs.buildPackages.nixfmt-rfc-style
pkgs.buildPackages.shellcheck
pkgs.buildPackages.include-what-you-use
pkgs.buildPackages.gdb
]
++ lib.optional (stdenv.cc.isClang && stdenv.hostPlatform == stdenv.buildPlatform) (
Expand Down
7 changes: 7 additions & 0 deletions src/libflake-tests/flakeref.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
#include <gtest/gtest.h>
#include <set>
#include <string>
#include <utility>

#include "nix/fetchers/fetch-settings.hh"
#include "nix/flake/flakeref.hh"
#include "nix/fetchers/attrs.hh"
#include "nix/fetchers/fetchers.hh"
#include "nix/util/configuration.hh"
#include "nix/util/error.hh"
#include "nix/util/experimental-features.hh"

namespace nix {

Expand Down
12 changes: 7 additions & 5 deletions src/libflake-tests/nix_api_flake.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
#include <gtest/gtest.h>
#include <filesystem>
#include <string>

#include "nix/util/file-system.hh"
#include "nix_api_store.h"
#include "nix_api_util.h"
#include "nix_api_expr.h"
#include "nix_api_value.h"
#include "nix_api_flake.h"

#include "nix/expr/tests/nix_api_expr.hh"
#include "nix/util/tests/string_callback.hh"

#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "nix/store/tests/nix_api_store.hh"
#include "nix/util/tests/nix_api_util.hh"
#include "nix_api_fetchers.h"

namespace nixC {

Expand Down
4 changes: 3 additions & 1 deletion src/libflake-tests/url-name.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "nix/flake/url-name.hh"
#include <gtest/gtest.h>

#include "nix/flake/url-name.hh"
#include "nix/util/url.hh"

namespace nix {

/* ----------- tests for url-name.hh --------------------------------------------------*/
Expand Down
25 changes: 23 additions & 2 deletions src/libflake/config.cc
Original file line number Diff line number Diff line change
@@ -1,9 +1,30 @@
#include <nlohmann/json.hpp>
#include <assert.h>
#include <stdint.h>
#include <nlohmann/json_fwd.hpp>
#include <cctype>
#include <filesystem>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <variant>
#include <vector>
#include <format>

#include "nix/util/users.hh"
#include "nix/util/config-global.hh"
#include "nix/flake/settings.hh"
#include "nix/flake/flake.hh"

#include <nlohmann/json.hpp>
#include "nix/util/ansicolor.hh"
#include "nix/util/configuration.hh"
#include "nix/util/file-system.hh"
#include "nix/util/fmt.hh"
#include "nix/util/logging.hh"
#include "nix/util/strings.hh"
#include "nix/util/types.hh"
#include "nix/util/util.hh"

namespace nix::flake {

Expand Down
26 changes: 26 additions & 0 deletions src/libflake/flake-primops.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,34 @@
#include <stdint.h>
#include <functional>
#include <map>
#include <optional>
#include <set>
#include <string>
#include <utility>
#include <variant>
#include <vector>

#include "nix/flake/flake-primops.hh"
#include "nix/expr/eval.hh"
#include "nix/flake/flake.hh"
#include "nix/flake/flakeref.hh"
#include "nix/flake/settings.hh"
#include "nix/expr/attr-set.hh"
#include "nix/expr/eval-error.hh"
#include "nix/expr/eval-inline.hh"
#include "nix/expr/eval-settings.hh"
#include "nix/expr/symbol-table.hh"
#include "nix/expr/value.hh"
#include "nix/fetchers/attrs.hh"
#include "nix/fetchers/fetchers.hh"
#include "nix/util/configuration.hh"
#include "nix/util/error.hh"
#include "nix/util/experimental-features.hh"
#include "nix/util/pos-idx.hh"
#include "nix/util/pos-table.hh"
#include "nix/util/source-path.hh"
#include "nix/util/types.hh"
#include "nix/util/util.hh"

namespace nix::flake::primops {

Expand Down
52 changes: 47 additions & 5 deletions src/libflake/flake.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
#include <nlohmann/json.hpp>
#include <assert.h>
#include <stdint.h>
#include <boost/container/detail/std_fwd.hpp>
#include <boost/core/pointer_traits.hpp>
#include <boost/unordered/detail/foa/table.hpp>
#include <algorithm>
#include <filesystem>
#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <set>
#include <span>
#include <string>
#include <tuple>
#include <utility>
#include <variant>
#include <vector>
#include <format>

#include "nix/util/terminal.hh"
#include "nix/util/ref.hh"
#include "nix/util/environment-variables.hh"
Expand All @@ -6,22 +27,43 @@
#include "nix/expr/eval-cache.hh"
#include "nix/expr/eval-settings.hh"
#include "nix/flake/lockfile.hh"
#include "nix/expr/primops.hh"
#include "nix/expr/eval-inline.hh"
#include "nix/store/store-api.hh"
#include "nix/fetchers/fetchers.hh"
#include "nix/util/finally.hh"
#include "nix/fetchers/fetch-settings.hh"
#include "nix/flake/settings.hh"
#include "nix/expr/value-to-json.hh"
#include "nix/store/local-fs-store.hh"
#include "nix/fetchers/fetch-to-store.hh"
#include "nix/util/memory-source-accessor.hh"
#include "nix/fetchers/input-cache.hh"

#include <nlohmann/json.hpp>
#include "nix/expr/attr-set.hh"
#include "nix/expr/eval-error.hh"
#include "nix/expr/nixexpr.hh"
#include "nix/expr/symbol-table.hh"
#include "nix/expr/value.hh"
#include "nix/expr/value/context.hh"
#include "nix/fetchers/attrs.hh"
#include "nix/fetchers/registry.hh"
#include "nix/flake/flakeref.hh"
#include "nix/store/path.hh"
#include "nix/util/canon-path.hh"
#include "nix/util/configuration.hh"
#include "nix/util/error.hh"
#include "nix/util/experimental-features.hh"
#include "nix/util/file-system.hh"
#include "nix/util/fmt.hh"
#include "nix/util/hash.hh"
#include "nix/util/logging.hh"
#include "nix/util/pos-idx.hh"
#include "nix/util/pos-table.hh"
#include "nix/util/position.hh"
#include "nix/util/source-path.hh"
#include "nix/util/types.hh"
#include "nix/util/util.hh"

namespace nix {
struct SourceAccessor;

using namespace flake;

Expand Down Expand Up @@ -865,7 +907,7 @@ static ref<SourceAccessor> makeInternalFS()
internalFS->setPathDisplay("«flakes-internal»", "");
internalFS->addFile(
CanonPath("call-flake.nix"),
#include "call-flake.nix.gen.hh"
#include "call-flake.nix.gen.hh" // IWYU pragma: keep
);
return internalFS;
}
Expand Down
31 changes: 30 additions & 1 deletion src/libflake/flakeref.cc
Original file line number Diff line number Diff line change
@@ -1,10 +1,39 @@
#include <assert.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <filesystem>
#include <ostream>
#include <string_view>
#include <vector>
#include <optional>
#include <regex>
#include <string>
#include <tuple>
#include <utility>

#include "nix/flake/flakeref.hh"
#include "nix/store/store-api.hh"
#include "nix/util/url.hh"
#include "nix/util/url-parts.hh"
#include "nix/fetchers/fetchers.hh"
#include "nix/util/error.hh"
#include "nix/util/file-system.hh"
#include "nix/util/fmt.hh"
#include "nix/util/logging.hh"
#include "nix/util/strings.hh"
#include "nix/util/util.hh"
#include "nix/fetchers/attrs.hh"
#include "nix/fetchers/registry.hh"
#include "nix/store/outputs-spec.hh"
#include "nix/util/ref.hh"
#include "nix/util/types.hh"

namespace nix {
class Store;
struct SourceAccessor;

namespace fetchers {
struct Settings;
} // namespace fetchers

#if 0
// 'dir' path elements cannot start with a '.'. We also reject
Expand Down
7 changes: 6 additions & 1 deletion src/libflake/include/nix/flake/flake-primops.hh
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
#pragma once

#include "nix/expr/eval.hh"
#include "nix/flake/settings.hh"

namespace nix {
namespace flake {
struct Settings;
} // namespace flake
} // namespace nix

namespace nix::flake::primops {

Expand Down
10 changes: 8 additions & 2 deletions src/libflake/include/nix/flake/flakeref.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@
///@file

#include <regex>
#include <iosfwd>
#include <string>
#include <tuple>
#include <utility>

#include "nix/util/types.hh"
#include "nix/fetchers/fetchers.hh"
#include "nix/store/outputs-spec.hh"
#include "nix/fetchers/registry.hh"

namespace nix {

class Store;

namespace fetchers {
struct Settings;
} // namespace fetchers

typedef std::string FlakeId;

/**
Expand Down
5 changes: 3 additions & 2 deletions src/libflake/include/nix/flake/settings.hh
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once
///@file

#include "nix/util/configuration.hh"

#include <sys/types.h>
#include <string>

#include "nix/util/configuration.hh"

namespace nix {
// Forward declarations
Expand Down
7 changes: 3 additions & 4 deletions src/libflake/include/nix/flake/url-name.hh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#include "nix/util/url.hh"
#include "nix/util/url-parts.hh"
#include "nix/util/util.hh"
#include "nix/util/split.hh"
#include <optional>
#include <string>

namespace nix {
struct ParsedURL;

/**
* Try to extract a reasonably unique and meaningful, human-readable
Expand Down
52 changes: 43 additions & 9 deletions src/libflake/lockfile.cc
Original file line number Diff line number Diff line change
@@ -1,15 +1,49 @@
#include "nix/fetchers/fetch-settings.hh"
#include "nix/flake/settings.hh"
#include "nix/flake/lockfile.hh"
#include "nix/store/store-api.hh"
#include "nix/util/strings.hh"

#include <boost/unordered/unordered_flat_set.hpp>
#include <nlohmann/json.hpp>
#include <assert.h>
#include <boost/unordered/unordered_flat_set_fwd.hpp>
#include <nlohmann/detail/iterators/iter_impl.hpp>
#include <nlohmann/detail/iterators/iteration_proxy.hpp>
#include <nlohmann/json_fwd.hpp>
#include <algorithm>
#include <iomanip>

#include <boost/unordered/unordered_flat_set.hpp>
#include <iterator>
#include <nlohmann/json.hpp>
#include <compare>
#include <ctime>
#include <format>
#include <functional>
#include <map>
#include <memory>
#include <optional>
#include <ostream>
#include <regex>
#include <set>
#include <string>
#include <string_view>
#include <utility>
#include <variant>
#include <vector>

#include "nix/fetchers/fetch-settings.hh"
#include "nix/flake/lockfile.hh"
#include "nix/util/strings.hh"
#include "nix/fetchers/attrs.hh"
#include "nix/fetchers/fetchers.hh"
#include "nix/flake/flakeref.hh"
#include "nix/store/path.hh"
#include "nix/util/ansicolor.hh"
#include "nix/util/configuration.hh"
#include "nix/util/error.hh"
#include "nix/util/fmt.hh"
#include "nix/util/hash.hh"
#include "nix/util/logging.hh"
#include "nix/util/ref.hh"
#include "nix/util/types.hh"
#include "nix/util/util.hh"

namespace nix {
class Store;
} // namespace nix

namespace nix::flake {

Expand Down
4 changes: 4 additions & 0 deletions src/libflake/settings.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#include <vector>

#include "nix/flake/settings.hh"
#include "nix/flake/flake-primops.hh"
#include "nix/expr/eval-settings.hh"
#include "nix/expr/eval.hh"

namespace nix::flake {

Expand Down
8 changes: 6 additions & 2 deletions src/libflake/url-name.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#include "nix/flake/url-name.hh"
#include <regex>
#include <iostream>
#include <optional>
#include <string>

#include "nix/flake/url-name.hh"
#include "nix/util/strings.hh"
#include "nix/util/url.hh"

namespace nix {

Expand Down
Loading