commit 43d56d84623875dd7e5fa0c2e046334e5525ebb8
parent 5490cc3f6b568bbf0c96d76ac1fd25c52ca9c59a
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Sat, 3 Oct 2026 11:51:51 +0400
Add fhem
Diffstat:
1 file changed, 47 insertions(+), 0 deletions(-)
diff --git a/pkgs/by-name/fh/fhem/package.nix b/pkgs/by-name/fh/fhem/package.nix
@@ -0,0 +1,47 @@
+{
+ lib,
+ stdenv,
+ fetchurl,
+ perlPackages,
+ makeWrapper,
+}:
+
+perlPackages.buildPerlPackage rec {
+ pname = "fhem";
+ version = "6.4";
+
+ src = fetchurl {
+ url = "https://fhem.de/fhem-${version}.tar.gz";
+ hash = "sha256-AGL2GKV5ttv5s9wsJPsjV+iHYeyXtGABuERAwJwMsRc=";
+ };
+
+ postPatch = ''
+ touch Makefile.PL
+ substituteInPlace fhem.pl \
+ --replace-fail 'global modpath .' "global modpath $out/opt/fhem"
+ '';
+
+ nativeBuildInputs = [ makeWrapper ];
+
+ buildInputs = [ perlPackages.DeviceSerialPort ];
+
+ dontBuild = true;
+
+ installFlags = [ "BINDIR=$(out)/opt/fhem" ];
+
+ postInstall = ''
+ makeWrapper ${lib.getExe perlPackages.perl} $out/bin/fhem \
+ --prefix PERL5LIB : "$out/opt/fhem/FHEM:$PERL5LIB" \
+ --add-flags "$out/opt/fhem/fhem.pl"
+ '';
+
+ outputs = [ "out" ];
+
+ meta = {
+ homepage = "https://fhem.de";
+ description = "FHEM (TM) is a GPL'd perl server for house automation";
+ license = lib.licenses.gpl2;
+ maintainers = with lib.maintainers; [ sikmir ];
+ platforms = lib.platforms.unix;
+ };
+}