nixos-generators
nixos-generators copied to clipboard
Integrate into Nix?
Are there ideas or plans to integrate this into Nix?
Not that I know of. @Lassulus ?
I think it would be cool. I will try to do it, when I get some free time again. Also people asked for it at cccamp
With "Integrate into Nix" i mean include in Nix, the package manager and build tool, not package it in nixpkgs. But that's a first step.
I thought about something like:
nix build image -f channel:nixos-17.03 -c configuration.nix -f iso
It first could just use this tool but later be implemented in C++ when the design is stable.
This can then be used to build official images.
Maybe it can be added to nixos-rebuild since it's nixos related. And nixos-rebuild already has the build-vm command after all.
I think nixos-rebuild is one of the old commands and should be replaced by a user friendly sucessor like nixos. I don't know what the plans are there.
So the question is, do you think it makes sense to integrate this tool into official Nix/NixOS tooling longterm?
Then we can open an issue there to discuss it.
Yeah why not. The important part first is to define a set of interfaces that make this work easily extensible.
For example if we stored all the profiles under <nixpkgs/nixos/profiles/images/<image-name>.nix and then had a 1:1 relationship between the image-name and the output attribute (currently hacked with formatAttr). Then it would be easy to build a tool around that.
Related to that, I think all the nixos profiles should be moved under <nixpkgs/nixos/profiles> and have a profilesPath added to nixos so they become easily referencable without using the <> notation. Right now both the nixos modules and profiles are mixed under the same <nixpkgs/nixos/modules> prefix which makes them hard to distinguish (and some under <nixpkgs/maintainers/scripts>).
Yes. Do you want to open an issue upstream for that?
Maybe we can work on it here since it will probably be drowned with the other issues upstream. Either works for me.
nixos-generator is part of nixpkgs at least.
- Integrating this into nix would ensure first class support over time.
- Packaging images, just before enlisting hosts with for example
morphis a common enough bootstrapping problem when using NixOS in production.