Commit 94b81034 authored by Jörg Thalheim's avatar Jörg Thalheim
Browse files

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.
parent af459e62
Loading
Loading
Loading
Loading
+26 −24
Original line number Diff line number Diff line
@@ -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
      '';
  };
}