From 1931c374de0d1f28b3ce905c61d8dff8194a6e56 Mon Sep 17 00:00:00 2001 From: Nico Pulido-Mateo <13149442+npulidomateo@users.noreply.github.com> Date: Tue, 3 Oct 2023 00:05:39 +0200 Subject: [PATCH 1/3] maintainers: add npulidomateo --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index c5471a8cdeba..e36bc9452af6 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -12801,6 +12801,12 @@ githubId = 9939720; name = "Philippe Nguyen"; }; + npulidomateo = { + matrix = "@npulidomateo:matrix.org"; + github = "npulidomateo"; + githubId = 13149442; + name = "Nico Pulido-Mateo"; + }; nrdxp = { email = "tim.deh@pm.me"; matrix = "@timdeh:matrix.org"; From 0bd4608448a44823c188dd62e2c3315a0584223a Mon Sep 17 00:00:00 2001 From: Nico Pulido-Mateo <13149442+npulidomateo@users.noreply.github.com> Date: Sun, 1 Oct 2023 23:30:11 +0200 Subject: [PATCH 2/3] typora: reinit at 1.7.5 typora was removed in bd763298edeb1a7db10e39b1eac205b38a91f9de because it failed to run. Running it inside an FHS environment solves the issue. --- pkgs/applications/editors/typora/default.nix | 104 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 106 insertions(+) create mode 100644 pkgs/applications/editors/typora/default.nix diff --git a/pkgs/applications/editors/typora/default.nix b/pkgs/applications/editors/typora/default.nix new file mode 100644 index 000000000000..d76dbbffdcb7 --- /dev/null +++ b/pkgs/applications/editors/typora/default.nix @@ -0,0 +1,104 @@ +{ stdenv +, fetchurl +, dpkg +, lib +, glib +, nss +, nspr +, at-spi2-atk +, cups +, dbus +, libdrm +, gtk3 +, pango +, cairo +, xorg +, libxkbcommon +, mesa +, expat +, alsa-lib +, buildFHSEnv +}: + +let + pname = "typora"; + version = "1.7.5"; + src = fetchurl { + url = "https://download.typora.io/linux/typora_${version}_amd64.deb"; + hash = "sha256-4Q+fx1kNu98+nxnI/7hLhE6zOdNsaAiAnW6xVd+hZOI="; + }; + + typoraBase = stdenv.mkDerivation { + inherit pname version src; + + nativeBuildInputs = [ dpkg ]; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin $out/share + mv usr/share $out + ln -s $out/share/typora/Typora $out/bin/Typora + runHook postInstall + ''; + }; + + typoraFHS = buildFHSEnv { + name = "typora-fhs"; + targetPkgs = pkgs: (with pkgs; [ + typoraBase + udev + alsa-lib + glib + nss + nspr + atk + cups + dbus + gtk3 + libdrm + pango + cairo + mesa + expat + libxkbcommon + ]) ++ (with pkgs.xorg; [ + libX11 + libXcursor + libXrandr + libXcomposite + libXdamage + libXext + libXfixes + libxcb + ]); + runScript = '' + Typora $* + ''; + }; + +in stdenv.mkDerivation { + inherit pname version; + + dontUnpack = true; + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + mkdir -p $out/bin + ln -s ${typoraFHS}/bin/typora-fhs $out/bin/typora + ln -s ${typoraBase}/share/ $out + runHook postInstall + ''; + + meta = with lib; { + description = "A markdown editor, a markdown reader"; + homepage = "https://typora.io/"; + license = licenses.unfree; + maintainers = with maintainers; [ jensbin npulidomateo ]; + platforms = [ "x86_64-linux" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 64a2efb5c69f..583d1289f04b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -34434,6 +34434,8 @@ with pkgs; synfigstudio = callPackage ../applications/graphics/synfigstudio { }; + typora = callPackage ../applications/editors/typora { }; + taxi = callPackage ../applications/networking/ftp/taxi { }; taxi-cli = with python3Packages; toPythonApplication taxi; From 9b4f78b7bad2af6337c13ff8b84119cfa39dad06 Mon Sep 17 00:00:00 2001 From: Nico Pulido-Mateo <13149442+npulidomateo@users.noreply.github.com> Date: Fri, 13 Oct 2023 14:34:04 +0200 Subject: [PATCH 3/3] typora: remove maintainer jensbin --- pkgs/applications/editors/typora/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/editors/typora/default.nix b/pkgs/applications/editors/typora/default.nix index d76dbbffdcb7..5332e0b5d05b 100644 --- a/pkgs/applications/editors/typora/default.nix +++ b/pkgs/applications/editors/typora/default.nix @@ -98,7 +98,7 @@ in stdenv.mkDerivation { description = "A markdown editor, a markdown reader"; homepage = "https://typora.io/"; license = licenses.unfree; - maintainers = with maintainers; [ jensbin npulidomateo ]; + maintainers = with maintainers; [ npulidomateo ]; platforms = [ "x86_64-linux" ]; }; }