-
-
Notifications
You must be signed in to change notification settings - Fork 220
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
outputs: make compatible with nix run and package lists #842
Conversation
Well we can also call it recreate in the cli, while still allowing user the old name. |
I also would prefer to not have the warning in the beginning until we have also migrated the nixos-anywhere executable to it. We can add the warning later when also nixos-stable no longer has the old nixos-anywhere version to avoid showing users warnings they cannot silence. |
Would love to see a new mode or maybe a flag for the disko/recreate script that doesn’t wipe the partition table as create is kinda idempotent now, I think this mode would be quite useful with |
@Enzime that mode already exists afaik and it's called |
I thought |
That's a good point, I'll split those into a separate PR.
That's a good point, and I agree, we should do that. I think I would like to take this opportunity to integrate a solution for #725, which is to simply display a warning when running the "recreate" mode that all disks will be wiped, and asking for confirmation. This dialogue can be skipped with the new flag Would you agree with that change?
Hmm, this makes me feel like we might want to make the names of our modes more direct. Instead of inventing new names for joint modes, why don't we just leave the base modes named
The outputs would then be:
This isn't pretty, but it sure as hell is clear. |
lib/default.nix
Outdated
export PATH=${lib.makeBinPath (cfg.config._packages pkgs)}:$PATH | ||
${cfg.config._mount} | ||
''; | ||
diskoDisko = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "/bin/disko-disko" '' |
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.
diskoDisko = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "/bin/disko-disko" '' | |
disko = (diskoLib.writeCheckedBash { inherit pkgs checked; }) "/bin/disko-destroy-format-mount" '' |
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.
I don't think that's a good idea. We can call the output destroyFormatMount
, but just calling it disko
makes it too confusing what it's supposed to be, and goes against your other idea of making the outputs a generic interface that has nothing to do with disko directly.
The only output I would expect to be called disko
is the CLI.
e194cdf
to
2d52a42
Compare
As I hinted at yesterday, I now used the opportunity to integrate a confirmation dialogue into the modes The existing I can also split this into a separate PR, but I wanted to avoid having a state on master that is forwards-incompatible with this. |
I'll fix the build errors soon, gotta go to bed now, but would appreciate feedback on the changes. |
Sorry, currently busy with NixCon preparation. I would like to get back to this later. |
438f83a
to
08d39ae
Compare
changes look good to me, I haven't tested everything though, but it seems like there are no breaking changes and CI is happy. |
This adds new outpus like `format` and `formatNoDeps` which are compatible with `nix run` so you can do something like nix run .#nixosConfigurations.myhostname.config.system.build.formatNoDeps as originally intended in #78, or add disko to your configuration like environment.systemPackages = [ config.system.build.format config.system.build.mount config.system.build.destroyFormatMount ]; as mentioned in #454. Fixes part of #454 Supersedes #78 It also deprecates mode `disko` in favor of the clearer `destroy,format,mount` and adds `format,mount` to allow easier in-place updates.
The new confirmation dialogue is only shown for the new outputs introduced in the previous commits. The existing outputs do not change behavior to keep backwards compatibility. Fixes #725
I believe that people are either using disko through the flake or via nixpkgs. In both cases, the `default.nix` file contains a lot of outputs that are not needed. Adding scary error messages with a call to action like this should help confirm or deny this theory.
08d39ae
to
3fc91a7
Compare
Alright I addressed the last few comments and rebased on master. Once this is merged, I'll open a new issue regarding how we handle the deprecation etc. to make sure an updated version of nixos-anywhere is released before then. |
This adds new outpus like
diskoFormat
anddiskoFormatNoDeps
which are compatible withnix run
so you can do something likeas originally intended in #78, or add disko to your configuration like
as mentioned in #454.
The old outputs are marked as deprecated and a warning like this is shown to the user:
Fixes part of #454 (which then only requires proper documentation)
Supersedes #78
@Mic92 I know you suggested in #78 (comment) to use
diskoRecreate
, but I think as long as we still have--mode disko
, we should keep it consistent, so I went fordiskoDisko
instead. This also helps differentiate this output from the regulardisko
, which is the CLI.