Open danbst opened 5 years ago
nixos options --edit
might be too complicated. However, we could possibly attempt to port the options table from https://nixos.org to have a value column.
Sounds good!
nixos config --edit
could open config in default $EDITOR and later open browser with interactive editor.
commit to Git by default on each rebuild, warns on used .nix files outside of git repo
So should /etc/nixos/
be a git repo? Could be an option for users that don't care.
I have my config in /root/nixos-config
and symlink config to /etc/nixos/configuration.nix
.
I want to commit after a rebuild was sucessfull. Often i need multiple tries.
An option to not commit would be enough for me.
autocomplete
Use the same self documenting help format as nix
and it would be pretty trivial to add support in nix-{zsh,bash}-completions
. Completions fornix
are already automatically generated from the help (was really nice not having to do anything about the nix-2.2 release :).
Looks good idea for me.
Probably it should be implemented in rust or c++ (I presonally prefer rust here over c++), I asked in IRC about other stuff, and rust was a common language suggestion.
Related issue: https://github.com/NixOS/nixpkgs/issues/51198
I think nixos-lib
(or equivalently nixos lib
) should contain all NixOS activation scripts, rewritten in C++/Rust/Go/whatever.
nixos-rebuild
just got an edit command :) https://github.com/NixOS/nixpkgs/pull/56241
I think I mentioned this before somewhere but SLNOS doesn't use nixos-rebuild
(because there's no /etc/nixos
equivalent in SLNOS) and does a lot of this with a simple bash script, e.g.:
$ slnos build --on machine --for other-machine other-machine.nix $ slnos build --on machine --for other-machine
(both do the same thing) will build other-machine.nix
(this will be its configuration.nix
, but you can specify several files at the same time and it will then generate a temporary nix file with imports a-la NixOps) on machine
, nix-copy
over to other-machine
. switch
, boot
, test
, and etc are selected interactively after the fact, or with
$ slnos build --on machine --for this-machine this-machine.nix temporary-networking-changes.nix --and-then test
(I do this one all the time.)
I don't see why nixos can't do the same.
Another thing I'd like to see supported is -L/--print-build-logs
for nixos-rebuild
, which already exists for nix build
.
Thank you for your contributions. This has been automatically marked as stale because it has had no activity for 180 days. If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity. Here are suggestions that might help resolve this more quickly:
this is still needed to make NixOS more userfriendly
a next step could be a usable prototype as wrapper in python or whatever you like
Since my last comment I have discovered nix-top
, which I use to see what a build is currently struggling with.
This is not just about usability by the way, there is a lot of duplication in the nixos-*
tooling. They all accept roughly the same nix options, which get passed through to nix calls. And actually they do get out of sync with both nix itself and each other from time to time..
Looks like nixos-rebuild build-vm[-with-bootloader]
is missing a subcommand.
commit to Git by default on each rebuild
This is an antipattern and I really hope there will be an option to disable this!
I marked this as stale due to inactivity. → More info
Not stale, I hope?
How about nixos gc -d
for nix-collect-garbage -d && /nix/var/nix/profiles/system/bin/switch-to-configuration boot
?
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
https://discourse.nixos.org/t/nixpkgs-cli-working-group/30517/5
I've made a precursor to this that's still in very early stages, just to see where it can go. The repo is here, I'd like to see how far this can be taken.
Issue description
nixos-rebuild
interface looks a bit archaic. Maybe we can have a better Nixos frontend CLI?Just brain dump, but...
Technical details
Basic features:
nixos
Subcommands
First I'll describe existing
nixos-rebuild
switches, that should go into new command:nixos-rebuild switch
->nixos rebuild
,nixos rebuild --boot --activate
nixos-rebuild boot
->nixos rebuild --no-activate
nixos-rebuild test
->nixos rebuild --no-boot
nixos-rebuild build
->nixos build
nixos-rebuild dry-x
->nixos x --dry
,nixos x --test
nixos-rebuild --build-host
->nixos --build-on
nixos-rebuild --target-host
->nixos --deploy-to
nixos-rebuild switch --rollback
->nixos rollback
opens a curses screen so you can select what to rollback toThen, existing commands should be intergrated. All of those should work on non-NixOS:
nixos-option X
->nixos option X
nixos-generate-config
->nixos config --default
, outputs to stdoutnixos-install
->nixos install
nixos-container XXX
->nixos container XXX
nixos-version
->nixos -v
,nixos --version
.nixos -vv
should be same asnix-info
Some external projects should be merged in:
nixos-infect
->nixos infect --confirm-infect
, alsonixos infect --confirm-infect --deploy-to
And probably some new stuff added:
nixos options
, the output should be fast and compatible with FZFnixos lustrate --confirm-lustrate
nixos options --edit
should start a webserver, browser and provide interactive point-and-click editing experienceAnything missed?