From 11f7b66fdf3a094bc5499f10e1bf34717e4382b3 Mon Sep 17 00:00:00 2001 From: Niels Egberts Date: Sun, 28 May 2023 22:04:34 +0100 Subject: [PATCH] filebrowser: init at 2.23.0 --- .../networking/filebrowser/default.nix | 60 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/applications/networking/filebrowser/default.nix diff --git a/pkgs/applications/networking/filebrowser/default.nix b/pkgs/applications/networking/filebrowser/default.nix new file mode 100644 index 000000000000..265e8236be69 --- /dev/null +++ b/pkgs/applications/networking/filebrowser/default.nix @@ -0,0 +1,60 @@ +{ buildGoModule, buildNpmPackage, fetchFromGitHub, lib }: + +let + frontend = buildNpmPackage rec { + pname = "filebrowser-frontend"; + version = "2.23.0"; + + src = fetchFromGitHub { + owner = "filebrowser"; + repo = "filebrowser"; + rev = "v${version}"; + hash = "sha256-xhBIJcEtxDdMXSgQtLAV0UWzPtrvKEil0WV76K5ycBc="; + }; + + sourceRoot = "source/frontend"; + + npmDepsHash = "sha256-acNIMKHc4q7eiFLPBtKZBNweEsrt+//0VR6dqwXHTvA="; + + NODE_OPTIONS = "--openssl-legacy-provider"; + + installPhase = '' + runHook preInstall + + mkdir $out + mv dist $out + + runHook postInstall + ''; + }; +in +buildGoModule rec { + pname = "filebrowser"; + version = "2.23.0"; + + src = fetchFromGitHub { + owner = "filebrowser"; + repo = "filebrowser"; + rev = "v${version}"; + hash = "sha256-xhBIJcEtxDdMXSgQtLAV0UWzPtrvKEil0WV76K5ycBc="; + }; + + vendorHash = "sha256-MR0ju2Nomb3j78Z+1YcJY+jPd40MZpuOTuQJM94AM8A="; + + excludedPackages = [ "tools" ]; + + preBuild = '' + cp -r ${frontend}/dist frontend/ + ''; + + passthru = { + inherit frontend; + }; + + meta = with lib; { + description = "Filebrowser is a web application for managing files and directories"; + homepage = "https://filebrowser.org"; + license = licenses.asl20; + maintainers = with maintainers; [ nielsegberts ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 51898095899d..4186a156a9ea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -31728,6 +31728,8 @@ with pkgs; irssi = callPackage ../applications/networking/irc/irssi { }; + filebrowser = callPackage ../applications/networking/filebrowser { }; + fish-irssi = callPackage ../applications/networking/irc/irssi/fish { }; kirc = callPackage ../applications/networking/irc/kirc { };