Skip to content

Nix packaging considerations

I'd like to add snowflake to nixpkgs, and wanted to make sure I do so properly.

My current attempt at doing so is here: https://github.com/witchof0x20/nixpkgs/blob/snowflake/pkgs/tools/networking/snowflake/default.nix which is basically a carbon copy of the way obfs4 is packaged in nixpkgs. I'll include it here for convenience:

{ lib, fetchgit, buildGoModule }:
buildGoModule rec {
  pname = "snowflake";
  version = "1.1.0";

  src = fetchgit {
    url = meta.repositories.git;
    rev = "refs/tags/v${version}";
    sha256 = "0d5ddhg2p0mbcj1cmklwn04za2x1khxgm5x9qlsg1ywkn6ngnxad";
  };

  vendorSha256 = "15nzqibrymbbn6cwz3267jxk60xr5f6v3akwplhjzcc16bgrcx57";

  doCheck = false;
  
  meta = with lib; {
    description = "A pluggable transport proxy";
    homepage = "https://snowflake.torproject.org";
    repositories.git = "https://git.torproject.org/pluggable-transports/snowflake.git";
    license = licenses.bsd3;
    maintainers = with maintainers; [ witchof0x20 ];
  };
}

This generates a single bin directory containing:

broker client probetest proxy server

My questions are

  • I record the package license as BSD 3-clause in the derivation's metadata. Is this sufficient to cover licensing concerns?
  • Should additional files other than binaries become available to those who install snowflake, such as example configurations, documentation, etc?
  • I use git.torproject.org as the package source. This would typically be accessed from NixOS's binary-generating build servers, and sometimes end users, but there is a potential that it creates additional load on the server. Would it be more appropriate to use a Github mirror? The obfs4 derivation also uses this server, for reference.
  • Is there anything else I'm missing?
Edited by jade