2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, perl, ebtables, ipset, iptables, nixosTests }:
|
2016-08-21 23:12:19 +02:00
|
|
|
|
2019-12-02 18:04:37 +01:00
|
|
|
let
|
2021-01-15 10:19:50 +01:00
|
|
|
inherit (lib.versions) majorMinor;
|
2019-12-02 18:04:37 +01:00
|
|
|
in stdenv.mkDerivation rec {
|
2020-04-13 18:37:57 +02:00
|
|
|
version = "2.5.1";
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "ferm";
|
2016-08-21 23:12:19 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-12-02 18:04:37 +01:00
|
|
|
url = "http://ferm.foo-projects.org/download/${majorMinor version}/ferm-${version}.tar.xz";
|
2020-04-13 18:37:57 +02:00
|
|
|
sha256 = "0awl9s243sxgayr2fcmfks8xydhrmb9gy8bd9sfq738dgq7vybjb";
|
2016-08-21 23:12:19 +02:00
|
|
|
};
|
|
|
|
|
2020-04-13 18:37:57 +02:00
|
|
|
# perl is used at build time to gather the ferm version.
|
|
|
|
nativeBuildInputs = [ makeWrapper perl ];
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PERL=perl"
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
2016-08-21 23:12:19 +02:00
|
|
|
postInstall = ''
|
|
|
|
rm -r $out/lib/systemd
|
|
|
|
for i in "$out/sbin/"*; do
|
2021-01-15 10:19:50 +01:00
|
|
|
wrapProgram "$i" --prefix PATH : "${lib.makeBinPath [ iptables ipset ebtables ]}"
|
2016-08-21 23:12:19 +02:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2019-11-29 13:25:52 +01:00
|
|
|
passthru.tests.ferm = nixosTests.ferm;
|
|
|
|
|
2016-08-21 23:12:19 +02:00
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://ferm.foo-projects.org/";
|
2016-08-21 23:12:19 +02:00
|
|
|
description = "Tool to maintain complex firewalls";
|
|
|
|
longDescription = ''
|
|
|
|
ferm is a tool to maintain complex firewalls, without having the trouble to
|
|
|
|
rewrite the complex rules over and over again. ferm allows the entire
|
|
|
|
firewall rule set to be stored in a separate file, and to be loaded with one
|
|
|
|
command. The firewall configuration resembles structured programming-like
|
|
|
|
language, which can contain levels and lists.
|
|
|
|
'';
|
2021-01-15 10:19:50 +01:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
maintainers = with lib.maintainers; [mic92];
|
|
|
|
platforms = lib.platforms.linux;
|
2016-08-21 23:12:19 +02:00
|
|
|
};
|
|
|
|
}
|