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
Make NixOS available first-class in NixPkgs #32354
Comments
@williammpratt, That was a little unexpected, but thank you for your feedback.
I am not just saying this to defend my actions, but to point out a minor flaw in the process here. You've pointed out the need for documentation. I will also check the RFCs (and issue tracker) to help improve the community processes' documentation and reduce this kind of friction for maintainers and future contributors. |
I have blocked williammpratt, who appears to be the latest incarnation of a user we've blocked several times before for making abusive comments in NixOS repositories. @roberth Please don't be discouraged by williammpratt, who doesn't speak for any NixOS contributors. |
Personally I would love to see more "special" functions like |
What a shame. Thank you Eelco. I will polish and document the thing and open a PR tomorrow. |
@roberth Thanks for opening this issue. This is definitely a great idea! |
Issue description
Building a NixOS configuration from a Nix expression is already possible, but the way the user should do it is non-obvious, hacky and error prone. (See 'Technical details')
I suggest we define a top level function in NixPkgs called
nixosConfig
.As this is relevant to the overall architecture, I would like to know the opinion and advice of @edolstra and @nbp
Note that
/pkgs
currently only imports/nixos
atnixpkgs/pkgs/desktops/gnome-3/installer.nix
Line 6 in 69698ec
Technical details
The user is currently faced with the following choices:
import <nixpkgs/nixos>
orimport (pkgs.path + "/nixos")
/nixos
ornixos/lib/eval-config.nix
and the following opportunities for mistakes:
system
argumentpkgs
argumentDesign
I suggest we define a function
pkgs.nixosConfig
that is a small wrapper aroundnixos/lib/eval-config.nix
. Its responsibility is topkgs
into the new NixOS configurationeval-config.nix
, like thesystem
parameter (builtins.currentSystem
)Implementation
The following definition works for my application in an overlay, but can probably be improved.
I'll make a PR if you think this is a good idea.
The text was updated successfully, but these errors were encountered: