Commit Graph

7 Commits

Author SHA1 Message Date
Patryk Wychowaniec
2c55eba8f4
nixos: add --specialisation to nixos-rebuild
This commit fixes a papercut in nixos-rebuild where people wanting to
switch to a specialisation (or test one) were forced to manually figure
out the specialisation's path and run its activation script - since now,
there's a dedicated option to do just that.

This is a backwards-compatible change which doesn't affect the existing
behavior, which - to be fair - might still be considered sus by some
people, the painful scenario here being:

- you boot into specialisation `foo`,
- you run `nixos-rebuild switch`,
- whoops, you're no longer at specialisation `foo`, but you're rather
  brought back to the base system.

(it's especially painful for cases where specialisation is used to load
extra drivers, e.g. Nvidia, since then launching `nixos-rebuild switch`,
while forgetting that you're inside a specialisation, can cause some
parts of your system to get accidentally unloaded.)

I've tried to mitigate that by improving specialisations so that they
create a dedicated file somewhere in `/run/current-system` containing
the specialisation's name (which `nixos-rebuild` could then use as the
default value for `--specialisation`), but I haven't been able to come
up with anything working (plus it would be a breaking change then).

Closes https://github.com/NixOS/nixpkgs/issues/174065
2023-01-15 18:16:49 +01:00
Profpatsch
c7172046c7 nixos-rebuild: add meta & add Profpatsch as maintainer 2022-03-22 18:35:33 +01:00
Profpatsch
5679b2b698 nixos-rebuild: add installer test to passthru.tests
When something changes in nixos-rebuild, we must make sure the
installers still work, otherwise it might break existing setups.

The installer tests check whether nixos-rebuild works, so they are a
good lithmus test.
2022-03-19 15:13:50 +01:00
Thiago Kenji Okada
c75bc3abc7 nixos-rebuild: remove jq
Was only used in the code removed in commit
c274d045ac.
2022-01-04 20:02:47 -03:00
Alyssa Ross
341836ced2
nixos-rebuild: support prebuilt Nix on aarch64
We have a fallback hashes entry for aarch64-linux, but it was unused
by nixos-rebuild.
2021-05-14 12:53:57 +00:00
Dominik Xaver Hörl
e9abfbde62 nixos-rebuild: put some important dependencies in PATH 2021-01-16 13:24:18 +01:00
Domen Kožar
c32f5b22f1
move nixos-rebuild into pkgs 2021-01-15 20:07:38 +01:00