decompose 0.2.1

A simple and flexible scheduler and orchestrator to manage non-containerized applications
Documentation
{
  description = "decompose - fast local process orchestration for coding workflows";

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

  outputs = { self, nixpkgs }:
    let
      systems = [
        "x86_64-linux"
        "aarch64-linux"
        "x86_64-darwin"
        "aarch64-darwin"
      ];
      forAllSystems = f:
        nixpkgs.lib.genAttrs systems (system:
          f (import nixpkgs { inherit system; }));
      cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
    in {
      packages = forAllSystems (pkgs: {
        default = pkgs.rustPlatform.buildRustPackage {
          pname = cargoToml.package.name;
          version = cargoToml.package.version;
          src = ./.;
          cargoLock = {
            lockFile = ./Cargo.lock;
          };
          nativeBuildInputs = [ pkgs.pkg-config pkgs.installShellFiles ];
          nativeCheckInputs = [ pkgs.python3 ];
          postInstall = ''
            installShellCompletion --cmd decompose \
              --bash <($out/bin/decompose completion bash) \
              --fish <($out/bin/decompose completion fish) \
              --zsh  <($out/bin/decompose completion zsh)
          '';
          meta = {
            description = cargoToml.package.description;
            homepage = cargoToml.package.homepage;
            license = [ nixpkgs.lib.licenses.mit nixpkgs.lib.licenses.asl20 ];
            mainProgram = "decompose";
          };
        };
      });

      apps = forAllSystems (pkgs: {
        default = {
          type = "app";
          program = "${self.packages.${pkgs.system}.default}/bin/decompose";
        };
      });

      devShells = forAllSystems (pkgs: {
        default = pkgs.mkShell {
          packages = with pkgs; [
            cargo
            rustc
            rustfmt
            clippy
            pkg-config
            vhs
          ];
        };
      });
    };
}