lib/images: modify mkHost with modified nixosSystem

There's a change that prevents setting our custom functions so
we'll have to modify it ourselves.
This commit is contained in:
Gabriel Arazas 2023-12-16 19:55:47 +08:00
parent 10c3509121
commit 9064126ca4
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC

View File

@ -10,8 +10,18 @@ in
{ {
# A wrapper around the NixOS configuration function. # A wrapper around the NixOS configuration function.
mkHost = { extraModules ? [ ], nixpkgs-channel ? "nixpkgs" }: mkHost = { extraModules ? [ ], nixpkgs-channel ? "nixpkgs" }:
let lib' = inputs.${nixpkgs-channel}.lib.extend extendLib; in let
(lib'.makeOverridable lib'.nixosSystem) { nixpkgs = inputs.${nixpkgs-channel};
lib' = nixpkgs.lib.extend extendLib;
# A modified version of `nixosSystem` from nixpkgs flake. There is a
# recent change at nixpkgs (at 039f73f134546e59ec6f1b56b4aff5b81d889f64)
# that prevents setting our own custom functions so we'll have to
# evaluate the NixOS system ourselves.
nixosSystem = args: import "${nixpkgs}/nixos/lib/eval-config.nix" args;
in
(lib'.makeOverridable nixosSystem) {
lib = lib';
modules = extraModules; modules = extraModules;
}; };