~zethra/public-inbox

license: Adds nix build spec. v2 PROPOSED

Billy Stevens: 1
 Adds nix build spec.

 1 files changed, 40 insertions(+), 0 deletions(-)
#635077 .build.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~zethra/public-inbox/patches/26832/mbox | git am -3
Learn more about email & git

[PATCH license v2] Adds nix build spec. Export this patch

---

Fixes package description text.

 contrib/pkg/nix/license.nix | 40 +++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 contrib/pkg/nix/license.nix

diff --git a/contrib/pkg/nix/license.nix b/contrib/pkg/nix/license.nix
new file mode 100644
index 0000000..2c46ee4
--- /dev/null
+++ b/contrib/pkg/nix/license.nix
@@ -0,0 +1,40 @@
with import <nixpkgs> {};
rustPlatform.buildRustPackage rec {
  pname = "license";
  version = "2.6.0";
  
  src = fetchFromSourcehut {
    owner = "~zethra";
    repo = pname;
    rev = version;
    sha256 = "119i9ac73mchjpml6acvi6kq50b5izbaia4gh4nhcd0b4yqxxxrq";
  };

  nativeBuildInputs = [ scdoc installShellFiles makeWrapper ];
  buildInputs = [ fzf xclip ];

  cargoSha256 = "14n4gbdhniz5ln56qjqj1qdvqb65j42lg4vhpcgiwx0hq6hd8ybq";

  postInstall = ''
    install -m755 "scripts/set-license" "$out/bin/set-license"
    wrapProgram "$out/bin/set-license" --prefix PATH : ${pkgs.lib.makeBinPath buildInputs}

    install -m755 "scripts/copy-header" "$out/bin/copy-header"
    wrapProgram "$out/bin/copy-header" --prefix PATH : ${pkgs.lib.makeBinPath buildInputs}

    scdoc < doc/license.scd > doc/license.1
    installManPage doc/license.1


    installShellCompletion \
      --bash completions/license.bash \
      --zsh completions/_license \
      --fish completions/license.fish
    '';

  meta = with lib; {
    description = "A tool to easily add a license to your project.";
    homepage = "https://git.sr.ht/~zethra/license";
    license = licenses.mpl20;
  };
}
-- 
2.31.1
Thanks!

Patch has been added. FYI I released a new version 2.6.1 today. Fixed an 
error in the WTPL license.
license/patches/.build.yml: SUCCESS in 1m58s

[Adds nix build spec.][0] v2 from [Billy Stevens][1]

[0]: https://lists.sr.ht/~zethra/public-inbox/patches/26832
[1]: mailto:contact@wasv.me

✓ #635077 SUCCESS license/patches/.build.yml https://builds.sr.ht/~zethra/job/635077