Files
nixpkgs/pkgs/by-name/fw/fwknop/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

79 lines
1.9 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
libpcap,
texinfo,
iptables,
gnupgSupport ? true,
gnupg,
gpgme, # Increases dependencies!
wgetSupport ? true,
wget,
buildServer ? true,
buildClient ? true,
}:
stdenv.mkDerivation rec {
pname = "fwknop";
version = "2.6.11";
src = fetchFromGitHub {
owner = "mrash";
repo = "fwknop";
tag = version;
hash = "sha256-jnEBRJCt7pAmXRIBVT2OwJqT5Zr/JaRgPDqccx0W/9o=";
};
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [
libpcap
texinfo
]
++ lib.optionals gnupgSupport [
gnupg
gpgme.dev
]
++ lib.optionals wgetSupport [ wget ];
configureFlags = [
"--sysconfdir=/etc"
"--localstatedir=/run"
"--with-iptables=${iptables}/sbin/iptables"
(lib.enableFeature buildServer "server")
(lib.enableFeature buildClient "client")
(lib.withFeatureAs wgetSupport "wget" "${wget}/bin/wget")
]
++ lib.optionalString gnupgSupport [
"--with-gpgme"
"--with-gpgme-prefix=${gpgme.dev}"
"--with-gpg=${gnupg}"
];
# Temporary hack to copy the example configuration files into the nix-store,
# this'll probably be helpful until there's a NixOS module for that (feel free
# to ping me (@primeos) if you want to help).
preInstall = ''
substituteInPlace Makefile --replace-fail \
"sysconfdir = /etc"\
"sysconfdir = $out/etc"
substituteInPlace server/Makefile --replace-fail \
"wknopddir = /etc/fwknop"\
"wknopddir = $out/etc/fwknop"
'';
meta = with lib; {
description = "Single Packet Authorization (and Port Knocking) server/client";
longDescription = ''
fwknop stands for the "FireWall KNock OPerator", and implements an
authorization scheme called Single Packet Authorization (SPA).
'';
homepage = "https://www.cipherdyne.org/fwknop/";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = [ ];
};
}