nix/lib/default.nix
2023-08-27 20:12:19 +09:00

30 lines
No EOL
1.1 KiB
Nix

{ inputs, outputs, stateVersion, hmStateVersion, ... }: {
# 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 hmStateVersion; };
modules = [
../home-manager
inputs.doom-emacs.hmModule
];
};
# Helper function for generating host configs
mkHost = { hostname, username, desktop ? null, installer ? null, gpu ? null, platform ? "x86_64-linux" }: inputs.nixpkgs.lib.nixosSystem {
specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform; };
modules = [
../nixos
inputs.sops-nix.nixosModules.sops
inputs.lanzaboote.nixosModules.lanzaboote
] ++ (inputs.nixpkgs.lib.optionals (installer != null) [ installer ]);
};
forAllSystems = inputs.nixpkgs.lib.genAttrs [
"aarch64-linux"
"i686-linux"
"x86_64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
}