41 lines
1.1 KiB
Nix
41 lines
1.1 KiB
Nix
{ static ? false # whether to build fully static binaries
|
|
}:
|
|
|
|
let
|
|
|
|
nixpkgs = import (builtins.fetchTarball
|
|
{ url = "https://github.com/NixOS/nixpkgs/archive/f12ee5f64c6a.tar.gz";
|
|
sha256 = "14afxk35w3kbqimxcp39ngv9cqpc24glss1727ymk4napfg5v7hm";
|
|
}) { };
|
|
|
|
pkgs = if static then nixpkgs.pkgsStatic else nixpkgs;
|
|
|
|
magnetico = { lib, stdenv, buildGoModule, nixosTests, sqlite }:
|
|
buildGoModule {
|
|
pname = "magnetico";
|
|
version = "0.12.1";
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
vendorHash = "sha256-jIVMQtPCq9RYaYsH4LSZJFspH6TpCbgzHN0GX8cM/CI=";
|
|
|
|
buildInputs = [ sqlite ];
|
|
|
|
tags = [ "fts5" "libsqlite3" ];
|
|
ldflags = [ "-s" "-w" ];
|
|
|
|
doCheck = !stdenv.hostPlatform.isStatic;
|
|
|
|
passthru.tests = { inherit (nixosTests) magnetico; };
|
|
|
|
meta = with lib; {
|
|
description = "Autonomous (self-hosted) BitTorrent DHT search engine suite";
|
|
homepage = "https://maxwell.ydns.eu/git/rnhmjoj/magnetico";
|
|
license = licenses.agpl3Only;
|
|
badPlatforms = platforms.darwin;
|
|
maintainers = with maintainers; [ rnhmjoj ];
|
|
};
|
|
};
|
|
|
|
in pkgs.callPackage magnetico { }
|