Rebuildable system & appliance#263462
Conversation
roberth
left a comment
There was a problem hiding this comment.
Really cool, but I think this needs to distinguish between general appliances and virtual appliances. I'll have some more thoughts regarding the distinction, but first I'll lazily quote Wikipedia Software appliance:
A software appliance is a software application combined with just enough operating system (JeOS) to run optimally on industry-standard hardware (typically a server) or in a virtual machine.
This PR elaborates what is just enough, and it seems to get it right for virtual appliances. However, for a hardware appliance you probably want to have more drivers and some upgrade mechanism.
By default the upgrade mechanism should probably be SSH + Nix store. Emphasis on store because it only has to work for root, and does not have to come with an interpreter.
I should've made this clearer: the update mechanism I envision is image-based A/B booting via the systemd toolchain. At the center of this is systemd-sysupdate for which I have added a module in a previous PR #243995 In this universe you would receive a completely new store image instead of only a new store closure, so Nix isn't necessary at all. You would build images with the repart builder which I have also already added in a previous PR: #245250 Hardware and virtual appliance in this world are the same, you can update them the same way. However with a virtual appliance, you can also just completely exchange the disk image (but then you don't get the automatic fallback from systemd-boot and systemd-bless-boot) |
How about I'd be happy to start with very specific profiles and consider factoring this out into common profiles only when the other use cases have profiles and the commonality is "proven". |
a713590 to
4f6d2ef
Compare
I called it |
If |
4f6d2ef to
f4e05f1
Compare
|
This should be good to go now. @ofborg test non-switchable-system switchTest |
roberth
left a comment
There was a problem hiding this comment.
Implementation lgtm.
Needs documentation and maybe promote it with a release note?
This flag allows the user to optionally exclude switch-to-confguration.pl from toplevel. This is interesting for appliance images where you don't want to re-build the system. This flag is called `rebuildable` because the standard interface to do this is `nixos-rebuild` which will not work anymore with this change.
f4e05f1 to
d17a647
Compare
d17a647 to
9dc4d68
Compare
959ea19 to
0b823c5
Compare
|
Added docs and release notes. @ofborg test non-switchable-system switchTest |
0b823c5 to
a9d1495
Compare
|
|
a9d1495 to
e8bed1e
Compare
That would be nice, however, I think it's not needed for this PR. |
I feel like I would love to have such a check after |
| # Perl is a default package. | ||
| environment.defaultPackages = mkDefault [ ]; | ||
|
|
||
| # The lessopen package pulls in Perl. | ||
| programs.less.lessopen = mkDefault null; | ||
|
|
||
| # This pulls in nixos-containers which depends on Perl. | ||
| boot.enableContainers = mkDefault false; | ||
|
|
There was a problem hiding this comment.
Can we please add a release note entry for boot.enableContainers?
https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574 would have been fitting as well.
There was a problem hiding this comment.
Created #269970 for a simple eval warning when containers are used but disabled (e.g. by importing the minimal profile).
Description of changes
Add
system.rebuildableflagThis flag allows the user to optionally exclude
switch-to-confguration.pl from toplevel.
This is interesting for appliance images where you don't want to re-build
the system. This flag is called
rebuildablebecause the standardinterface to do this is
nixos-rebuildwhich will not work anymore withthis change.
When #263295 lands,
environment.defaultPackages = mkDefault [ ];can be removed from the minimal profile.Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)