mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-27 09:23:01 +00:00
e0464e4788
In preparation for the deprecation of `stdenv.isX`. These shorthands are not conducive to cross-compilation because they hide the platforms. Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way One example of why this is bad and especially affects compiler packages https://www.github.com/NixOS/nixpkgs/pull/343059 There are too many files to go through manually but a treewide should get users thinking when they see a `hostPlatform.isX` in a place where it doesn't make sense. ``` fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is" fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is" fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is" ```
78 lines
2.2 KiB
Nix
78 lines
2.2 KiB
Nix
{ cfgPath ? "/etc/nncp.hjson"
|
|
, curl
|
|
, fetchurl
|
|
, lib
|
|
, genericUpdater
|
|
, go
|
|
, perl
|
|
, stdenv
|
|
, writeShellScript
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "nncp";
|
|
version = "8.11.0";
|
|
outputs = [ "out" "doc" "info" ];
|
|
|
|
src = fetchurl {
|
|
url = "http://www.nncpgo.org/download/nncp-${finalAttrs.version}.tar.xz";
|
|
hash = "sha256-7EEUvNkYSqh4HzjbqjqgQlXfu6nDU2v3WWnma8M0r/I=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
go
|
|
];
|
|
|
|
# Build parameters
|
|
CFGPATH = cfgPath;
|
|
SENDMAIL = "sendmail";
|
|
|
|
preConfigure = "export GOCACHE=$NIX_BUILD_TOP/gocache";
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
./bin/build
|
|
runHook postBuild
|
|
'';
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
PREFIX=$out ./install
|
|
runHook postInstall
|
|
'';
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
passthru.updateScript = genericUpdater {
|
|
versionLister = writeShellScript "nncp-versionLister" ''
|
|
${curl}/bin/curl -s ${finalAttrs.meta.downloadPage} | ${perl}/bin/perl -lne 'print $1 if /Release.*>([0-9.]+)</'
|
|
'';
|
|
};
|
|
|
|
meta = {
|
|
broken = stdenv.hostPlatform.isDarwin;
|
|
changelog = "http://www.nncpgo.org/News.html";
|
|
description = "Secure UUCP-like store-and-forward exchanging";
|
|
downloadPage = "http://www.nncpgo.org/Tarballs.html";
|
|
homepage = "http://www.nncpgo.org/";
|
|
license = lib.licenses.gpl3Only;
|
|
longDescription = ''
|
|
This utilities are intended to help build up small size (dozens of
|
|
nodes) ad-hoc friend-to-friend (F2F) statically routed darknet
|
|
delay-tolerant networks for fire-and-forget secure reliable files,
|
|
file requests, Internet mail and commands transmission. All
|
|
packets are integrity checked, end-to-end encrypted, explicitly
|
|
authenticated by known participants public keys. Onion encryption
|
|
is applied to relayed packets. Each node acts both as a client and
|
|
server, can use push and poll behaviour model.
|
|
|
|
Out-of-box offline sneakernet/floppynet, dead drops, sequential
|
|
and append-only CD-ROM/tape storages, air-gapped computers
|
|
support. But online TCP daemon with full-duplex resumable data
|
|
transmission exists.
|
|
'';
|
|
maintainers = with lib.maintainers; [ ehmry woffs ];
|
|
platforms = lib.platforms.all;
|
|
};
|
|
})
|