-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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: add support for flakes #95194
Conversation
I just want to note to nixos devs to please not merge this PR without the documentation. I hope that doesn't sound rigid, but I think it's more likely, if this isn't documented in the same PR, to take a significantly longer time to be documented. |
IMHO |
@vlaci |
@worldofpeace are you sure? my installer iso built from unstable does not have it by default, and I only see it scoped to |
Ooh, I thought you meant for the wrapped PATH for |
No, I have meant Sorry I have meant to put the links in the first comment but somehow missed it. |
Oh, lol @vlaci understood. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First of all thanks a lot for your effort!
- Tested with
tests.installer.simple
and on a localtmpfs
mounted to/mnt
and this seems to work fine overall 👍 - I think that it should be somehow ensured that we're actually using a
nixUnstable
fornixos-install
in the case of flake support. - I'd like to have some kind of default behavior in case of flakes (e.g.
nixos-install --flake path:/mnt/etc/nixos#default
as default behavior ifflake.nix
exists). hardware-configuration.nix
imports<nixpkgs/nixos/modules/installer/scan/not-detected.nix>
. I'm not sure how, but we should somehow take care of this when using flakes.
Ok never mind, it uses |
For |
You're absolutely right! I actually generated a fresh config in my temporary |
@Ma27 Oh awesome c45295d#diff-14ed97ea0350115b36b0b8d884db5667 no action needed ✨ |
I've tried to incorporate your feedbacks as I could. Please let me know if something is missing or wrong. |
d694851
to
4962dd3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Diff LGTM (did all of my reviewing on IRC).
(Note that a slight difference from previous revisions of this PR is the addition of --experimental-features
flags where necessary, so that we don't rely on a nix.conf with the proper settings enabled.)
I think there's tests to run here for nixos-install to check nothing broke |
@ofborg test installer.simple (Feel free to check additional installer tests, but I believe this is the simplest (heh) of the bunch that tests |
So @cole-h cleared up on IRC that my reading skills aren't that great today 🤣
|
I think
jq is not in my default PATH )
|
You're right. I think it just disappeared from the diff at some point. |
fixed in a39ad85 |
backported to 20.09 281c899 |
nixpkgs/nixos/modules/installer/tools/nixos-install.sh Lines 155 to 157 in c8ccfdb
This builds the flake in It doesn't seem like |
Actually, all EDIT: PR opened: #99493 |
Motivation for this change
Use
nixos-install
with aflake.nix
.Things done
I've just copied code from
nixos-rebuild
, not sure whether all this is correct.--flake
and other options like innixos-rebuild
.pkgs.nixFlakes
'snix
prepended onPATH
, to be used only when--flake
is involved. This avoids adding allnixUnstable
's closure tonixos-install
.--experimental-features 'nix-command flakes'
tonix
when using--flake
innixos-install
andnixos-rebuild
.--flake
.sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)