{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    home-manager = {
      url = "github:nix-community/home-manager";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    catppuccin = {
      url = "github:catppuccin/nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    disko = {
      url = "github:nix-community/disko";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    deploy-rs = {
      url = "github:serokell/deploy-rs";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixvim = {
      url = "github:nix-community/nixvim";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    agenix = {
      url = "github:ryantm/agenix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  outputs =
    {
      self,
      nixpkgs,
      home-manager,
      catppuccin,
      disko,
      deploy-rs,
      nixvim,
      agenix,
      ...
    }:
    {
      homeConfigurations."flygrounder@work" = home-manager.lib.homeManagerConfiguration {
        pkgs = import nixpkgs { system = "x86_64-linux"; };
        modules = [
          ./home
          catppuccin.homeModules.catppuccin
          nixvim.homeModules.nixvim
          (
            { ... }:
            {
              catppuccin.enable = true;
              programs.ssh.enable = nixpkgs.lib.mkForce false;
              custom = {
                cli.enable = true;
                neovim.enable = true;
              };
            }
          )
        ];
      };
      nixosConfigurations =
        let
          mkConfig =
            hostName:
            nixpkgs.lib.nixosSystem {
              modules = [
                disko.nixosModules.disko
                catppuccin.nixosModules.catppuccin
                agenix.nixosModules.default
                ./nixos
                ./hosts/${hostName}/configuration.nix
                home-manager.nixosModules.home-manager

                {
                  home-manager.users.flygrounder.imports = [
                    ./home
                    catppuccin.homeModules.catppuccin
                    nixvim.homeModules.nixvim
                  ];
                  networking.hostName = hostName;
                }
              ];
            };
          configurations = builtins.mapAttrs (hostName: _: mkConfig hostName) (builtins.readDir ./hosts);
        in
        configurations;
      deploy.nodes.server = {
        hostname = "62.109.27.62";
        profiles.system = {
          user = "root";
          path = deploy-rs.lib.x86_64-linux.activate.nixos self.nixosConfigurations.server;
        };
      };

      checks = builtins.mapAttrs (system: deployLib: deployLib.deployChecks self.deploy) deploy-rs.lib;
    };
}
