Allow nixpkgs to be configured via nixpkgs.config (#164)

This commit is contained in:
Pierre-Etienne Meunier 2024-11-19 18:15:56 +01:00 committed by GitHub
parent 19f20fe6e4
commit cb01c5c4dd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View file

@ -34,7 +34,7 @@ let
{ {
_file = "${self.printAttrPos (builtins.unsafeGetAttrPos "a" { a = null; })}: inline module"; _file = "${self.printAttrPos (builtins.unsafeGetAttrPos "a" { a = null; })}: inline module";
_module.args = { _module.args = {
pkgs = import nixpkgs { system = config.nixpkgs.hostPlatform; }; pkgs = import nixpkgs { system = config.nixpkgs.hostPlatform; inherit (config.nixpkgs) config; };
utils = import "${nixos}/lib/utils.nix" { utils = import "${nixos}/lib/utils.nix" {
inherit lib config pkgs; inherit lib config pkgs;
}; };

View file

@ -27,6 +27,12 @@
default = throw "the option nixpkgs.hostPlatform needs to be set."; default = throw "the option nixpkgs.hostPlatform needs to be set.";
}; };
config = lib.mkOption {
type = types.attrs;
description = ''Configuration used to instantiate nixpkgs.'';
default = {};
};
pkgs = lib.mkOption { pkgs = lib.mkOption {
type = lib.types.pkgs; type = lib.types.pkgs;
description = ''The pkgs module argument.''; description = ''The pkgs module argument.'';