nixos/nixpkgs: Properly validate and merge nixpkgs config#272686
nixos/nixpkgs: Properly validate and merge nixpkgs config#272686dasJ wants to merge 2 commits intoNixOS:masterfrom
Conversation
This allows proper merging, especially with the next commit in mind.
This uses nixpkgs config as a submodule rather than a custom merging function. This has the benefit of proper merge functions (like listOf) in configuration options rather than the `recursiveUpdate` with the hacked-in two lists of packages.
| { allowBroken = true; allowUnfree = true; } | ||
| ''; | ||
| type = configType; | ||
| type = types.submodule ../../../pkgs/top-level/config.nix; |
There was a problem hiding this comment.
I'm debating whether it should be this or types.deferredModule, ie pass a whole unevaluated (sub)module to Nixpkgs, and therefore also, make the Nixpkgs entrypoint accept a module for config.
The latter is somewhat more in the spirit of turning the "Nixpkgs invocation interface" entirely into a module, which is an admittedly unclear goal of #231940.
|
# configuration.nix
{ lib, ... }: {
imports = [
{
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"zsh-abbr"
];
}
{
nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [
"slack"
];
}
];
} |
|
Haskell would call that |
|
Edit: Now merged, |
Description of changes
Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.