Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1e371c4
docs: fix duplicate anchor
pbsds May 16, 2025
7126d57
docs: add another equivalence for the implication operator
gwennlbh May 19, 2025
3a3ee4a
nix-profile{,-daemon}.fish: check for profile in XDG_DATA_HOME
stefanboca May 21, 2025
354d4c4
export/meson: Don't require `-std=c++2a` for -c libraries in `.pc` files
xokdvium May 23, 2025
59da02d
Overriding gtest with gmock
fzakaria May 31, 2025
b320aa5
add documentation of tarball-ttl to nix-channel
donottellmetonottellyou May 31, 2025
ab3ad12
remove overly verbose mention of fetchTarball
donottellmetonottellyou Jun 1, 2025
aace3d9
add reference to the tarball-ttl documentation
donottellmetonottellyou Jun 1, 2025
556b71d
Modify docker.nix to use mapAttrsToList instead of mapAttrsFlatten
poperigby Jun 3, 2025
63f18cd
Prevent double copy of nixpkgs source tree
edolstra Jun 5, 2025
f97ff25
Fix broken link in configuration description
lucperkins Jun 11, 2025
cac6cfe
Fix a minor typo
jayeshv Jun 13, 2025
66a5d4c
Update docs
synalice Jun 20, 2025
01963be
Fix link
egorkonovalov Jun 23, 2025
9af1782
libstore-tests: Don't leak memory in tests
xokdvium Jun 24, 2025
e980bca
Merge of #13591
mergify[bot] Jul 30, 2025
68d078c
Merge of #13585
mergify[bot] Jul 30, 2025
9da6f09
Merge of #13619
mergify[bot] Jul 30, 2025
2293221
Merge of #13609
mergify[bot] Jul 30, 2025
64eb6cb
Merge of #13593
mergify[bot] Jul 30, 2025
92935ac
Merge of #13647
mergify[bot] Jul 30, 2025
c4665cd
Merge of #13634
mergify[bot] Jul 30, 2025
1f47e07
Merge of #13611
mergify[bot] Jul 30, 2025
4a11a0a
Merge of #13645
mergify[bot] Jul 30, 2025
d88c272
Merge of #13625
mergify[bot] Jul 30, 2025
8cf76c2
Merge of #13617
mergify[bot] Jul 30, 2025
23978ac
Merge of #13581
mergify[bot] Jul 30, 2025
cd77c44
Merge of #13649
mergify[bot] Jul 30, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ result-*
.DS_Store

flake-regressions

# direnv
.direnv/
5 changes: 5 additions & 0 deletions doc/manual/source/command-ref/nix-channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ This command has the following operations:
Download the Nix expressions of subscribed channels and create a new generation.
Update all channels if none is specified, and only those included in *names* otherwise.

> **Note**
>
> Downloaded channel contents are cached.
> Use `--tarball-ttl` or the [`tarball-ttl` configuration option](@docroot@/command-ref/conf-file.md#conf-tarball-ttl) to change the validity period of cached downloads.

- `--list-generations`

Prints a list of all the current existing generations for the
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/source/installation/installing-binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ This performs the default type of installation for your platform:

We recommend the multi-user installation if it supports your platform and you can authenticate with `sudo`.

The installer can configured with various command line arguments and environment variables.
The installer can be configured with various command line arguments and environment variables.
To show available command line flags:

```console
Expand Down
2 changes: 1 addition & 1 deletion doc/manual/source/language/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ All comparison operators are implemented in terms of `<`, and the following equi

## Logical implication

Equivalent to `!`*b1* `||` *b2*.
Equivalent to `!`*b1* `||` *b2* (or `if` *b1* `then` *b2* `else true`)

[Logical implication]: #logical-implication

Expand Down
6 changes: 3 additions & 3 deletions doc/manual/source/store/derivation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ There are two types of placeholder, corresponding to the two cases where this pr

> **Explanation**
>
> In general, we need to realise [realise] a [store object] in order to be sure to have a store object for it.
> In general, we need to [realise] a [store object] in order to be sure to have a store object for it.
> But for these two cases this is either impossible or impractical:
>
> - In the output case this is impossible:
Expand All @@ -189,7 +189,7 @@ This ensures that there is a canonical [store path] used to refer to the derivat
> **Note**
>
> Currently, the canonical encoding for every derivation is the "ATerm" format,
> but this is subject to change for types derivations which are not yet stable.
> but this is subject to change for the types of derivations which are not yet stable.

Regardless of the format used, when serializing a derivation to a store object, that store object will be content-addressed.

Expand Down Expand Up @@ -282,7 +282,7 @@ type DerivingPath = ConstantPath | OutputPath;

Under this extended model, `DerivingPath`s are thus inductively built up from a root `ConstantPath`, wrapped with zero or more outer `OutputPath`s.

### Encoding {#deriving-path-encoding}
### Encoding {#deriving-path-encoding-higher-order}

The encoding is adjusted in the natural way, encoding the `drv` field recursively using the same deriving path encoding.
The result of this is that it is possible to have a chain of `^<output-name>` at the end of the final string, as opposed to just a single one.
Expand Down
9 changes: 7 additions & 2 deletions docker.nix
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ let

nixConfContents =
(lib.concatStringsSep "\n" (
lib.mapAttrsFlatten (
lib.mapAttrsToList (
n: v:
let
vStr = if builtins.isList v then lib.concatStringsSep " " v else v;
Expand All @@ -173,7 +173,12 @@ let
channel = pkgs.runCommand "channel-nixos" { inherit bundleNixpkgs; } ''
mkdir $out
if [ "$bundleNixpkgs" ]; then
ln -s ${nixpkgs} $out/nixpkgs
ln -s ${
builtins.path {
path = nixpkgs;
name = "source";
}
} $out/nixpkgs
echo "[]" > $out/manifest.nix
fi
'';
Expand Down
8 changes: 7 additions & 1 deletion nix-meson-build-support/export/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,18 @@ endforeach
requires_public += deps_public

extra_pkg_config_variables = get_variable('extra_pkg_config_variables', {})

extra_cflags = []
if not meson.project_name().endswith('-c')
extra_cflags += ['-std=c++2a']
endif

import('pkgconfig').generate(
this_library,
filebase : meson.project_name(),
name : 'Nix',
description : 'Nix Package Manager',
extra_cflags : ['-std=c++2a'],
extra_cflags : extra_cflags,
requires : requires_public,
requires_private : requires_private,
libraries_private : libraries_private,
Expand Down
28 changes: 27 additions & 1 deletion scripts/nix-profile-daemon.fish.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,33 @@ end

# Set up the per-user profile.

set --local NIX_LINK $HOME/.nix-profile
set --local NIX_LINK "$HOME/.nix-profile"
set --local NIX_LINK_NEW
if test -n "$XDG_STATE_HOME"
set NIX_LINK_NEW "$XDG_STATE_HOME/nix/profile"
else
set NIX_LINK_NEW "$HOME/.local/state/nix/profile"
end
if test -e "$NIX_LINK_NEW"
if test -t 2; and test -e "$NIX_LINK"
set --local warning "\033[1;35mwarning:\033[0m "
printf "$warning Both %s and legacy %s exist; using the former.\n" "$NIX_LINK_NEW" "$NIX_LINK" 1>&2

if test (realpath "$NIX_LINK") = (realpath "$NIX_LINK_NEW")
printf " Since the profiles match, you can safely delete either of them.\n" 1>&2
else
# This should be an exceptionally rare occasion: the only way to get it would be to
# 1. Update to newer Nix;
# 2. Remove .nix-profile;
# 3. Set the $NIX_LINK_NEW to something other than the default user profile;
# 4. Roll back to older Nix.
# If someone did all that, they can probably figure out how to migrate the profile.
printf "$warning Profiles do not match. You should manually migrate from %s to %s.\n" "$NIX_LINK" "$NIX_LINK_NEW" 1>&2
end
end

set NIX_LINK "$NIX_LINK_NEW"
end

# Set up environment.
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
Expand Down
33 changes: 32 additions & 1 deletion scripts/nix-profile.fish.in
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,38 @@ end

# Set up the per-user profile.

set --local NIX_LINK $HOME/.nix-profile
set --local NIX_LINK
if test -n "$NIX_STATE_HOME"
set NIX_LINK "$NIX_STATE_HOME/.nix-profile"
else
set NIX_LINK "$HOME/.nix-profile"
set --local NIX_LINK_NEW
if test -n "$XDG_STATE_HOME"
set NIX_LINK_NEW "$XDG_STATE_HOME/nix/profile"
else
set NIX_LINK_NEW "$HOME/.local/state/nix/profile"
end
if test -e "$NIX_LINK_NEW"
if test -t 2; and test -e "$NIX_LINK"
set --local warning "\033[1;35mwarning:\033[0m "
printf "$warning Both %s and legacy %s exist; using the former.\n" "$NIX_LINK_NEW" "$NIX_LINK" 1>&2

if test (realpath "$NIX_LINK") = (realpath "$NIX_LINK_NEW")
printf " Since the profiles match, you can safely delete either of them.\n" 1>&2
else
# This should be an exceptionally rare occasion: the only way to get it would be to
# 1. Update to newer Nix;
# 2. Remove .nix-profile;
# 3. Set the $NIX_LINK_NEW to something other than the default user profile;
# 4. Roll back to older Nix.
# If someone did all that, they can probably figure out how to migrate the profile.
printf "$warning Profiles do not match. You should manually migrate from %s to %s.\n" "$NIX_LINK" "$NIX_LINK_NEW" 1>&2
end
end

set NIX_LINK "$NIX_LINK_NEW"
end
end

# Set up environment.
# This part should be kept in sync with nixpkgs:nixos/modules/programs/environment.nix
Expand Down
4 changes: 2 additions & 2 deletions src/libexpr-tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ deps_private += rapidcheck
gtest = dependency('gtest')
deps_private += gtest

gtest = dependency('gmock')
deps_private += gtest
gmock = dependency('gmock')
deps_private += gmock

configdata = configuration_data()
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ public:
Store * store;
std::string nixDir;
std::string nixStoreDir;
std::string nixStateDir;
std::string nixLogDir;

protected:
void init_local_store()
Expand All @@ -58,11 +60,13 @@ protected:
#endif

nixStoreDir = nixDir + "/my_nix_store";
nixStateDir = nixDir + "/my_state";
nixLogDir = nixDir + "/my_log";

// Options documented in `nix help-stores`
const char * p1[] = {"store", nixStoreDir.c_str()};
const char * p2[] = {"state", (new std::string(nixDir + "/my_state"))->c_str()};
const char * p3[] = {"log", (new std::string(nixDir + "/my_log"))->c_str()};
const char * p2[] = {"state", nixStateDir.c_str()};
const char * p3[] = {"log", nixLogDir.c_str()};

const char ** params[] = {p1, p2, p3, nullptr};

Expand Down
9 changes: 7 additions & 2 deletions src/libstore-tests/nix_api_store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,21 @@ TEST_F(nix_api_store_test, ReturnsValidStorePath)
ASSERT_NE(result, nullptr);
ASSERT_STREQ("name", result->path.name().data());
ASSERT_STREQ(PATH_SUFFIX.substr(1).c_str(), result->path.to_string().data());
nix_store_path_free(result);
}

TEST_F(nix_api_store_test, SetsLastErrCodeToNixOk)
{
nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str());
StorePath * path = nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str());
ASSERT_EQ(ctx->last_err_code, NIX_OK);
nix_store_path_free(path);
}

TEST_F(nix_api_store_test, DoesNotCrashWhenContextIsNull)
{
ASSERT_NO_THROW(nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str()));
StorePath * path = nullptr;
ASSERT_NO_THROW(path = nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str()));
nix_store_path_free(path);
}

TEST_F(nix_api_store_test, get_version)
Expand Down Expand Up @@ -119,6 +123,7 @@ TEST_F(nix_api_store_test, nix_store_is_valid_path_not_in_store)
{
StorePath * path = nix_store_parse_path(ctx, store, (nixStoreDir + PATH_SUFFIX).c_str());
ASSERT_EQ(false, nix_store_is_valid_path(ctx, store, path));
nix_store_path_free(path);
}

TEST_F(nix_api_store_test, nix_store_real_path)
Expand Down
2 changes: 1 addition & 1 deletion src/libstore/include/nix/store/globals.hh
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ public:

To build only on remote machines and disable local builds, set [`max-jobs`](#conf-max-jobs) to 0.

If you want the remote machines to use substituters, set [`builders-use-substitutes`](#conf-builders-use-substituters) to `true`.
If you want the remote machines to use substituters, set [`builders-use-substitutes`](#conf-builders-use-substitutes) to `true`.
)",
{},
false};
Expand Down
Loading