Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot build simple system configuration in developer shell inside Docker container #6778

Open
lunik1 opened this issue Jul 10, 2022 · 3 comments
Labels

Comments

@lunik1
Copy link

lunik1 commented Jul 10, 2022

Describe the bug

When using a nix develop shell inside the nixos/nix container, a simple system configuration fails to build.

Steps To Reproduce

A MWE can be found in this gist.

  1. Clone the flake in the above gist
  2. Mount the flake in the nixos/nix container with podman run -it --volume ${PWD}:/flake nixos/nix
  3. cd /flake
  4. Start developer shell with nix --extra-experimental-features 'nix-command flakes' develop
  5. Attempt to build the test NixOS configuration with nix --extra-experimental-features 'nix-command flakes' build ".#nixosConfigurations.test.config.system.build.toplevel"
  6. Build fails with:
error: builder for '/nix/store/32d1zpwmnfhkbsklrri9f4c8nsmdb0qz-append-initrd-secrets.drv' failed with exit code 1;
       last 2 log lines:
       > unpacking sources
       > variable $src or $srcs should point to the source
       For full logs, run 'nix log /nix/store/32d1zpwmnfhkbsklrri9f4c8nsmdb0qz-append-initrd-secrets.drv'.
error: 1 dependencies of derivation '/nix/store/0yqg3kg13zd0xch2gzipchbw75sagxnz-nixos-system-nixos-22.11.20220708.b39924f.drv' failed to build

nix --extra-experimental-features nix-command log /nix/store/32d1zpwmnfhkbsklrri9f4c8nsmdb0qz-append-initrd-secrets.drv:

@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
variable $src or $srcs should point to the source

Expected behavior

The system configuration should build.

nix-env --version output
Inside developer shell:

nix-env (Nix) 2.9.2

Additional context

I have not been able to recreate this outside of a docker container. The build also succeeds when run outside a developer shell, and if done so subsequent builds inside the developer shell will succeed as the paths are reused from the nix store.

Image digest: sha256:c79d2fa0092680d2337c461bde48b2e2d6610872c0c7b0a903d3d75dfcbe83df

@lunik1 lunik1 added the bug label Jul 10, 2022
@chasecaleb
Copy link

I have no idea what's going on here, but I have this exact same problem in the same scenario (i.e. only occurs when running a dev shell inside a docker image). I've reproduced with the current nixos/nix:latest Docker image, which resolves to nixos/nix@sha256:fc55b9bf9f61742a3fc262c0dc9ad62ea8ace014bb5bd4b11341da879e7b26ce and nixos/nix:master, which resolves to nixos/nix@sha256:623a95ea73bded2225c521f4a33159259a5e7ed939de1934cab37c093d2242e3

@chasecaleb
Copy link

P.S. @lunik1 did you ever figure out a workaround?

@lunik1
Copy link
Author

lunik1 commented Aug 31, 2022

No, sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants