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

nix copy --from file:// requires unexpected flake in cwd #10217

Closed
tmplt opened this issue Mar 10, 2024 · 2 comments
Closed

nix copy --from file:// requires unexpected flake in cwd #10217

tmplt opened this issue Mar 10, 2024 · 2 comments
Labels

Comments

@tmplt
Copy link
Member

tmplt commented Mar 10, 2024

Describe the bug

nix copy --from file:// on a directory created by nix copy --to file:// fails because it cannot find a flake.nix in the current working directory, or above.

Steps To Reproduce

$ pwd
/home/tmplt
$ nix copy --to file:///tmp/nix-copy-hello nixpkgs#hello
$ nix copy --from file:///tmp/nix-copy-hello 
path '/home/tmplt' does not contain a 'flake.nix', searching up
error: could not find a flake.nix file

Expected behavior

I expect the nix copy --from command to import the binary cache to the system's (but effectively being noop because the derivation already exists there?).

nix-env --version output

nix-env (Nix) 2.18.1

Additional context

I have nix-command flakes enabled globally, but overriding using --experimental-features nix-command yields the same error.

Priorities

Add 👍 to issues you find important.

@tmplt tmplt added the bug label Mar 10, 2024
@thufschmitt
Copy link
Member

nix copy copies the store paths specified on the command-line (defaulting to the flake in the current directory like the rest of the command-line).

If you want to copy the whole store, you can use --all (I hope, if it doesn't work, that is a bug).

Do you think the description in the manual needs to be altered to make this more explicit? If so feel free to open a PR to fix it

@tmplt
Copy link
Member Author

tmplt commented Mar 11, 2024

Thanks, I wasn't aware of --all. It's a bit too hidden and abstracted in my opinion: #10227.

@tmplt tmplt closed this as completed Mar 11, 2024
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