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:
parent
af459e624e
commit
94b810348a
1 changed files with 26 additions and 24 deletions
|
@ -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
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue