nix-community / nixos-generators

Collection of image builders [maintainer=@Lassulus]
MIT License
1.76k stars 136 forks source link

Format gets ignored in flake #166

Open gregistech opened 2 years ago

gregistech commented 2 years ago

I've this setup:

installer = (lib.makeOverridable lib.nixosSystem) {
        inherit pkgs;
        specialArgs = { inherit inputs; };
        modules = [
          ./system/installer/configuration.nix
        ];
        format = "iso";
      };

I've to run nix run github:nix-community/nixos-generators -- --flake .#installer -f iso and also provide -f, as it complains about not having a specified format.

Mic92 commented 2 years ago

If you use a flake, you can also use nixos-generators.nixosGenerate as shown here: https://github.com/Mic92/dotfiles/blob/master/nixos/images/default.nix#L47

gregistech commented 2 years ago
      installer = nixos-generators.nixosGenerate {
        inherit pkgs;
        specialArgs = { inherit inputs self; };
        modules = [
          ./system/installer/configuration.nix
          agenix.nixosModules.age
        ];
        format = "iso";
      };

Still the same problem.

Mic92 commented 2 years ago

Do you have a minimal flake to reproduce this? I can use nixosGenerate from my dotfiles: nix build github:mic92/dotfiles#packages.x86_64-linux.sd-image