{
  inputs = {
    nixpkgs.url          = "github:NixOS/nixpkgs/nixos-25.11";
    nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable";
    import-tree.url      = "github:vic/import-tree";
    flake-aspects.url    = "github:vic/flake-aspects";
    den.url              = "github:vic/den";

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

    disko = {
      url    = "github:nix-community/disko";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    niri-flake.url = "github:sodiboo/niri-flake";

    sops-nix = {
      url    = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    claude-code.url = "github:sadjow/claude-code-nix";

    qml-niri = {
      url    = "github:imiric/qml-niri/main";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = inputs:
    let
      system = "x86_64-linux";
      pkgs   = inputs.nixpkgs.legacyPackages.${system};
      flake  = (inputs.nixpkgs.lib.evalModules {
        modules      = [ (inputs.import-tree ./modules) ];
        specialArgs.inputs = inputs;
      }).config.flake;
    in flake // {
      nixosConfigurations = flake.nixosConfigurations // {
        installer = inputs.nixpkgs.lib.nixosSystem {
          modules     = [
            ./installer/default.nix
            { nixpkgs.hostPlatform.system = system; }
          ];
          specialArgs = { inherit inputs; };
        };
      };

      devShells.${system}.default = pkgs.mkShell {
        packages = [ pkgs.just ];
      };
    };
}
