You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since I'm not quite familiar with NixOS environment I don't exactly know if this is a good idea or not:
Basically what I stumbled over was that the default configuration bundles an nginx server within the image, but the bundled configuration.nix is empty.
Maybe the configuration used to generating the image should be included into the image somehow?
The text was updated successfully, but these errors were encountered:
To rebuild the system you need a copy of the configuration.nix and also the version of nixpkgs that was used to build the system in the first place.
{modulesPath, ... }:
{imports=[# add a copy of nixpkgs to the image"${modulesPath}/installer/cd-dvd/channel.nix"];# copy the configuration.nix into /run/current-system/configuration.nixsystem.copySystemConfiguration=true;}
Then if you want to rebuild the system from within the VM, run:
cp /run/current-system/configuration.nix /etc/nixos/configuration.nix
# edit the file with your changes
nixos-rebuild switch
There are a few limitations with the approach:
adding nixpkgs to the image grows the image quite a bit (~600Mb ?). If you disable it then append -I nixpkgs=channel:nixos-19.09 for example to the nixos-rebuild command
it doesn't work if the system configuration is split over multiple files as only the main configuration.nix will be copied into the store.
I'm not sure if LXC supports changing the bootloader of the VM. To be verified.
(1) and (2) are the main reasons why it's not done by default.
Since I'm not quite familiar with NixOS environment I don't exactly know if this is a good idea or not:
Basically what I stumbled over was that the default configuration bundles an nginx server within the image, but the bundled
configuration.nix
is empty.Maybe the configuration used to generating the image should be included into the image somehow?
The text was updated successfully, but these errors were encountered: