{
  description = "a collection of personal nix configurations";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";

    home-manager.url = "github:nix-community/home-manager";
    home-manager.inputs.nixpkgs.follows = "nixpkgs";

    hardware.url = "github:nixos/nixos-hardware";
    nix-colors.url = "github:misterio77/nix-colors";

    waybar.url = "github:Alexays/Waybar";

    hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";
    hyprlock.url = "github:hyprwm/hyprlock?rev=b407128caeb551ae808cf8d0fb653a252a271709";
    hypridle.url = "github:hyprwm/hypridle";
    hyprpaper.url = "github:hyprwm/hyprpaper";

    waybar-catppuccin.url = "github:catppuccin/waybar";
    waybar-catppuccin.flake = false;
    hyprland-catppuccin.url = "github:catppuccin/hyprland";
    hyprland-catppuccin.flake = false;
    
    catppuccin-vsc.url = "github:catppuccin/vscode";
  };

  outputs = inputs @ { self, nixpkgs, ... }:
    let
      inherit (lib.my) mapModules mapModulesRec mapHosts;
      system = "x86_64-linux";

      mkPkgs = pkgs: extraOverlays: 
        import pkgs {
          inherit system;
          config.allowUnfree = true;
          config.allowAliases = false;
          overlays = extraOverlays ++ (lib.attrValues self.overlays);
        };
      pkgs = mkPkgs nixpkgs [ self.overlays.default inputs.catppuccin-vsc.overlays.default ];

      lib = nixpkgs.lib.extend (final: prev: {
        my = import ./lib {
          inherit pkgs inputs;
          lib = final;
        };
      });
    in {
      lib = lib.my;
    
      overlays = 
        (mapModules ./overlays import)
        // {
          default = final: prev: {
            my = self.packages.${system};
          };
        };
      
      packages."${system}" = mapModules ./packages (p: pkgs.callPackage p {});
      
      nixosModules = mapModulesRec ./modules import;
      
      nixosConfigurations = mapHosts ./hosts {};
    };
}
