-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
- Loading branch information
1 parent
776d901
commit f585887
Showing
23 changed files
with
153 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "flake-settings.hh" | ||
#include "config-global.hh" | ||
|
||
namespace nix { | ||
|
||
FlakeSettings::FlakeSettings() | ||
{ | ||
} | ||
|
||
FlakeSettings flakeSettings; | ||
|
||
static GlobalConfig::Register rFlakeSettings(&flakeSettings); | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#pragma once | ||
///@file | ||
|
||
#include "types.hh" | ||
#include "config.hh" | ||
#include "util.hh" | ||
|
||
#include <map> | ||
#include <limits> | ||
|
||
#include <sys/types.h> | ||
|
||
namespace nix { | ||
|
||
struct FlakeSettings : public Config | ||
{ | ||
FlakeSettings(); | ||
|
||
Setting<bool> useRegistries{this, true, "use-registries", | ||
"Whether to use flake registries to resolve flake references.", | ||
{}, true, Xp::Flakes}; | ||
|
||
Setting<bool> acceptFlakeConfig{this, false, "accept-flake-config", | ||
"Whether to accept nix configuration from a flake without prompting.", | ||
{}, true, Xp::Flakes}; | ||
|
||
Setting<std::string> commitLockFileSummary{ | ||
this, "", "commit-lockfile-summary", | ||
R"( | ||
The commit summary to use when committing changed flake lock files. If | ||
empty, the summary is generated based on the action performed. | ||
)", | ||
{}, true, Xp::Flakes}; | ||
}; | ||
|
||
// TODO: don't use a global variable. | ||
extern FlakeSettings flakeSettings; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
libraries += libflake | ||
|
||
libflake_NAME = libnixflake | ||
|
||
libflake_DIR := $(d) | ||
|
||
libflake_SOURCES := $(wildcard $(d)/*.cc $(d)/flake/*.cc) | ||
|
||
# Not just for this library itself, but also for downstream libraries using this library | ||
|
||
INCLUDE_libflake := -I $(d) | ||
|
||
libflake_CXXFLAGS += $(INCLUDE_libutil) $(INCLUDE_libstore) $(INCLUDE_libfetchers) $(INCLUDE_libexpr) $(INCLUDE_libflake) | ||
|
||
libflake_LDFLAGS += $(THREAD_LDFLAGS) | ||
|
||
libflake_LIBS = libutil libstore libfetchers libexpr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
check: libflake-tests_RUN | ||
|
||
programs += libflake-tests | ||
|
||
libflake-tests_NAME := libnixflake-tests | ||
|
||
libflake-tests_ENV := _NIX_TEST_UNIT_DATA=$(d)/data GTEST_OUTPUT=xml:$$testresults/libflake-tests.xml | ||
|
||
libflake-tests_DIR := $(d) | ||
|
||
ifeq ($(INSTALL_UNIT_TESTS), yes) | ||
libflake-tests_INSTALL_DIR := $(checkbindir) | ||
else | ||
libflake-tests_INSTALL_DIR := | ||
endif | ||
|
||
libflake-tests_SOURCES := \ | ||
$(wildcard $(d)/*.cc) \ | ||
$(wildcard $(d)/value/*.cc) \ | ||
$(wildcard $(d)/flake/*.cc) | ||
|
||
libflake-tests_EXTRA_INCLUDES = \ | ||
-I tests/unit/libflake-support \ | ||
-I tests/unit/libstore-support \ | ||
-I tests/unit/libutil-support \ | ||
$(INCLUDE_libflake) \ | ||
$(INCLUDE_libexpr) \ | ||
$(INCLUDE_libfetchers) \ | ||
$(INCLUDE_libstore) \ | ||
$(INCLUDE_libutil) \ | ||
|
||
libflake-tests_CXXFLAGS += $(libflake-tests_EXTRA_INCLUDES) | ||
|
||
libflake-tests_LIBS = \ | ||
libexpr-test-support libstore-test-support libutil-test-support \ | ||
libflake libexpr libfetchers libstore libutil | ||
|
||
libflake-tests_LDFLAGS := -lrapidcheck $(GTEST_LIBS) -lgmock | ||
|
||
ifdef HOST_WINDOWS | ||
# Increase the default reserved stack size to 65 MB so Nix doesn't run out of space | ||
libflake-tests_LDFLAGS += -Wl,--stack,$(shell echo $$((65 * 1024 * 1024))) | ||
endif |
File renamed without changes.