diff --git a/README.md b/README.md index 2855a49..2508c95 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ imnyang's custom nixpkgs overlay. ## Included Packages - `helium`: Helium AppImage wrapper +- `figma-linux`: Figma Desktop for Linux - `helium-sync`: Helium Sync utility - `waterfox-bin`: Waterfox Browser - `xcursor-mizuki`: Custom cursor diff --git a/flake.nix b/flake.nix index e3665bf..33506aa 100644 --- a/flake.nix +++ b/flake.nix @@ -18,6 +18,7 @@ xcursor-mizuki = final.callPackage ./pkgs/xcursor-mizuki/default.nix { }; pjsk-cursor = final.callPackage ./pkgs/pjsk-cursor/default.nix { }; helium = final.callPackage ./pkgs/helium/default.nix { }; + figma-linux = final.callPackage ./pkgs/figma-linux/default.nix { }; }; forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f ( @@ -37,7 +38,8 @@ waterfox-bin xcursor-mizuki pjsk-cursor - helium; + helium + figma-linux; }; in nixpkgs.lib.filterAttrs (name: pkg: diff --git a/pkgs/figma-linux/default.nix b/pkgs/figma-linux/default.nix new file mode 100644 index 0000000..d0b1a17 --- /dev/null +++ b/pkgs/figma-linux/default.nix @@ -0,0 +1,45 @@ +{ + appimageTools, + fetchurl, + lib, +}: + +let + pname = "figma-linux"; + version = "126.5.6"; + + src = fetchurl { + url = "https://github.com/IliyaBrook/figma-linux/releases/download/${version}/figma-desktop-${version}-amd64.AppImage"; + hash = "sha256-SLn4y+NVCcBDZrGqIpmpIEQavY7xngt5JMI8yG1g6/0="; + }; + + appimageContents = appimageTools.extract { inherit pname version src; }; +in +appimageTools.wrapType2 { + inherit pname version src; + + extraInstallCommands = '' + install -Dm444 ${appimageContents}/usr/share/applications/io.github.nickvdp.figma-desktop-linux.desktop \ + -t $out/share/applications + substituteInPlace $out/share/applications/io.github.nickvdp.figma-desktop-linux.desktop \ + --replace-fail 'Exec=AppRun' 'Exec=${pname}' + + install -Dm444 ${appimageContents}/io.github.nickvdp.figma-desktop-linux.png \ + $out/share/icons/hicolor/256x256/apps/io.github.nickvdp.figma-desktop-linux.png + ''; + + extraPkgs = pkgs: with pkgs; [ + libappindicator-gtk3 + libnotify + libsecret + ]; + + meta = { + description = "Figma Desktop for Linux"; + homepage = "https://github.com/IliyaBrook/figma-linux"; + license = lib.licenses.unfree; + mainProgram = "figma-linux"; + platforms = [ "x86_64-linux" ]; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + }; +}