{
  description = "nixos config";

  inputs = {
    # nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    nixpkgs.follows = "nixos-cosmic/nixpkgs";

    nur.url = "github:/nix-community/NUR";

    # rust-overlay = {
    #   url = "github:oxalica/rust-overlay";
    #   inputs.nixpkgs.follows = "nixpkgs";
    # };
    rust-overlay.follows = "nixos-cosmic/rust-overlay";

    helix.url = "github:helix-editor/helix";

    home-manager = {
      # url = "github:nix-community/home-manager";
      url = "github:n-hass/home-manager/podman-module";
      inputs.nixpkgs.follows = "nixpkgs";
    };

    nix-index-database.url = "github:Mic92/nix-index-database";

    nix-rice.url = "github:bertof/nix-rice";

    nixd.url = "github:nix-community/nixd";

    flatpaks.url = "github:gmodena/nix-flatpak";

    nixos-cosmic.url = "github:lilyinstarlight/nixos-cosmic";

    madness.url = "github:antithesishq/madness";

    nh.url = "github:viperML/nh";

    lix = {
      url = "https://git.lix.systems/lix-project/lix/archive/main.tar.gz";
      flake = false;
    };

    lix-module = {
      url = "https://git.lix.systems/lix-project/nixos-module/archive/main.tar.gz";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.lix.follows = "lix";
    };

    meat = {
      url = "path:/home/bolt/code/meat";
      inputs.nixpkgs.follows = "nixpkgs";
      inputs.lix.follows = "lix";
      inputs.lix-module.follows = "lix-module";
      inputs.nh.follows = "nh";
      inputs.rust-overlay.follows = "rust-overlay";
    };

    comfyui.url = "path:./flakes/ComfyUI";
    comfyui-plugins.url = "path:./flakes/ComfyUI-Plugins";

    podman = {
      flake = false;
      url = "github:containers/podman";
    };

    murex = {
      url = "github:lmorg/murex/develop";
      flake = false;
    };

    murex-jump.url = "path:./flakes/murex-module-jump";
    murex-starship.url = "path:./flakes/murex-module-starship";
  };

  outputs = {
    self,
    nixpkgs,
    nixos-cosmic,
    home-manager,
    nur,
    flatpaks,
    nix-index-database,
    madness,
    lix-module,
    meat,
    comfyui,
    ...
  } @ inputs: let
    inherit (self) outputs;
    inherit (nixpkgs) lib;
    inherit (lib) mapAttrs;
    sharedModules = [
      meat.nixosModules.meat
      madness.nixosModules.madness
      nur.nixosModules.nur
      nix-index-database.nixosModules.nix-index
      nixos-cosmic.nixosModules.default
      ./system/cachix.nix
    ];
    system = "x86_64-linux";
    createSystems = definitions:
      mapAttrs (name: info:
        nixpkgs.lib.nixosSystem {
          inherit system;
          specialArgs = {inherit inputs outputs;};
          modules =
            [
              ./system/${name}.nix
              home-manager.nixosModules.home-manager
              {
                home-manager = {
                  useGlobalPkgs = true;
                  extraSpecialArgs = {inherit inputs outputs;};
                  users.${info.user}.imports =
                    [
                      flatpaks.homeManagerModules.nix-flatpak
                      ./home/${info.user}.nix
                    ]
                    ++ info.hmImports or [];
                };
              }
            ]
            ++ info.imports or []
            ++ sharedModules;
        })
      definitions;
  in {
    overlays = import ./util/overlay.nix {inherit inputs;};

    nixosConfigurations = createSystems {
      quiver.user = "bolt";
      adrift.user = "plank";
    };
  };
}
