Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
a5deed3
docs: add another equivalence for the implication operator
gwennlbh May 19, 2025
9106a0b
nix-profile{,-daemon}.fish: check for profile in XDG_DATA_HOME
stefanboca May 21, 2025
709349b
export/meson: Don't require `-std=c++2a` for -c libraries in `.pc` files
xokdvium May 23, 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
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
0c3bde7
Merge of #13594
mergify[bot] Jul 30, 2025
f77d386
Merge of #13586
mergify[bot] Jul 30, 2025
11fe714
Merge of #13602
mergify[bot] Jul 30, 2025
203be3c
Merge of #13592
mergify[bot] Jul 30, 2025
b204f4a
Merge of #13596
mergify[bot] Jul 30, 2025
1da4b61
Merge of #13637
mergify[bot] Jul 30, 2025
909f54d
Merge of #13641
mergify[bot] Jul 30, 2025
1cde337
Merge of #13639
mergify[bot] Jul 30, 2025
80ba0ed
Merge of #13618
mergify[bot] Jul 30, 2025
65652a0
Merge of #13635
mergify[bot] Jul 30, 2025
f20e459
Merge of #13626
mergify[bot] Jul 30, 2025
86af940
Merge of #13628
mergify[bot] Jul 30, 2025
f370b60
Merge of #13620
mergify[bot] Jul 30, 2025
dc8f4d6
Merge of #13646
mergify[bot] Jul 30, 2025
5c80b89
Merge of #13610
mergify[bot] Jul 30, 2025
e40f0d0
Merge of #13633
mergify[bot] Jul 30, 2025
0a875bc
Merge of #13612
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
2 changes: 1 addition & 1 deletion doc/manual/source/store/derivation/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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
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/nixos/s3-binary-cache-store.nix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ in
# Create a binary cache.
server.wait_for_unit("minio")
server.wait_for_unit("network-addresses-eth1.service")
server.wait_for_open_port(9000)

server.succeed("mc config host add minio http://localhost:9000 ${accessKey} ${secretKey} --api s3v4")
server.succeed("mc mb minio/my-cache")
Expand Down
Loading