Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
9106a0b
nix-profile{,-daemon}.fish: check for profile in XDG_DATA_HOME
stefanboca May 21, 2025
78ac959
Make the S3 test more robust
edolstra May 23, 2025
ee39380
nix flake archive: add --no-check-sigs option
zimbatm May 27, 2025
4d9d307
tests/functional: Add more language tests for builtins.match
xokdvium May 27, 2025
82fa307
Overriding gtest with gmock
fzakaria May 31, 2025
ed7ebdf
add documentation of tarball-ttl to nix-channel
donottellmetonottellyou May 31, 2025
44a1e7e
remove overly verbose mention of fetchTarball
donottellmetonottellyou Jun 1, 2025
7d17042
add reference to the tarball-ttl documentation
donottellmetonottellyou Jun 1, 2025
d7ed708
Modify docker.nix to use mapAttrsToList instead of mapAttrsFlatten
poperigby Jun 3, 2025
bb0e9b2
Prevent double copy of nixpkgs source tree
edolstra Jun 5, 2025
e0ceebe
Fix broken link in configuration description
lucperkins Jun 11, 2025
a98f742
docker: make sure `nix config check` works
drupol Jun 12, 2025
223d322
libexpr: Remove non-const overload of `listElems`
xokdvium Jun 12, 2025
e3f4cef
Fix a minor typo
jayeshv Jun 13, 2025
229e971
libstore: fix race condition when creating state directories
wolfgangwalther Jun 17, 2025
27a8b45
Fix typo
synalice Jun 18, 2025
5d58ab8
Fix broken link
synalice Jun 18, 2025
ceb4d56
Update docs
synalice Jun 20, 2025
c9ecc99
Fix link
egorkonovalov Jun 23, 2025
87ee442
libstore-tests: Don't leak memory in tests
xokdvium Jun 24, 2025
912fef5
Merge of #13602
mergify[bot] Jul 30, 2025
6ce126d
Merge of #13592
mergify[bot] Jul 30, 2025
42770eb
Merge of #13596
mergify[bot] Jul 30, 2025
41d33cc
Merge of #13637
mergify[bot] Jul 30, 2025
1f2cda2
Merge of #13641
mergify[bot] Jul 30, 2025
3d51d35
Merge of #13639
mergify[bot] Jul 30, 2025
6a50f27
Merge of #13618
mergify[bot] Jul 30, 2025
48fe85d
Merge of #13635
mergify[bot] Jul 30, 2025
5102765
Merge of #13626
mergify[bot] Jul 30, 2025
642b63a
Merge of #13628
mergify[bot] Jul 30, 2025
3e760cf
Merge of #13620
mergify[bot] Jul 30, 2025
b368b2b
Merge of #13646
mergify[bot] Jul 30, 2025
7787697
Merge of #13610
mergify[bot] Jul 30, 2025
a8c93b5
Merge of #13633
mergify[bot] Jul 30, 2025
418e8cf
Merge of #13612
mergify[bot] Jul 30, 2025
1cd17ba
Merge of #13605
mergify[bot] Jul 30, 2025
a88711d
Merge of #13650
mergify[bot] Jul 30, 2025
37f64df
Merge of #13648
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
4 changes: 2 additions & 2 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
4 changes: 2 additions & 2 deletions doc/manual/source/store/store-object.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ In particular, the edge corresponding to a reference is from the store object th
References other than a self-reference must not form a cycle.
The graph of references excluding self-references thus forms a [directed acyclic graph].

[directed acyclic graph]: @docroot@/glossary.md#gloss-directed acyclic graph
[directed acyclic graph]: @docroot@/glossary.md#gloss-directed-acyclic-graph

We can take the [transitive closure] of the references graph, which any pair of store objects have an edge not if there is a single reference from the first to the second, but a path of one or more references from the first to the second.
The *requisites* of a store object are all store objects reachable by paths of references which start with given store object's references.

[transitive closure]: https://en.wikipedia.org/wiki/Transitive_closure

We can also take the [transpose graph] ofthe references graph, where we reverse the orientation of all edges.
We can also take the [transpose graph] of the references graph, where we reverse the orientation of all edges.
The *referrers* of a store object are the store objects that reference it.

[transpose graph]: https://en.wikipedia.org/wiki/Transpose_graph
Expand Down
12 changes: 8 additions & 4 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 Expand Up @@ -275,7 +280,6 @@ let

ln -s ${profile} $out/nix/var/nix/profiles/default-1-link
ln -s /nix/var/nix/profiles/default-1-link $out/nix/var/nix/profiles/default
ln -s /nix/var/nix/profiles/default $out${userHome}/.nix-profile

ln -s ${channel} $out/nix/var/nix/profiles/per-user/${uname}/channels-1-link
ln -s /nix/var/nix/profiles/per-user/${uname}/channels-1-link $out/nix/var/nix/profiles/per-user/${uname}/channels
Expand Down Expand Up @@ -327,7 +331,7 @@ pkgs.dockerTools.buildLayeredImageWithNixDb {
'';

config = {
Cmd = [ "${userHome}/.nix-profile/bin/bash" ];
Cmd = [ (lib.getExe pkgs.bashInteractive) ];
User = "${toString uid}:${toString gid}";
Env = [
"USER=${uname}"
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 @@ -23,7 +23,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 @@ -23,7 +23,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
5 changes: 0 additions & 5 deletions src/libexpr/include/nix/expr/value.hh
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,6 @@ public:
return internalType == tList1 || internalType == tList2 || internalType == tListN;
}

Value * const * listElems()
{
return internalType == tList1 || internalType == tList2 ? payload.smallList : payload.bigList.elems;
}

std::span<Value * const> listItems() const
{
assert(isList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public:
Store * store;
std::string nixDir;
std::string nixStoreDir;
std::string nixStateDir;
std::string nixLogDir;

protected:
void init_local_store()
Expand All @@ -54,11 +56,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
2 changes: 1 addition & 1 deletion src/libstore/local-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ LocalStore::LocalStore(ref<const Config> config)
Path gcRootsDir = config->stateDir + "/gcroots";
if (!pathExists(gcRootsDir)) {
createDirs(gcRootsDir);
createSymlink(profilesDir, gcRootsDir + "/profiles");
replaceSymlink(profilesDir, gcRootsDir + "/profiles");
}

for (auto & perUserDir : {profilesDir + "/per-user", gcRootsDir + "/per-user"}) {
Expand Down
12 changes: 11 additions & 1 deletion src/nix/flake.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,10 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
{
std::string dstUri;

CheckSigsFlag checkSigs = CheckSigs;

SubstituteFlag substitute = NoSubstitute;

CmdFlakeArchive()
{
addFlag({
Expand All @@ -1027,6 +1031,11 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun
.labels = {"store-uri"},
.handler = {&dstUri},
});
addFlag({
.longName = "no-check-sigs",
.description = "Do not require that paths are signed by trusted keys.",
.handler = {&checkSigs, NoCheckSigs},
});
}

std::string description() override
Expand Down Expand Up @@ -1087,7 +1096,8 @@ struct CmdFlakeArchive : FlakeCommand, MixJSON, MixDryRun

if (!dryRun && !dstUri.empty()) {
ref<Store> dstStore = dstUri.empty() ? openStore() : openStore(dstUri);
copyPaths(*store, *dstStore, sources);

copyPaths(*store, *dstStore, sources, NoRepair, checkSigs, substitute);
}
}
};
Expand Down
1 change: 1 addition & 0 deletions tests/functional/lang/eval-okay-regex-match2.exp
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ null null null null null null null null null null [ ] [ ] null null null null [ "gnu" "m4/m4-1.4.19.tar.bz2" ] null [ "cpan" "src/5.0/perl-5.40.0.tar.gz" ] null null null [ "10" "" ] [ "11" "" ] [ "36" ] null [ "exec" ] [ ] null [ "26" ] null [ "26" ] null [ ] null null null null null [ "meson.patch?h=mingw-w64-xorgproto&id=7b817efc3144a50e6766817c4ca7242f8ce49307" ] null null [ "xmlto" ] null null [ "exec" ] null null [ ] [ ] null null [ "coconutbattery-4.0.2,152" ] [ "12" "0" ] [ "12" "8" ] [ "8" "9" "5" "30" ] [ "9" "7" "1" "26" ] null null [ ] [ ] null [ ] null [ ] null null [ null null "draupnir" ] [ ] [ ] null null [ null null "renderer" ] [ ] [ ] [ null ] null [ null ] null null null [ ] [ ] [ "p" ] [ "p" ] [ "systemtap" ] null [ ] null null [ ] null [ "20220722-71c783507536-b7eae18423ef" ] [ "20220726-bac6d66b5ca1-5b966f2f136c" ] [ ] [ "0.3.2308" ] null null null [ "17.0.14+" "7" ] null [ null ] [ null ] null null [ "21.0.7+" "6" ] null null [ ] [ ] [ "8u442" "06" ] [ ] [ "jna" "5.6.0" null null ] [ "jna" "5.6.0" null null ] [ ] [ ] null [ "2" ] null [ ] [ ] null null [ ] [ ] null null [ ] null [ ] [ "https://github.com/GRA0007/google-cloud-rs.git" null null null "4a2db92efd57a896e14d18877458c6ae43418aec" ] [ "https://github.com/GRA0007/google-cloud-rs.git" null null null "4a2db92efd57a896e14d18877458c6ae43418aec" ] null [ ] null [ "rejeep" "ansi.el" ] null [ "rejeep" "commander.el" ] null [ "2.2.4" "20231021.200112" "6" ] [ "2.2.4" "20231021.200112" "6" ] [ ] [ ] null null [ "" ] [ "" ".git" ] [ "" "\\.git" ] null null null [ "" "__pycache__" ] [ "" "__pycache__" ] null null null [ "" ] null null [ ] [ ] [ ] [ "8u442" "06" ] [ ] [ ] [ "simulator" ] null null null null null null [ "notify-send" ] [ "playlistmanager" ] [ ] [ ] null null null null [ "name" ] [ "name" ] null null null null [ "pypy" "27" ] [ "pypy" "310" ] [ "refs/heads/master" ] null [ "refs/heads/master" ] null null [ ] null null null null [ ] [ ] [ ] [ ] [ "b7eae18423ef" ] [ "20220726-bac6d66b5ca1-5b966f2f136c" ] null null [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ "" ] [ ] ]
Loading
Loading