2021-12-06 16:07:01 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, perl, iptables, nixosTests }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
let
|
2021-01-15 22:18:51 +00:00
|
|
|
inherit (lib.versions) majorMinor;
|
2020-04-24 23:36:52 +00:00
|
|
|
in stdenv.mkDerivation rec {
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "2.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "ferm";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://ferm.foo-projects.org/download/${majorMinor version}/ferm-${version}.tar.xz";
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-wA2RDVOU5pZ1YI617g9QTVz9pB6ZCi2akbqsbfk+P5I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
patches = [
|
|
|
|
./import-ferm-wrapped.patch
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# perl is used at build time to gather the ferm version.
|
|
|
|
nativeBuildInputs = [ makeWrapper perl ];
|
|
|
|
buildInputs = [ perl ];
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"PERL=perl"
|
|
|
|
"PREFIX=${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -r $out/lib/systemd
|
|
|
|
for i in "$out/sbin/"*; do
|
2021-12-06 16:07:01 +00:00
|
|
|
wrapProgram "$i" --prefix PATH : "${lib.makeBinPath [ iptables ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.ferm = nixosTests.ferm;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "http://ferm.foo-projects.org/";
|
|
|
|
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.
|
|
|
|
'';
|
2024-05-15 15:35:15 +00:00
|
|
|
license = lib.licenses.gpl2Plus;
|
2021-01-15 22:18:51 +00:00
|
|
|
maintainers = with lib.maintainers; [mic92];
|
|
|
|
platforms = lib.platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|