{
  description = "Home Manager configuration of acicchetti";

  nixConfig = {
    extra-substituters = [
      "https://devenv.cachix.org"
      "https://nixpkgs.cachix.org"
      "https://nix-community.cachix.org"
    ];
    extra-trusted-public-keys = [
      "devenv.cachix.org-1:w1cLUi8dv3hnoSPGAuibQv+f9TZLr6cv/Hm9XgU50cw="
      "nixpkgs.cachix.org-1:q91R6hxbwFvDqTSDKwDAV4T5PxqXGxswD8vhONFMeOE="
      "nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
    ];
  };

  inputs = {
    # Specify the source of Home Manager and Nixpkgs.
    nixpkgs = {
      url = "github:nixos/nixpkgs";
    };
    flake-utils.url = "github:numtide/flake-utils"; # not directly used, but common source for the several flakes that do use it
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nix-index-database = {
      url = "github:Mic92/nix-index-database";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    ghostty = {
      url = "github:ghostty-org/ghostty";
      inputs.nixpkgs-unstable.follows = "nixpkgs";
    };
    nixvim = {
      url = "github:nix-community/nixvim";
      inputs = {
        nixpkgs.follows = "nixpkgs";
        home-manager.follows = "home-manager";
      };
    };
    nixneovimplugins = {
      url = "github:m15a/flake-awesome-neovim-plugins";
      inputs = {
        nixpkgs.follows = "nixpkgs";
        flake-utils.follows = "flake-utils";
      };
    };
    fenix = {
      url = "github:nix-community/fenix";
      inputs = {
        nixpkgs.follows = "nixpkgs";
      };
    };
    wezterm = {
      url = "github:wez/wezterm?dir=nix";
      inputs = {
        # nixpkgs.follows = "nixpkgs";
        flake-utils.follows = "flake-utils";
      };
    };
  };

  outputs =
    {
      self,
      nixpkgs,
      home-manager,
      nix-index-database,
      nixvim,
      fenix,
      # wezterm,
      nixneovimplugins,
      ghostty,
      ...
    }:
    let
      supportedSystems = [
        "aarch64-darwin"
        "x86_64-linux"
      ];
      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;

      pkgs = forAllSystems (
        system:
        import nixpkgs {
          inherit system;
          config = {
            allowUnfree = true;
          };
          overlays = [
            ghostty.overlays.default
            # (_final: prev: {
            #   ghostty = ghostty.packages.${prev.system}.default;
            # })
            # (_final: prev: {
            #   wezterm =
            #     if (builtins.hasAttr "wezterm" inputs)
            #     then inputs.wezterm.packages.${prev.system}.default
            #     else prev.wezterm;
            # })
            # (_final: prev: {inherit (neovidenixpkgs.legacyPackages.${prev.system}) neovide;})
            nixneovimplugins.overlays.default
            fenix.overlays.default
          ];
        }
      );

      homeManagerConfigs = forAllSystems (system: {
        pkgs = pkgs.${system};
        modules = [
          {
            imports = [
              nixvim.homeManagerModules.nixvim
            ];
          }
          nix-index-database.hmModules.nix-index
          ./home.nix
        ];
      });
    in
    {
      formatter = forAllSystems (system: pkgs.${system}.nixfmt-rfc-style);
      homeConfigurations.aarch64-darwin-acicchetti =
        home-manager.lib.homeManagerConfiguration
          homeManagerConfigs."aarch64-darwin";
      homeConfigurations.x86_64-linux-acicchetti =
        home-manager.lib.homeManagerConfiguration
          homeManagerConfigs."x86_64-linux";

      defaultPackage.aarch64-darwin = self.homeConfigurations.aarch64-darwin-acicchetti.activationPackage;
      defaultPackage.x86_64-linux = self.homeConfigurations.x86_64-linux-acicchetti.activationPackage;
    };
}