2021-11-13 23:28:25 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, autoconf, automake, curl, iprange, iproute2, iptables, iputils
|
2020-11-24 16:29:28 +01:00
|
|
|
, kmod, nettools, procps, tcpdump, traceroute, util-linux, whois
|
2017-09-09 00:29:39 +02:00
|
|
|
|
2018-03-07 00:40:27 +01:00
|
|
|
# If true, just install FireQOS without FireHOL
|
|
|
|
, onlyQOS ? false
|
2017-09-09 00:29:39 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "firehol";
|
2021-01-18 18:36:35 +01:00
|
|
|
version = "3.1.7";
|
2017-09-09 00:29:39 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "firehol";
|
|
|
|
repo = "firehol";
|
|
|
|
rev = "v${version}";
|
2021-01-18 18:36:35 +01:00
|
|
|
sha256 = "sha256-gq7l7QoUsK+j5DUn84kD9hlUTC4hz3ds3gNJc1tRygs=";
|
2017-09-09 00:29:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# configure tries to determine if `ping6` or the newer, combined
|
|
|
|
# `ping` is installed by using `ping -6` which would fail.
|
2021-01-01 13:44:58 +01:00
|
|
|
./firehol-ping6.patch
|
2018-02-18 15:58:13 +01:00
|
|
|
|
|
|
|
# put firehol config files in /etc/firehol (not $out/etc/firehol)
|
|
|
|
# to avoid error on startup, see #35114
|
2021-01-01 13:44:58 +01:00
|
|
|
./firehol-sysconfdir.patch
|
2018-02-18 16:12:06 +01:00
|
|
|
|
2021-01-01 13:44:58 +01:00
|
|
|
# we must quote "$UNAME_CMD", or the dash in
|
|
|
|
# /nix/store/...-coreutils-.../bin/uname will be interpreted as
|
|
|
|
# IFS -> error. this might be considered an upstream bug but only
|
|
|
|
# appears when there are dashes in the command path
|
|
|
|
./firehol-uname-command.patch
|
2017-09-09 00:29:39 +02:00
|
|
|
];
|
2021-01-01 13:44:58 +01:00
|
|
|
|
2017-09-09 00:29:39 +02:00
|
|
|
nativeBuildInputs = [ autoconf automake ];
|
|
|
|
buildInputs = [
|
2020-04-28 12:33:27 +02:00
|
|
|
curl iprange iproute2 iptables iputils kmod
|
2020-11-24 16:29:28 +01:00
|
|
|
nettools procps tcpdump traceroute util-linux whois
|
2017-09-09 00:29:39 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = "./autogen.sh";
|
|
|
|
configureFlags = [ "--localstatedir=/var"
|
2020-04-28 12:33:27 +02:00
|
|
|
"--disable-doc" "--disable-man"
|
|
|
|
"--disable-update-ipsets" ] ++
|
2022-10-06 18:38:53 +02:00
|
|
|
lib.optionals onlyQOS [ "--disable-firehol" ];
|
2017-09-09 00:29:39 +02:00
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2017-09-09 00:29:39 +02:00
|
|
|
description = "A firewall for humans";
|
|
|
|
longDescription = ''
|
|
|
|
FireHOL, an iptables stateful packet filtering firewall for humans!
|
|
|
|
FireQOS, a TC based bandwidth shaper for humans!
|
|
|
|
'';
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://firehol.org/";
|
2017-09-09 00:29:39 +02:00
|
|
|
license = licenses.gpl2;
|
2020-08-15 15:25:59 +02:00
|
|
|
maintainers = with maintainers; [ oxzi ];
|
2017-09-09 00:29:39 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|