os/modules/customBuilds.nix
Pacman99 e98e595704 pass builderArgs to config and extract builds
have mkHomeConfiguration create its own custom build within the function
create a externalModule for customBuilds so its easy to add more
2021-04-30 10:52:35 -07:00

30 lines
825 B
Nix

{ lib, self, devlib, config, modules, channel, ... }:
let
mkBuild = buildModule:
channel.input.lib.nixosSystem (devlib.mergeAny config.lib.builderArgs {
modules = [ buildModule ];
});
in
{
system.build = {
iso = (mkBuild (devlib.modules.isoConfig {
inherit self;
inherit (self) inputs;
fullHostConfig = config;
})).config.system.build.isoImage;
homes = (mkBuild ({ config, ... }: {
home-manager.useUserPackages = lib.mkForce false;
home-manager.sharedModules = [
{
home.sessionVariables = {
inherit (config.environment.sessionVariables) NIX_PATH;
};
xdg.configFile."nix/registry.json".text =
config.environment.etc."nix/registry.json".text;
}
];
})).config.home-manager.users;
};
}