diff options
author | Alyssa Ross <hi@alyssa.is> | 2021-07-09 12:30:28 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2021-07-23 09:11:31 +0000 |
commit | 55cc63c079f49e81d695a25bc2f5b3902f2bd290 (patch) | |
tree | e705335d97f50b927c76ccb4a3fbde9fab8372b9 /nixpkgs/pkgs/servers/pufferpanel | |
parent | c26eb6f74d9393127a21eee7a9620a920769f613 (diff) | |
parent | 87807e64a5ef5206b745a40af118c7be8db73681 (diff) | |
download | nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.gz nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.bz2 nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.lz nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.xz nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.tar.zst nixlib-55cc63c079f49e81d695a25bc2f5b3902f2bd290.zip |
Merge commit '87807e64a5ef5206b745a40af118c7be8db73681'
Diffstat (limited to 'nixpkgs/pkgs/servers/pufferpanel')
-rw-r--r-- | nixpkgs/pkgs/servers/pufferpanel/default.nix | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/pufferpanel/default.nix b/nixpkgs/pkgs/servers/pufferpanel/default.nix new file mode 100644 index 000000000000..67529b7d5bb8 --- /dev/null +++ b/nixpkgs/pkgs/servers/pufferpanel/default.nix @@ -0,0 +1,59 @@ +{ lib +, buildGoModule +, fetchFromGitHub +, makeWrapper +, pkgs +, stdenv +, fetchzip +, openjdk16 +, nodejs +, pathDeps ? [ ] +}: + +buildGoModule rec { + pname = "pufferpanel"; + version = "2.2.0"; + + src = fetchFromGitHub { + owner = "pufferpanel"; + repo = pname; + rev = "v${version}"; + sha256 = "1ifig8ckjlg47wj0lfk4q941dan7llb1i5l76akcpjq726b2j8lh"; + }; + + # PufferPanel is split into two parts: the backend daemon and the + # frontend. + # Getting the frontend to build in the Nix environment fails even + # with all the proper node_modules populated. To work around this, + # we just download the built frontend and package that. + frontend = fetchzip { + url = "https://github.com/PufferPanel/PufferPanel/releases/download/v${version}/pufferpanel_${version}_linux_arm64.zip"; + sha256 = "0phbf4asr0dns7if84crx05kfgr44yaxrbsbihdywbhh2mb16052"; + stripRoot = false; + } + "/www"; + + nativeBuildInputs = [ makeWrapper ]; + + vendorSha256 = "061l1sy0z3kd7rc2blqh333gy66nbadfxy9hyxgq07dszds4byys"; + + postFixup = '' + mkdir -p $out/share/pufferpanel + cp -r ${src}/assets/email $out/share/pufferpanel/templates + cp -r ${frontend} $out/share/pufferpanel/www + + # Wrap the binary with the path to the external files. + mv $out/bin/cmd $out/bin/pufferpanel + wrapProgram "$out/bin/pufferpanel" \ + --set PUFFER_PANEL_EMAIL_TEMPLATES $out/share/pufferpanel/templates/emails.json \ + --set GIN_MODE release \ + --set PUFFER_PANEL_WEB_FILES $out/share/pufferpanel/www \ + --prefix PATH : ${lib.makeBinPath pathDeps} + ''; + + meta = with lib; { + description = "A free, open source game management panel"; + homepage = "https://www.pufferpanel.com/"; + license = with licenses; [ asl20 ]; + maintainers = with maintainers; [ ronthecookie ]; + }; +} |