{
  description = "NixOS HomeLab";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs";
    colmena.url = "github:zhaofengli/colmena";
    sops-nix = {
      url = "github:Mic92/sops-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    nixarr.url = "github:rasmus-kirk/nixarr";
    # simple-nixos-mailserver = {
    #   url = "gitlab:simple-nixos-mailserver/nixos-mailserver";
    #   inputs.nixpkgs.follwos = "nixpkgs";
    # };
  };

  outputs = inputs @ {
    nixpkgs,
    colmena,
    ...
  }: let
    system = "x86_64-linux";

    liveVMs = {
      traefik = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/traefik/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
      };

      sandbox = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/sandbox/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
      };

      mail = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/mail/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
      };

      keycloak = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/keycloak/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
      };

      dns = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/dns/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
      };

      monitoring = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/monitoring/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
      };

      media = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/media/host.nix
          inputs.sops-nix.nixosModules.sops
          inputs.nixarr.nixosModules.default
        ];
      };

      forgejo = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/forgejo/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
      };

      runner01 = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/forgejo-runner/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
        specialArgs.runnerId = "01";
      };

      builder = inputs.nixpkgs.lib.nixosSystem {
        inherit system;
        modules = [
          ./hosts/nixos-builder/host.nix
          inputs.sops-nix.nixosModules.sops
        ];
      };
    };
  in {
    nixosConfigurations = liveVMs;

    colmenaHive = colmena.lib.makeHive {
      meta = {
        nixpkgs = import nixpkgs {
          system = "x86_64-linux";
          overlays = [];
        };

        defaults = {pkgs, ...}: {
        };
      };

      host-b = {
        name,
        nodes,
        pkgs,
        ...
      }: {
        deployment = {
          targetHost = "somehost.tld";
          targetPort = 1234;
          targetUser = "luser";
        };
        boot.isContainer = true;
        time.timeZone = "America/Los_Angeles";
      };
    };
  };
}
