nex-pkg 0.25.5

Package manager UX for nix-darwin + homebrew
Documentation
{
  description = "Package manager UX for nix-darwin + homebrew";

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

  outputs = { self, nixpkgs }:
    let
      supportedSystems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ];
      forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
      # Read version from Cargo.toml so it's never out of sync
      cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
    in
    {
      packages = forAllSystems (system:
        let
          pkgs = nixpkgs.legacyPackages.${system};
        in
        {
          default = pkgs.rustPlatform.buildRustPackage {
            pname = "nex";
            version = cargoToml.package.version;
            src = pkgs.lib.cleanSource ./.;
            cargoLock.lockFile = ./Cargo.lock;
            nativeBuildInputs = [ pkgs.makeWrapper ];
            nativeCheckInputs = [ pkgs.git pkgs.curl ];
            postInstall = ''
              wrapProgram $out/bin/nex \
                --prefix PATH : ${pkgs.lib.makeBinPath [ pkgs.pkl ]}
            '';
            meta = with pkgs.lib; {
              description = "Package manager UX for nix-darwin + homebrew";
              homepage = "https://nex.styrene.io";
              license = with licenses; [ mit asl20 ];
              mainProgram = "nex";
            };
          };
        }
      );

      devShells = forAllSystems (system:
        let
          pkgs = nixpkgs.legacyPackages.${system};
        in
        {
          default = pkgs.mkShell {
            buildInputs = with pkgs; [
              rustc
              cargo
              clippy
              rustfmt
              rust-analyzer
              pkl
            ];
          };
        }
      );
    };
}