Files
nixpkgs/pkgs/by-name/if/ifm-web/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

56 lines
1.3 KiB
Nix

{
fetchurl,
stdenv,
lib,
php83,
writeShellScript,
nixosTests,
}:
let
version = "4.0.2";
src = fetchurl {
url = "https://github.com/misterunknown/ifm/releases/download/v${version}/cdn.ifm.php";
hash = "sha256-37WbRM6D7JGmd//06zMhxMGIh8ioY8vRUmxX4OHgqBE=";
};
serve_script = writeShellScript "ifm-serve" ''
if [ $# -ne 3 ]; then
echo "Usage: $0 <listen address> <port> <data directory>";
exit 1;
fi
SERVE_DIR=$(dirname "$0")/../php/
IFM_ROOT_DIR="$3" ${lib.getExe php83} -S "$1:$2" -t "$SERVE_DIR"
'';
in
stdenv.mkDerivation {
pname = "ifm";
inherit version src;
dontUnpack = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/php
cp $src $out/php/index.php
cp ${serve_script} $out/bin/ifm
runHook postInstall
'';
passthru.tests = {
inherit (nixosTests) ifm;
};
meta = {
description = "Improved File Manager, a single-file web-based filemanager";
longDescription = ''
The IFM is a web-based filemanager, which comes as a single file solution using HTML5, CSS3, JavaScript and PHP.
'';
homepage = "https://github.com/misterunknown/ifm";
changelog = "https://github.com/misterunknown/ifm/releases/tag/v${version}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ litchipi ];
mainProgram = "ifm";
};
}