{
  description = "NDI Discovery Go program";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = {self, nixpkgs, flake-utils, ... }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { system = system; config.allowUnfree = true; };
      in {
        devShell = pkgs.mkShell {
          buildInputs = with pkgs; [
            go_1_23

            gst_all_1.gstreamer
            gst_all_1.gstreamer.dev
            gst_all_1.gst-plugins-base
            gst_all_1.gst-plugins-good
            gst_all_1.gst-plugins-bad
            gst_all_1.gst-plugins-ugly

            gcc glib pkg-config
            ndi
          ];
          LIBNDI="${pkgs.ndi}/lib/libndi.so";
          CFLAGS="-I${pkgs.ndi}/include";
          LDFLAGS="-L${pkgs.ndi}/lib -lndi";

          shellHook = ''
            zsh
          '';
        };
        packages = {
          catie = import ./package.nix { inherit pkgs; inherit self; };
        };
        defaultPackage = import ./package.nix { inherit pkgs; inherit self; };

        apps = {
          catie = {
            type = "app";
            program = "${self.packages.${system}.ndi_discover}/bin/catie";
          };
        };
      });
}