From c239be04a83036725109795a117d3e637caa3805 Mon Sep 17 00:00:00 2001 From: riChar Date: Mon, 11 Mar 2024 16:17:41 +0800 Subject: [PATCH] affine: init at 0.13.1 --- maintainers/maintainer-list.nix | 5 +++ pkgs/by-name/af/affine/package.nix | 68 ++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 pkgs/by-name/af/affine/package.nix diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 319fec440c19..db020bfb44c1 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -16396,6 +16396,11 @@ githubId = 61013287; name = "Ricardo Steijn"; }; + richar = { + github = "ri-char"; + githubId = 17962023; + name = "richar"; + }; richardipsum = { email = "richardipsum@fastmail.co.uk"; github = "richardipsum"; diff --git a/pkgs/by-name/af/affine/package.nix b/pkgs/by-name/af/affine/package.nix new file mode 100644 index 000000000000..5b8b3e41e872 --- /dev/null +++ b/pkgs/by-name/af/affine/package.nix @@ -0,0 +1,68 @@ +{ lib +, writeText +, fetchurl +, stdenvNoCC +, copyDesktopItems +, makeDesktopItem +, makeWrapper +, unzip +, bash +, electron +, commandLineArgs ? "" +}: + +stdenvNoCC.mkDerivation (finalAttrs: let + icon = fetchurl { + url = "https://raw.githubusercontent.com/toeverything/AFFiNE/v${finalAttrs.version}/packages/frontend/core/public/favicon-192.png"; + hash = "sha256-smZ5W7fy3TK3bvjwV4i71j2lVmKSZcyhMhcWfPxNnN4="; + }; +in { + pname = "affine"; + version = "0.13.1"; + src = fetchurl { + url = "https://github.com/toeverything/AFFiNE/releases/download/v${finalAttrs.version}/affine-${finalAttrs.version}-stable-linux-x64.zip"; + hash = "sha256-2Du5g/I82iTr8Bwb+qkLzyfbk1OrOlXqx6FHImVoAoE="; + }; + nativeBuildInputs = [ + copyDesktopItems + makeWrapper + unzip + ]; + postInstall = '' + mkdir -p $out/lib + cp -r ./resources/* -t $out/lib/ + cp LICENSE* $out/ + install -Dm644 ${icon} $out/share/pixmaps/affine.png + makeWrapper "${electron}/bin/electron" $out/bin/affine \ + --inherit-argv0 \ + --add-flags $out/lib/app.asar \ + --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ + --add-flags ${lib.escapeShellArg commandLineArgs} + ''; + desktopItems = [ + (makeDesktopItem { + name = "affine"; + desktopName = "AFFiNE"; + exec = "affine %U"; + terminal = false; + icon = "affine"; + startupWMClass = "affine"; + categories = ["Utility"]; + }) + ]; + meta = with lib; { + description = "A workspace with fully merged docs, whiteboards and databases"; + longDescription = '' + AFFiNE is an open-source, all-in-one workspace and an operating + system for all the building blocks that assemble your knowledge + base and much more -- wiki, knowledge management, presentation + and digital assets + ''; + homepage = "https://affine.pro/"; + downloadPage = "https://affine.pro/download"; + license = licenses.mit; + maintainers = with maintainers; [richar]; + mainProgram = "affine"; + platforms = ["x86_64-linux"]; + }; +})