nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1264B)


      1 {
      2   lib,
      3   stdenv,
      4   buildGoModule,
      5   fetchFromGitHub,
      6   installShellFiles,
      7   libpcap,
      8 }:
      9 
     10 buildGoModule rec {
     11   pname = "shifu";
     12   version = "0.57.0";
     13 
     14   src = fetchFromGitHub {
     15     owner = "Edgenesis";
     16     repo = "shifu";
     17     rev = "v${version}";
     18     hash = "sha256-RRK8N/CLNWf9Jkq1Y2wJ2BGgjJNNc2roI9ChREkF06I=";
     19   };
     20 
     21   vendorHash = "sha256-SCse0FybcWNLshY0stgbV/AC3Y17znFtAKKhtCaZeGM=";
     22 
     23   nativeBuildInputs = [ installShellFiles ];
     24 
     25   buildInputs = [ libpcap ];
     26 
     27   subPackages = [
     28     "cmd/deviceshifu/cmdhttp"
     29     "cmd/deviceshifu/cmdmqtt"
     30     "cmd/deviceshifu/cmdopcua"
     31     "cmd/deviceshifu/cmdplc4x"
     32     "cmd/deviceshifu/cmdsocket"
     33     "cmd/httpstub/powershellstub"
     34     "cmd/httpstub/sshstub"
     35     "cmd/shifuctl"
     36     "cmd/telemetryservice"
     37   ];
     38 
     39   postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
     40     installShellCompletion --cmd shifuctl \
     41       --bash <($out/bin/shifuctl completion bash) \
     42       --fish <($out/bin/shifuctl completion fish) \
     43       --zsh <($out/bin/shifuctl completion zsh)
     44   '';
     45 
     46   meta = {
     47     description = "Kubernetes-native IoT gateway";
     48     homepage = "https://shifu.dev/";
     49     license = lib.licenses.asl20;
     50     maintainers = [ lib.maintainers.sikmir ];
     51     mainProgram = "shifuctl";
     52   };
     53 }