lib/env-builders: add builders for home-manager and wrapper-manager

This commit is contained in:
Gabriel Arazas 2024-07-28 19:57:54 +08:00
parent 9bffd41676
commit 5048eae58d
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -82,4 +82,59 @@ rec {
};
in
nixosSystem.config.system.build.${nixosSystem.config.formatAttr};
mkHome = {
pkgs,
homeManagerSrc,
lib ? pkgs.lib,
modules ? [ ],
specialArgs ? { },
}:
let
homeModules = ../modules/home-manager;
in
import "${homeManagerSrc}/modules" {
inherit pkgs lib;
check = true;
extraSpecialArgs = specialArgs // {
foodogsquaredModulesPath = builtins.toString homeModules;
};
configuration = { lib, ... }: {
imports = modules ++ lib.singleton {
imports = [
homeModules
../modules/home-manager/_private
];
};
config = {
programs.home-manager.path = homeManagerSrc;
inherit (pkgs) overlays;
nixpkgs.config = lib.mkDefault pkgs.config;
};
};
};
mkWrapper = {
pkgs,
lib ? pkgs.lib,
wrapperManagerSrc,
modules ? [ ],
specialArgs ? { },
}:
let
wrapperManagerModules = ../modules/wrapper-manager;
wrapperManager = import wrapperManagerSrc { };
in
wrapperManager.lib.build {
inherit pkgs lib;
specialArgs = specialArgs // {
foodogsquaredModulesPath = builtins.toString wrapperManagerModules;
};
modules = modules ++ lib.singleton {
imports = [
wrapperManagerModules
../modules/wrapper-manager/_private
];
};
};
}