nixconfig/generator.nix
2023-05-21 17:07:52 +02:00

54 lines
1.7 KiB
Nix

{ inputs, nixpkgs, home-manager, darwin, sops-nix, hyprland, nix-colors, ... }:
{
generate = { type, system, host }:
({"nixos" = nixpkgs.lib.nixosSystem {
system = system;
modules = [
sops-nix.nixosModules.sops
./hosts/${host}
home-manager.nixosModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs;
};
home-manager.users.sora = {
imports = [
nix-colors.homeManagerModule
hyprland.homeManagerModules.default
./hosts/${host}/home.nix
];
};
}
];
};
"macos" = darwin.lib.darwinSystem {
system = system;
modules = [
sops-nix.nixosModules.sops
./hosts/${host}
home-manager.darwinModules.home-manager {
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.extraSpecialArgs = {
inherit inputs;
};
home-manager.users.sora = {
imports = [
nix-colors.homeManagerModule
hyprland.homeManagerModules.default
./hosts/${host}/home.nix
];
};
}
];
};
"home" = home-manager.lib.homeManagerConfiguration {
modules = [
./hosts/${host}/home.nix
];
};
_ = throw "Unsupported system";
}.${type});
}