Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt nixos-generators #3

Open
viluon opened this issue Aug 13, 2024 · 1 comment
Open

Adopt nixos-generators #3

viluon opened this issue Aug 13, 2024 · 1 comment

Comments

@viluon
Copy link
Owner

viluon commented Aug 13, 2024

nixos-generators, something like the following

{
  inputs = {
    nixpkgs.url = "nixpkgs/nixos-23.11";
    nixos-generators = {
      url = "github:nix-community/nixos-generators";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  outputs = { self, nixpkgs, nixos-generators, ... }: {
    packages.x86_64-linux = {
      qemu = nixos-generators.nixosGenerate {
        system = "x86_64-linux";
        modules = [
          ./configuration.nix
        ];

        # qcow2 for qemu
        format = "qcow";

        # optional arguments:
        # explicit nixpkgs and lib:
        # pkgs = nixpkgs.legacyPackages.x86_64-linux;
        # lib = nixpkgs.legacyPackages.x86_64-linux.lib;
        # additional arguments to pass to modules:
        # specialArgs = { myExtraArg = "foobar"; };

        # you can also define your own custom formats
        # customFormats = { "myFormat" = <myFormatModule>; ... };
        # format = "myFormat";
      };
      # vbox = nixos-generators.nixosGenerate {
      #   system = "x86_64-linux";
      #   format = "virtualbox";
      # };
    };
  };
}
@viluon
Copy link
Owner Author

viluon commented Aug 31, 2024

See also live USBs with flakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant