Commit Graph

5 Commits

Author SHA1 Message Date
Will Fancher
b78bd2f912 Revert "Merge pull request #333952 from r-vdp/specialisation-name-regex"
This reverts commit fc35704bc8, reversing
changes made to c67d90d517.
2024-08-13 21:33:15 -04:00
r-vdp
57a30e4cbd
specialisation: limit the allowed characters in specialisation names
Since the systemd boot counting PR was merged, dashes in specialisation
names cause issues when installing the boot loader entries, since dashes
are also used as separator for the different components of the file name
of the boot loader entries on disk.

The assertion avoids this footgun which is pretty annoying to recover
from.
2024-08-11 19:07:44 +02:00
K900
cbed115407 nixos/tests/nixos-rebuild-specialisations: download even more RAM 2023-12-17 19:27:07 +03:00
Robert Hensing
0c3f416096 nixosTests.nixos-rebuild-specialisations: Fix 2023-06-10 18:25:04 +02:00
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