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
Feature request: add --specialization option to nixos-rebuild #174065
Comments
imo it'd be nice if running a specialization created an envvar, say, I'll try preparing a proof of concept within a few weeks 🙂 |
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-name`), but I haven't been able to come up with anything working (plus it would be a breaking change then). As for testing, I've tried to add a VM-based test, but failed, so I've only checked the changes (and updated man page) locally. Closes NixOS#174065
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-name`), but I haven't been able to come up with anything working (plus it would be a breaking change then). As for testing, I've tried to add a VM-based test, but failed, so I've only checked the changes (and updated man page) locally. Closes NixOS#174065
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-name`), but I haven't been able to come up with anything working (plus it would be a breaking change then). As for testing, I've tried to add a VM-based test, but failed, so I've only checked the changes (and updated man page) locally. Closes NixOS#174065
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 NixOS#174065
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 NixOS#174065
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 NixOS#174065
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 NixOS#174065
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-switch-to-a-specific-specialisation/18124/5 |
Now
nixos-rebuild
cannot switch to a specific specialization, so I have to do following to switch to specialization namedfoo
:I'm expecting for a
--specialization
option like:The text was updated successfully, but these errors were encountered: