workmux 0.1.93

An opinionated workflow tool that orchestrates git worktrees and tmux
{
  description = "Parallel development in tmux with git worktrees";

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

  outputs = { self, nixpkgs }:
    let
      forAllSystems = f: nixpkgs.lib.genAttrs
        [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]
        (system: f nixpkgs.legacyPackages.${system});
    in {
      packages = forAllSystems (pkgs: {
        default = pkgs.rustPlatform.buildRustPackage {
          pname = "workmux";
          version = self.shortRev or self.dirtyShortRev or "dev";
          src = ./.;
          cargoLock.lockFile = ./Cargo.lock;
          nativeBuildInputs = [ pkgs.installShellFiles ];
          postInstall = ''
            export HOME=$TMPDIR
            installShellCompletion --cmd workmux \
              --bash <($out/bin/workmux completions bash) \
              --fish <($out/bin/workmux completions fish) \
              --zsh <($out/bin/workmux completions zsh)
          '';
        };
      });
    };
}