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

nixos-install: use mountpoint as store #99493

Merged
merged 1 commit into from Oct 5, 2020

Conversation

cole-h
Copy link
Member

@cole-h cole-h commented Oct 3, 2020

Motivation for this change

nixos-install would use the ISO's store as opposed to the mountpoint's store (#95194 (comment)). Now, it should properly use the mountpoint's store.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

cc @ncfavier -- if you could, please test if this fixes it for you.

@cole-h cole-h mentioned this pull request Oct 3, 2020
16 tasks
Otherwise, it's possible building a flake may cause the live CD to run
out of memory.
@ncfavier
Copy link
Member

ncfavier commented Oct 3, 2020

Please forgive my incompetence, but what's the simplest way to test this from the live CD?

EDIT: I figured it out, built a new ISO.

I now get the following error:

[nixos@nixos:~]$ sudo nixos-install --flake github:ncfavier/config#wo
building the flake in github:ncfavier/config/3c42d9e9f22d86a8f0c3595751c892e5a5bcbf47...
error: --- InvalidPath ----------------------------------------------------- nix
path '/nix/store/nvmqjsr9nh3vy7w2p6bqqmrjs17q5dfc-nix-3.0pre20200829_f156513' is not valid

I believe this is linked to NixOS/nix#4081.

@xaverdh
Copy link
Contributor

xaverdh commented Oct 3, 2020

Please forgive my incompetence, but what's the simplest way to test this from the live CD?

EDIT: I figured it out, built a new ISO.

I now get the following error:

[nixos@nixos:~]$ sudo nixos-install --flake github:ncfavier/config#wo
building the flake in github:ncfavier/config/3c42d9e9f22d86a8f0c3595751c892e5a5bcbf47...
error: --- InvalidPath ----------------------------------------------------- nix
path '/nix/store/nvmqjsr9nh3vy7w2p6bqqmrjs17q5dfc-nix-3.0pre20200829_f156513' is not valid

I believe this is linked to NixOS/nix#4081.

as a workaround you can try with --impure

@ncfavier
Copy link
Member

ncfavier commented Oct 3, 2020

as a workaround you can try with --impure

Yes, that works.

@cole-h cole-h added the 9.needs: port to stable A PR needs a backport to the stable release. label Oct 4, 2020
@cole-h
Copy link
Member Author

cole-h commented Oct 4, 2020

@ncfavier Glad you got it sorted out. Just to make sure I'm understanding correctly: does this fix the issue you were having?

@ncfavier
Copy link
Member

ncfavier commented Oct 4, 2020

@ncfavier Glad you got it sorted out. Just to make sure I'm understanding correctly: does this fix the issue you were having?

Yes, I was able to install the flake after adding --impure to the nix build invocation.

@LEXUGE
Copy link
Contributor

LEXUGE commented Oct 5, 2020

Still, the requirement of --impure here is not quite nice.

@worldofpeace worldofpeace merged commit fd74ab3 into NixOS:master Oct 5, 2020
@cole-h cole-h deleted the nixos-install-add-store branch October 5, 2020 18:14
@cole-h
Copy link
Member Author

cole-h commented Oct 6, 2020

Backported to 20.09 in #99690.

@cole-h cole-h added 8.has: port to stable A PR already has a backport to the stable release. and removed 9.needs: port to stable A PR needs a backport to the stable release. labels Oct 6, 2020
@ncfavier
Copy link
Member

ncfavier commented Oct 6, 2020

I'm confused, why are we merging/backporting this without --impure?

@worldofpeace
Copy link
Contributor

We have to fix #99114

@LEXUGE
Copy link
Contributor

LEXUGE commented Oct 6, 2020

But I do believe the error here path '/nix/store/nvmqjsr9nh3vy7w2p6bqqmrjs17q5dfc-nix-3.0pre20200829_f156513' is not valid is not related to impure flake. It should be a bug of nix itself.

@ncfavier
Copy link
Member

ncfavier commented Oct 6, 2020

Just to be clear, the flake I was trying to install doesn't rely on impurities and so shouldn't have needed --impure.

@worldofpeace
Copy link
Contributor

There is a bug opened in nix NixOS/nix#4081, maybe leave your two cents there. As it is an experimental feature we're just figuring out issues like these.

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

Successfully merging this pull request may close these issues.

None yet

5 participants