lib/builders.nix: add default nixpkgs hostplatform to mkSystem
This commit is contained in:
parent
7063ef40d9
commit
0cd9acc0a7
2 changed files with 16 additions and 4 deletions
|
@ -1,6 +1,8 @@
|
|||
{inputs, ...}: let
|
||||
inherit (inputs) self nixpkgs;
|
||||
inherit (nixpkgs) lib;
|
||||
inherit (lib) mkDefault nixosSystem recursiveUpdate singleton;
|
||||
inherit (builtins) concatLists;
|
||||
in {
|
||||
mkSystem = {
|
||||
withSystem,
|
||||
|
@ -13,17 +15,27 @@ in {
|
|||
self',
|
||||
...
|
||||
}:
|
||||
lib.nixosSystem {
|
||||
nixosSystem {
|
||||
inherit system;
|
||||
specialArgs =
|
||||
lib.recursiveUpdate
|
||||
recursiveUpdate
|
||||
{
|
||||
inherit lib;
|
||||
inherit inputs inputs';
|
||||
inherit self self';
|
||||
}
|
||||
(args.specialArgs or {});
|
||||
inherit (args) modules;
|
||||
modules = concatLists [
|
||||
# This is used to pre-emptively set the hostPlatform for nixpkgs.
|
||||
# We need a singleton here since we concatenate lists, and a singleton
|
||||
# generates a list with a single element.
|
||||
(singleton {
|
||||
nixpkgs.hostPlatform = mkDefault args.system;
|
||||
})
|
||||
|
||||
# We pass our modules from the arguments
|
||||
(args.modules or [])
|
||||
];
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -44,6 +44,6 @@ in {
|
|||
# `flake.lib` is set.
|
||||
flake = {
|
||||
lib = extendedLib;
|
||||
_module.args.lib = extendedLib;
|
||||
# _module.args.lib = extendedLib;
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue