installer/cd-dvd/channel: allow to disable bundled channel

When building kexec-based installer every mb saved will reduce the RAM usage and allow to install NixOS on smaller machines.
It also means that less data has to be downloaded from the network.
When using flakes or niv we no longer rely on nix channels beeing present
and when using something like nixos-anywhere, we no longer need to evaluate anything in the installer at all.
This commit is contained in:
Jörg Thalheim 2023-10-28 15:35:56 +02:00 committed by Jörg Thalheim
parent af459e624e
commit 94b810348a

View File

@ -31,10 +31,11 @@ let
echo -n ${config.system.nixos.versionSuffix} > $out/nixos/.version-suffix
echo ${config.system.nixos.versionSuffix} | sed -e s/pre// > $out/nixos/svn-revision
'';
in
{
options.system.installer.channel.enable = (lib.mkEnableOption "bundling NixOS/Nixpkgs channel in the installer") // { default = true; };
config = lib.mkIf config.system.installer.channel.enable {
# Pin the nixpkgs flake in the installer to our cleaned up nixpkgs source.
# FIXME: this might be surprising and is really only needed for offline installations,
# see discussion in https://github.com/NixOS/nixpkgs/pull/204178#issuecomment-1336289021
@ -59,4 +60,5 @@ in
touch /var/lib/nixos/did-channel-init
fi
'';
};
}