.
indicates current directory
nix build .#nixosConfigurations.exampleIso.config.system.build.isoImage
nix run nixpkgs#nixos-generators -- --format iso --flake /path/to/flake#exampleIso -o result
nix-build '<nixpkgs/nixos>' -A config.system.build.isoImage \\\n -I nixos-config=configuration.nix
nixos-generate --format iso --configuration ./configuration.nix -o result
{
# ...
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
];
};
};
};
}
{ pkgs, modulesPath, ... }: {
imports = [
"${modulesPath}/installer/cd-dvd/installation-cd-minimal.nix"
];
nixpkgs.hostPlatform = "x86_64-linux";
}