ark/modules/customBuilds.nix

34 lines
1.0 KiB
Nix
Raw Normal View History

2021-05-14 20:17:53 +03:00
{ lib, self, diggaLib, config, modules, channel, ... }:
let
mkBuild = buildModule:
# TODO: get specialArgs as a module argument and drop builderArgs usage
2021-05-14 20:17:53 +03:00
channel.input.lib.nixosSystem (diggaLib.mergeAny config.lib.builderArgs {
modules = [ buildModule ];
});
in
{
system.build = {
2021-05-14 20:17:53 +03:00
iso = (mkBuild (diggaLib.modules.isoConfig {
inherit self;
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;
2021-06-03 09:48:25 +03:00
digitalOcean = (mkBuild ({ modulesPath, ... }: {
imports = [ "${modulesPath}/virtualisation/digital-ocean-image.nix" ];
})).config.system.build.digitalOceanImage;
};
}