1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 21:01:16 +02:00

Merge pull request #42 from DeterminateSystems/eelcodolstra/fh-425-give-determinate-nix-its-own-version-number

Show Determinate Nix version number
This commit is contained in:
Eelco Dolstra 2024-11-01 16:04:25 +01:00 committed by GitHub
commit 5f3b40dfcc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 13 additions and 4 deletions

1
.version-determinate Normal file
View file

@ -0,0 +1 @@
0.0.1

View file

@ -158,6 +158,7 @@ in {
fileset = fileset.intersection baseFiles (fileset.unions ([
# For configure
./.version
./.version-determinate
./configure.ac
./m4
# TODO: do we really need README.md? It doesn't seem used in the build.

View file

@ -294,7 +294,7 @@ void parseCmdLine(const std::string & programName, const Strings & args,
void printVersion(const std::string & programName)
{
std::cout << fmt("%1% (Determinate Nix) %2%", programName, nixVersion) << std::endl;
std::cout << fmt("%s (Determinate Nix %s) %s", programName, determinateNixVersion, nixVersion) << std::endl;
if (verbosity > lvlInfo) {
Strings cfg;
#if HAVE_BOEHMGC

View file

@ -273,6 +273,8 @@ Path Settings::getDefaultSSLCertFile()
const std::string nixVersion = PACKAGE_VERSION;
const std::string determinateNixVersion = DETERMINATE_NIX_VERSION;
NLOHMANN_JSON_SERIALIZE_ENUM(SandboxMode, {
{SandboxMode::smEnabled, true},
{SandboxMode::smRelaxed, "relaxed"},

View file

@ -1247,6 +1247,8 @@ std::vector<Path> getUserConfigFiles();
extern const std::string nixVersion;
extern const std::string determinateNixVersion;
/**
* @param loadConfig Whether to load configuration from `nix.conf`, `NIX_CONFIG`, etc. May be disabled for unit tests.
* @note When using libexpr, and/or libmain, This is not sufficient. See initNix().

View file

@ -73,7 +73,8 @@ libstore_CXXFLAGS += \
-DNIX_CONF_DIR=\"$(NIX_ROOT)$(sysconfdir)/nix\" \
-DNIX_BIN_DIR=\"$(NIX_ROOT)$(bindir)\" \
-DNIX_MAN_DIR=\"$(NIX_ROOT)$(mandir)\" \
-DLSOF=\"$(NIX_ROOT)$(lsof)\"
-DLSOF=\"$(NIX_ROOT)$(lsof)\" \
-DDETERMINATE_NIX_VERSION=\""$(shell cat ./.version-determinate)"\"
ifeq ($(embedded_sandbox_shell),yes)
libstore_CXXFLAGS += -DSANDBOX_SHELL=\"__embedded_sandbox_shell__\"

View file

@ -12,6 +12,8 @@ project('nix-store', 'cpp',
license : 'LGPL-2.1-or-later',
)
fs = import('fs')
cxx = meson.get_compiler('cpp')
subdir('build-utils-meson/deps-lists')
@ -21,6 +23,8 @@ configdata = configuration_data()
# TODO rename, because it will conflict with downstream projects
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())
configdata.set_quoted('DETERMINATE_NIX_VERSION', fs.read('./.version-determinate'))
configdata.set_quoted('SYSTEM', host_machine.system())
deps_private_maybe_subproject = [
@ -320,8 +324,6 @@ else
subdir('unix')
endif
fs = import('fs')
prefix = get_option('prefix')
# For each of these paths, assume that it is relative to the prefix unless
# it is already an absolute path (which is the default for store-dir, state-dir, and log-dir).