lib/env-builders: refactor

This commit is contained in:
Gabriel Arazas 2024-07-31 13:13:42 +08:00
parent 62211ef8eb
commit aeeb6a95f9
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -52,13 +52,13 @@ rec {
foodogsquaredUtils = import ./utils/nixos.nix { inherit lib; }; foodogsquaredUtils = import ./utils/nixos.nix { inherit lib; };
foodogsquaredModulesPath = builtins.toString nixosModules; foodogsquaredModulesPath = builtins.toString nixosModules;
}; };
modules = extraModules ++ lib.singleton { modules = extraModules ++ [
imports = [
nixosModules nixosModules
../modules/nixos/_private ../modules/nixos/_private
]; ({ lib, ... }: {
nixpkgs.hostPlatform = lib.mkForce system; nixpkgs.hostPlatform = lib.mkForce system;
}; })
];
# Since we're setting it through nixpkgs.hostPlatform, we'll have to pass # Since we're setting it through nixpkgs.hostPlatform, we'll have to pass
# this as null. # this as null.
@ -100,12 +100,11 @@ rec {
foodogsquaredModulesPath = builtins.toString homeModules; foodogsquaredModulesPath = builtins.toString homeModules;
}; };
configuration = { lib, ... }: { configuration = { lib, ... }: {
imports = modules ++ lib.singleton { imports = modules ++ [
imports = [
homeModules homeModules
../modules/home-manager/_private ../modules/home-manager/_private
]; ];
};
config = { config = {
programs.home-manager.path = homeManagerSrc; programs.home-manager.path = homeManagerSrc;
inherit (pkgs) overlays; inherit (pkgs) overlays;
@ -130,11 +129,9 @@ rec {
specialArgs = specialArgs // { specialArgs = specialArgs // {
foodogsquaredModulesPath = builtins.toString wrapperManagerModules; foodogsquaredModulesPath = builtins.toString wrapperManagerModules;
}; };
modules = modules ++ lib.singleton { modules = modules ++ [
imports = [
wrapperManagerModules wrapperManagerModules
../modules/wrapper-manager/_private ../modules/wrapper-manager/_private
]; ];
}; };
};
} }