flakes/lib/helpers.nix
Chinmay D. Pai b14c62da0e
feat: migrate to new flake structure for modularity
coolcoolcool

Signed-off-by: Chinmay D. Pai <chinmay.pai@zerodha.com>
2023-12-08 10:08:21 +05:30

51 lines
1.1 KiB
Nix

{
inputs,
outputs,
stateVersion,
...
}: {
# Helper function for generating home-manager configs
mkHome = {
hostname,
username,
desktop ? null,
platform ? "x86_64-linux",
}:
inputs.home-manager.lib.homeManagerConfiguration {
pkgs = inputs.nixpkgs.legacyPackages.${platform};
extraSpecialArgs = {
inherit inputs outputs desktop hostname platform username stateVersion;
};
modules = [../home-manager];
};
# Helper function for generating host configs
mkHost = {
hostname,
username,
desktop ? null,
installer ? null,
platform ? "x86_64-linux",
}:
inputs.nixpkgs.lib.nixosSystem {
specialArgs = {
inherit inputs outputs desktop hostname platform username stateVersion;
};
modules =
[
../nixos
inputs.agenix.nixosModules.default
inputs.nixvim.nixosModules.nixvim
]
++ (inputs.nixpkgs.lib.optionals (installer != null) [installer]);
};
forAllSystems = inputs.nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
}