{ description = "Amir's Home Manager"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.11"; home-manager.url = "github:nix-community/home-manager/release-25.11"; unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; nixgl.url = "github:nix-community/nixGL"; nixvim.url = "github:nix-community/nixvim"; sctd.url = "github:amir/sctd"; }; outputs = { self, nixpkgs, home-manager, unstable, flake-utils, nixgl, nixvim, sctd, ... }: let mkExtraArgs = system: { unstablePkgs = import unstable { inherit system; config.allowUnfree = false; }; unfreePkgs = import nixpkgs { inherit system; config.allowUnfree = true; }; unstableUnfreePkgs = import unstable { inherit system; config.allowUnfree = true; }; }; mkHostConfig = { hostname, system ? "aarch64-darwin", }: { pkgs = import nixpkgs { inherit system; overlays = [ nixgl.overlay sctd.overlays.default ]; config = { allowUnfree = false; }; }; modules = [ ./hosts/${hostname}/home.nix nixvim.homeModules.nixvim sctd.homeManagerModules.default ]; extraSpecialArgs = (mkExtraArgs system) // { inherit hostname; hmLib = home-manager.lib; }; }; in flake-utils.lib.eachDefaultSystem ( system: let pkgs = import nixpkgs { inherit system; config = { allowUnfree = false; }; }; in { packages = { default = home-manager.packages.${system}.home-manager; }; devShells.default = pkgs.mkShell { buildInputs = with pkgs; [ #home-manager home-manager.packages.${system}.home-manager nixpkgs-fmt ]; }; } ) // { homeConfigurations = { mentat = home-manager.lib.homeManagerConfiguration (mkHostConfig { hostname = "mentat"; }); gheshki = home-manager.lib.homeManagerConfiguration (mkHostConfig { hostname = "gheshki"; system = "x86_64-linux"; }); }; }; }