Skip to content

Add Nix/NixOS package distribution #142

@wkoszek

Description

@wkoszek

Add support for distributing bsubio CLI through nixpkgs for Nix and NixOS users.

Goal

Enable Nix/NixOS users to install bsubio using their native package manager.

Distribution Options

1. Official nixpkgs Repository (Recommended)

  • Submit package to https://github.com/NixOS/nixpkgs
  • Users install with: nix-env -iA nixpkgs.bsubio
  • NixOS users add to configuration.nix: environment.systemPackages = [ pkgs.bsubio ];
  • Requires creating and submitting a PR to nixpkgs

2. Flakes Support

  • Create flake.nix in repository
  • Users can run directly: nix run github:bsubio/cli
  • Can be added to flake inputs

Implementation Plan

Phase 1: Create Nix Package Expression

  • Create a derivation for bsubio
  • Test locally with nix-build
  • Support both x86_64-linux and aarch64-linux

Phase 2: Submit to nixpkgs

  • Fork nixpkgs repository
  • Add package to pkgs/by-name/bs/bsubio/package.nix
  • Create PR to nixpkgs
  • Work with maintainers for review

Phase 3: Add Flake Support (Optional)

  • Create flake.nix in repository
  • Enable direct installation via flakes

Example Package Definition

{ lib, buildGoModule, fetchFromGitHub }:

buildGoModule rec {
  pname = "bsubio";
  version = "0.11.0";

  src = fetchFromGitHub {
    owner = "bsubio";
    repo = "cli";
    rev = "v${version}";
    sha256 = "...";
  };

  vendorHash = "...";

  ldflags = [ "-s" "-w" "-X main.version=${version}" ];

  meta = with lib; {
    description = "CLI for easy running heavy duty compute jobs in the cloud";
    homepage = "https://bsub.io";
    license = licenses.mit;
    maintainers = [ ];
  };
}

Installation After Implementation

# Nix package manager
nix-env -iA nixpkgs.bsubio

# NixOS configuration.nix
environment.systemPackages = [ pkgs.bsubio ];

# With flakes
nix run github:bsubio/cli

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions