2017-09-08 23:29:39 +01:00
|
|
|
{ stdenv, lib, fetchFromGitHub, pkgs
|
2020-04-28 11:33:27 +01:00
|
|
|
, autoconf, automake, curl, iprange, iproute2, iptables, iputils
|
2020-11-24 15:29:28 +00:00
|
|
|
, kmod, nettools, procps, tcpdump, traceroute, util-linux, whois
|
2017-09-08 23:29:39 +01:00
|
|
|
|
2018-03-06 23:40:27 +00:00
|
|
|
# If true, just install FireQOS without FireHOL
|
|
|
|
, onlyQOS ? false
|
2017-09-08 23:29:39 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "firehol";
|
2021-01-18 17:36:35 +00:00
|
|
|
version = "3.1.7";
|
2017-09-08 23:29:39 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "firehol";
|
|
|
|
repo = "firehol";
|
|
|
|
rev = "v${version}";
|
2021-01-18 17:36:35 +00:00
|
|
|
sha256 = "sha256-gq7l7QoUsK+j5DUn84kD9hlUTC4hz3ds3gNJc1tRygs=";
|
2017-09-08 23:29:39 +01: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 12:44:58 +00:00
|
|
|
./firehol-ping6.patch
|
2018-02-18 14:58:13 +00:00
|
|
|
|
|
|
|
# put firehol config files in /etc/firehol (not $out/etc/firehol)
|
|
|
|
# to avoid error on startup, see #35114
|
2021-01-01 12:44:58 +00:00
|
|
|
./firehol-sysconfdir.patch
|
2018-02-18 15:12:06 +00:00
|
|
|
|
2021-01-01 12:44:58 +00: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-08 23:29:39 +01:00
|
|
|
];
|
2021-01-01 12:44:58 +00:00
|
|
|
|
2017-09-08 23:29:39 +01:00
|
|
|
nativeBuildInputs = [ autoconf automake ];
|
|
|
|
buildInputs = [
|
2020-04-28 11:33:27 +01:00
|
|
|
curl iprange iproute2 iptables iputils kmod
|
2020-11-24 15:29:28 +00:00
|
|
|
nettools procps tcpdump traceroute util-linux whois
|
2017-09-08 23:29:39 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = "./autogen.sh";
|
|
|
|
configureFlags = [ "--localstatedir=/var"
|
2020-04-28 11:33:27 +01:00
|
|
|
"--disable-doc" "--disable-man"
|
|
|
|
"--disable-update-ipsets" ] ++
|
2017-09-08 23:29:39 +01:00
|
|
|
lib.optional onlyQOS [ "--disable-firehol" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-09-08 23:29:39 +01: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 02:11:51 +01:00
|
|
|
homepage = "https://firehol.org/";
|
2017-09-08 23:29:39 +01:00
|
|
|
license = licenses.gpl2;
|
2020-08-15 14:25:59 +01:00
|
|
|
maintainers = with maintainers; [ oxzi ];
|
2017-09-08 23:29:39 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|