lib/private: replace nixpkgs-channel to pkgs

The nixpkgs import should be easier to control from the flake
definition.
This commit is contained in:
Gabriel Arazas 2023-07-14 13:19:09 +08:00
parent 06704f5ab6
commit 92a2f81a2b
No known key found for this signature in database
GPG Key ID: ADE0C41DAB221FCC
2 changed files with 7 additions and 4 deletions

View File

@ -330,6 +330,10 @@
homeConfigurations = lib'.mapAttrs homeConfigurations = lib'.mapAttrs
(name: metadata: (name: metadata:
let let
system = metadata.system or defaultSystem;
pkgs = import inputs."${metadata.nixpkgs-channel or "nixpkgs"}" {
inherit system overlays;
};
path = ./users/home-manager/${name}; path = ./users/home-manager/${name};
extraModules = [ extraModules = [
({ pkgs, config, ... }: { ({ pkgs, config, ... }: {
@ -349,8 +353,7 @@
]; ];
in in
mkUser { mkUser {
inherit extraModules extraArgs; inherit pkgs system extraModules extraArgs;
system = metadata.system or defaultSystem;
home-manager-channel = metadata.home-manager-channel or "home-manager"; home-manager-channel = metadata.home-manager-channel or "home-manager";
}) })
users; users;

View File

@ -21,11 +21,11 @@ in
}; };
# A wrapper around the home-manager configuration function. # A wrapper around the home-manager configuration function.
mkUser = { system, extraModules ? [ ], extraArgs ? { }, home-manager-channel ? "home-manager" }: mkUser = { system, extraModules ? [ ], extraArgs ? { }, home-manager-channel ? "home-manager", nixpkgs-channel ? "nixpkgs" }:
inputs."${home-manager-channel}".lib.homeManagerConfiguration { inputs."${home-manager-channel}".lib.homeManagerConfiguration {
inherit lib; inherit lib;
extraSpecialArgs = extraArgs; extraSpecialArgs = extraArgs;
pkgs = import nixpkgs { inherit system; }; pkgs = import inputs."${nixpkgs-channel}" { inherit system; };
modules = modules =
# Importing our custom home-manager modules. # Importing our custom home-manager modules.
(import ../modules/home-manager { inherit lib; isInternal = true; }) (import ../modules/home-manager { inherit lib; isInternal = true; })