nixpkgs/pkgs/by-name/fe/ferm/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

51 lines
1.4 KiB
Nix

{ lib, stdenv, fetchurl, makeWrapper, perl, iptables, nixosTests }:
let
inherit (lib.versions) majorMinor;
in stdenv.mkDerivation rec {
version = "2.7";
pname = "ferm";
src = fetchurl {
url = "http://ferm.foo-projects.org/download/${majorMinor version}/ferm-${version}.tar.xz";
sha256 = "sha256-wA2RDVOU5pZ1YI617g9QTVz9pB6ZCi2akbqsbfk+P5I=";
};
patches = [
./import-ferm-wrapped.patch
];
# 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
wrapProgram "$i" --prefix PATH : "${lib.makeBinPath [ iptables ]}"
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.
'';
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [mic92];
platforms = lib.platforms.linux;
};
}