nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 makeWrapper,
6 perl,
7 iptables,
8 nixosTests,
9}:
10
11let
12 inherit (lib.versions) majorMinor;
13in
14stdenv.mkDerivation (finalAttrs: {
15 version = "2.7";
16 pname = "ferm";
17
18 src = fetchurl {
19 url = "http://ferm.foo-projects.org/download/${majorMinor finalAttrs.version}/ferm-${finalAttrs.version}.tar.xz";
20 sha256 = "sha256-wA2RDVOU5pZ1YI617g9QTVz9pB6ZCi2akbqsbfk+P5I=";
21 };
22
23 patches = [
24 ./import-ferm-wrapped.patch
25 ];
26
27 # perl is used at build time to gather the ferm version.
28 nativeBuildInputs = [
29 makeWrapper
30 perl
31 ];
32 buildInputs = [ perl ];
33
34 makeFlags = [
35 "PERL=perl"
36 "PREFIX=${placeholder "out"}"
37 ];
38
39 postInstall = ''
40 rm -r $out/lib/systemd
41 for i in "$out/sbin/"*; do
42 wrapProgram "$i" --prefix PATH : "${lib.makeBinPath [ iptables ]}"
43 done
44 '';
45
46 passthru.tests.ferm = nixosTests.ferm;
47
48 meta = {
49 homepage = "http://ferm.foo-projects.org/";
50 description = "Tool to maintain complex firewalls";
51 longDescription = ''
52 ferm is a tool to maintain complex firewalls, without having the trouble to
53 rewrite the complex rules over and over again. ferm allows the entire
54 firewall rule set to be stored in a separate file, and to be loaded with one
55 command. The firewall configuration resembles structured programming-like
56 language, which can contain levels and lists.
57 '';
58 license = lib.licenses.gpl2Plus;
59 maintainers = with lib.maintainers; [ mic92 ];
60 platforms = lib.platforms.linux;
61 };
62})