Skip to content

Instantly share code, notes, and snippets.

@kugurerdem
Last active October 22, 2024 11:02
Show Gist options
  • Save kugurerdem/e218c201397aa2324f18fb45ddb943b3 to your computer and use it in GitHub Desktop.
Save kugurerdem/e218c201397aa2324f18fb45ddb943b3 to your computer and use it in GitHub Desktop.
shell.nix file for logseq desktop dev environment

I was having problems running the LogSeq Desktop development environment from source code in NixOS.

This is because you cannot run dynamically linked executables intended for Linux environments out of the box.

And the dev tools that LogSeq use assumes an FHS environment.

I bet there is a more elegant way to solve this problem but this is my quick workaround to overcome the issue.

# shell.nix file
{ pkgs ? import <nixpkgs> {} }:

let
    electronDependencies = with pkgs; [
        # electron_27 dependencies
        alsa-lib
        at-spi2-atk
        cairo
        cups
        dbus
        expat
        gdk-pixbuf
        glib
        gtk3
        nss
        nspr
        xorg.libX11
        xorg.libxcb
        xorg.libXcomposite
        xorg.libXdamage
        xorg.libXext
        xorg.libXfixes
        xorg.libXrandr
        xorg.libxkbfile
        pango
        pciutils
        stdenv.cc.cc.lib
        systemd

        unzip
        makeWrapper
        wrapGAppsHook3

        libdrm
        libGL

        libdrm mesa
        libGL vulkan-loader
        libxkbcommon
    ];

    fhsEnv = pkgs.buildFHSEnv {
      name = "logseq-dev";

      targetPkgs = pkgs: (with pkgs; [
        yarn
        nodejs
        clojure
        babashka
        nodejs_18
      ] ++ electronDependencies);

      runScript = "bash -c ${pkgs.zellij}/bin/zellij";
    };
in
    fhsEnv.env
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment