Cannot install from custom ISO after migration to NixOS 24.05

Hi,

I have a flake to build a custom ISO installer. It adds various things but for the sake of this question, the minimal form can be reduced to:

{
  description = "My machine installer";

  inputs = {
    nixpkgs = { url = github:NixOS/nixpkgs/nixos-24.05; };
  };

  outputs = { self, nixpkgs }:
  {
    nixosConfigurations = {
      installer = nixpkgs.lib.nixosSystem {
        system = "x86_64-linux";
        modules = [
          ({ ... }: {
            imports = [
              "${nixpkgs}/nixos/modules/installer/cd-dvd/installation-cd-minimal.nix"
              "${nixpkgs}/nixos/modules/installer/cd-dvd/channel.nix"
            ];
          })
        ];
      };
    };
  };
}

I can build the ISO with:

nix build .#nixosConfigurations.installer.config.system.build.isoImage

After booting this custom ISO in a VM, I followed the documented manual installation using UEFI (GPT) until it failed at nixos-install:

[root@nixos:~]# nixos-install
copying channel...
building the configuration in /mnt/etc/nixos/configuration.nix...
error: experimental Nix feature ’flakes’ is disabled; use ’--extra-experimental-features flakes’ to override

This was fixed using:

[root@nixos:~]# nixos-install --option extra-experimental-features flakes

However, it was working fine with a simple nixos-install when using NixOS 23.11 (for both the NixOS machine used to build the installer and the installer itself) so I fail to understand what has happened.

From my understanding: the only time flakes are involved is to build the ISO and that is it; the machine installed with the custom installer is not using flakes.

So, why do I need to use nixos-install --option extra-experimental-features flakes with NixOS 24.05?

2 Likes