custom-installer-video

build with flakes

. indicates current directory

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

build with flakes | nixos-generators

nix run nixpkgs#nixos-generators -- --format iso --flake /path/to/flake#exampleIso -o result

build no flakes

nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage \\\n -I nixos-config=configuration.nix

build no flakes | nixos-generators

nixos-generate --format iso --configuration ./configuration.nix -o result

example flake

{
  # ...

  outputs = { nixpkgs, ... }@inputs:
    {
      nixosConfigurations = {

        default = nixpkgs.lib.nixosSystem {
          specialArgs = { inherit inputs; };
          modules = [
            ./hosts/primary/configuration.nix
          ];
        };

        exampleIso = nixpkgs.lib.nixosSystem {
          specialArgs = { inherit inputs; };
          modules = [
            ./hosts/isoimage/configuration.nix
          ];
        };

      };
    };
}

module

{ pkgs, modulesPath, ... }: {

  imports = [
    "${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
  ];

  nixpkgs.hostPlatform = "x86_64-linux";

}