{ inputs, outputs, stateVersion, hmStateVersion, ... }: { # Helper function for generating home-manager configs mkHome = { hostname, username ? "albert", desktop ? null, platform ? "x86_64-linux", theme ? "default" }: inputs.home-manager.lib.homeManagerConfiguration { pkgs = inputs.nixpkgs.legacyPackages.${platform}; extraSpecialArgs = { inherit inputs outputs desktop hostname platform username hmStateVersion theme; }; modules = [ ../home-manager inputs.doom-emacs.hmModule ]; }; # Helper function for generating host configs mkHost = { hostname, username ? "albert", desktop ? null, installer ? null, gpu ? null, platform ? "x86_64-linux", theme ? "default" }: inputs.nixpkgs.lib.nixosSystem { specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; }; modules = [ ../nixos inputs.sops-nix.nixosModules.sops inputs.lanzaboote.nixosModules.lanzaboote ] ++ (inputs.nixpkgs.lib.optionals (installer != null) [ installer ]); }; # Combines mkHost and mkHome for image building mkImage = { hostname, username ? "albert", desktop ? null, platform ? "x86_64-linux", installer ? null, gpu ? null, theme ? "default" }: { libx = import . { inherit inputs outputs stateVersion hmStateVersion; }; specialArgs = { inherit inputs outputs desktop hostname username stateVersion gpu platform theme; }; hostname = libx.mkHost { hostname = hostname; platform = platform; installer = installer; }; "$username@$hostname" = libx.mkHome { hostname = hostname; platform = platform; }; }; forAllSystems = inputs.nixpkgs.lib.genAttrs [ "aarch64-linux" "i686-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ]; }