4a7f99d55d
Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
40 lines
1.1 KiB
Nix
40 lines
1.1 KiB
Nix
{ lib, stdenv, buildGoModule, fetchFromGitHub, nixosTests }:
|
|
|
|
buildGoModule rec {
|
|
pname = "corerad";
|
|
version = "0.3.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "mdlayher";
|
|
repo = "corerad";
|
|
rev = "v${version}";
|
|
sha256 = "1q4wcliifas8xvwy7kcq4fbc1iv7dha3k6j1nbwl7pjqmyggs3f4";
|
|
};
|
|
|
|
vendorSha256 = "07khxs15z9xzcmp4gyggdwqyz361y96h6ib92qax8k83cr0l494p";
|
|
|
|
doCheck = false;
|
|
|
|
# Since the tarball pulled from GitHub doesn't contain git tag information,
|
|
# we fetch the expected tag's timestamp from a file in the root of the
|
|
# repository.
|
|
preBuild = ''
|
|
buildFlagsArray=(
|
|
-ldflags="
|
|
-X github.com/mdlayher/corerad/internal/build.linkTimestamp=$(<.gittagtime)
|
|
-X github.com/mdlayher/corerad/internal/build.linkVersion=v${version}
|
|
"
|
|
)
|
|
'';
|
|
|
|
passthru.tests = {
|
|
inherit (nixosTests) corerad;
|
|
};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://github.com/mdlayher/corerad";
|
|
description = "Extensible and observable IPv6 NDP RA daemon";
|
|
license = licenses.asl20;
|
|
maintainers = with maintainers; [ mdlayher ];
|
|
};
|
|
}
|