Skip to content

docker: make sure nix config check works#13351

Merged
Mic92 merged 2 commits intoNixOS:masterfrom
drupol:push-rrzylpqynznw
Jun 13, 2025
Merged

docker: make sure nix config check works#13351
Mic92 merged 2 commits intoNixOS:masterfrom
drupol:push-rrzylpqynznw

Conversation

@drupol
Copy link
Contributor

@drupol drupol commented Jun 12, 2025

Motivation

This current PR addresses a small issue I encountered during the making of #13354.

When running nix config check inside the official Nix Docker image, the following failure was raised:

bash-5.2# nix config check
[PASS] PATH contains only one nix version.
[FAIL] Found profiles outside of /nix/var/nix/profiles.
The generation this profile points to might not have a gcroot and could be
garbage collected, resulting in broken symlinks.

  "/root/.nix-profile/bin"

[PASS] Client protocol matches store protocol.
[INFO] You are trusted by store uri: local

This PR proposes a fix for that issue. I would appreciate any feedback on the approach, and I am happy to adjust the implementation if needed.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@drupol drupol force-pushed the push-rrzylpqynznw branch from 7b7e194 to 57c72de Compare June 12, 2025 09:01
@drupol drupol marked this pull request as ready for review June 12, 2025 16:19
@drupol drupol requested a review from edolstra as a code owner June 12, 2025 16:19
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/nix-official-docker-image-with-custom-ssl-certificate/65527/3

@Mic92 Mic92 enabled auto-merge June 13, 2025 05:06
@Mic92 Mic92 merged commit 84743c8 into NixOS:master Jun 13, 2025
12 checks passed
@drupol drupol deleted the push-rrzylpqynznw branch June 13, 2025 05:50
@drupol
Copy link
Contributor Author

drupol commented Jun 13, 2025

Thanks!

@roberth roberth added backports created Does not require attention and can be filtered away backport 2.28-maintenance Automatically creates a PR against the branch backport 2.29-maintenance Automatically creates a PR against the branch labels Jul 30, 2025
mergify bot added a commit that referenced this pull request Jul 31, 2025
…3351

docker: make sure `nix config check` works (backport #13351)
mergify bot added a commit that referenced this pull request Jul 31, 2025
…3351

docker: make sure `nix config check` works (backport #13351)
@h0nIg
Copy link
Contributor

h0nIg commented Aug 6, 2025

@drupol i dont know why you removed this line, however i can say that it is causing a loss of all installed profiles. with 2.29 the profile list is not empty, with 2.30 it is empty causing other side effects

$ docker run -ti nixos/nix:2.30.2
bash-5.2# ls -lsa /root/
total 16
4 drwxr-xr-x 3 root root 4096 Jan  1  1980 .
4 drwxr-xr-x 1 root root 4096 Aug  6 18:26 ..
4 lrwxrwxrwx 1 root root   74 Jan  1  1980 .nix-channels -> /nix/store/wb9abgrwawwmdpdkj8jx9j4cnpp93b7h-base-system/root/.nix-channels
4 drwxr-xr-x 2 root root 4096 Jan  1  1980 .nix-defexpr
bash-5.2#
bash-5.2# nix profile list --extra-experimental-features nix-command
bash-5.2#
$ docker run -ti nixos/nix:2.29.1
bash-5.2# ls -lsa /root/
total 16
4 drwxr-xr-x 3 root root 4096 Jan  1  1980 .
4 drwxr-xr-x 1 root root 4096 Aug  6 18:31 ..
4 lrwxrwxrwx 1 root root   74 Jan  1  1980 .nix-channels -> /nix/store/gmkw6bw21s67hf01c93k39wf0dsp9gy7-base-system/root/.nix-channels
4 drwxr-xr-x 2 root root 4096 Jan  1  1980 .nix-defexpr
0 lrwxrwxrwx 1 root root   29 Jan  1  1980 .nix-profile -> /nix/var/nix/profiles/default

bash-5.2# nix profile list --extra-experimental-features nix-command
Name:               bash-interactive
Store paths:        /nix/store/41pi0jiyvlhxgpfhxzvb44w1skc8yp4z-bash-interactive-5.2p37

Name:               coreutils-full
Store paths:        /nix/store/9rf6b6s2cs8r62srk00arcydf8xd59jy-coreutils-full-9.7

.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport 2.28-maintenance Automatically creates a PR against the branch backport 2.29-maintenance Automatically creates a PR against the branch backports created Does not require attention and can be filtered away

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants