Misterio77 / nix-config

Personal nixos and home-manager configurations.
https://m7.rs/git/nix-config/
MIT License
719 stars 42 forks source link

have anyone used nix-generator with this config? #15

Closed luxus closed 3 months ago

luxus commented 1 year ago

hello, i need to generate some images for virtualisation and want to generate the images with the config, does anyone use it?

sjcobb2022 commented 3 months ago

Hey @luxus was playing around and i have this config which currently works!

#flake.nix
packages =
    forEachPkgs
      (
        pkgs:
          (import ./pkgs {inherit pkgs;})
          // {
            install-iso = inputs.nixos-generators.nixosGenerate {
              system = "${pkgs.system}";
              format = "install-iso";
            };
          }
      );

I augment the main package to include an install-iso generator.

If you try to add this as a regular package, there are infinite recursion issues. This is because there is an overlay (below) that brings custom packages into scope, which means that the installer iso package references itself.

   # This one brings our custom packages from the 'pkgs' directory
  additions = final: _prev: import ../pkgs {pkgs = final;};