home

My NixOS systems configurations.
Log | Files | Refs | LICENSE

commit 4f671926e101538f55d672779500203e91bacd97
parent 36f87c730f2f4699686fefa4498828668c7f65f9
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Tue, 25 Oct 2022 12:27:45 +0200

nix/packages: add gosmee (and add it to go "profile")

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mnix/packages/default.nix | 7++++---
Anix/packages/gosmee/default.nix | 33+++++++++++++++++++++++++++++++++
Musers/vincent/dev/go.nix | 1+
3 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/nix/packages/default.nix b/nix/packages/default.nix @@ -1,6 +1,4 @@ -{ sources ? import ../. -, pkgs ? sources.pkgs { } -}: +{ pkgs ? import <nixpkgs> { } }: rec { # pre nur-packages import @@ -39,6 +37,9 @@ rec { rmapi = pkgs.callPackage ./rmapi { }; toolbox = pkgs.callPackage ./toolbox { }; yaspell = pkgs.callPackage ./yaspell { }; + gosmee = pkgs.callPackage ./gosmee { + buildGoModule = pkgs.buildGo119Module; # build fails with 1.19 + }; inherit (pkgs.callPackage ./kam { }) kam_1_1 diff --git a/nix/packages/gosmee/default.nix b/nix/packages/gosmee/default.nix @@ -0,0 +1,33 @@ +{ stdenv, lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + name = "gosmee-${version}"; + version = "0.14.0"; + rev = "${version}"; + + src = fetchFromGitHub { + inherit rev; + owner = "chmouel"; + repo = "gosmee"; + sha256 = "sha256-VKH0ajtLndTdW0dOY3XpixkTGy7Kvac7poFZVzj5HQU="; + }; + vendorSha256 = null; + + postUnpack = '' + printf ${version} > $sourceRoot/gosmee/templates/version + ''; + + postInstall = '' + # completions + mkdir -p $out/share/bash-completion/completions/ + $out/bin/gosmee completion bash > $out/share/bash-completion/completions/gosmee + mkdir -p $out/share/zsh/site-functions + $out/bin/gosmee completion zsh > $out/share/zsh/site-functions/_gosmee + ''; + + meta = { + description = "Command line server and client for webhooks deliveries (and https://smee.io)"; + homepage = "https://github.com/chmouel/gosmee"; + license = lib.licenses.asl20; + }; +} diff --git a/users/vincent/dev/go.nix b/users/vincent/dev/go.nix @@ -23,6 +23,7 @@ my.esc my.yaspell # not really go but still + gosmee cue ]; }