Nix flake for Logseq nightly packages.
It packages the Logseq Desktop nightly artifacts built by this repository's workflow and builds the Logseq CLI from upstream's OCaml/Melange source. The current manifest is data/logseq-nightly.json.
Supported systems:
x86_64-linuxaarch64-linuxaarch64-darwin
| Output | Binary | Notes |
|---|---|---|
logseq |
logseq |
Desktop app |
logseq-cli |
logseq-cli |
CLI for Logseq DB graphs |
default |
both | Symlink join of desktop and CLI packages |
| overlay | n/a | Exposes the same packages under pkgs.logseq-nightly |
The flake also exports homeManagerModules.default, which installs a
generated theme plugin (see Theme Plugin).
nix run --accept-flake-config github:Bad3r/nix-logseq-git-flake#logseq
nix run --accept-flake-config github:Bad3r/nix-logseq-git-flake#logseq-cli -- --helpThe flake advertises its Cachix cache through nixConfig, so
--accept-flake-config enables:
extra-substituters = [ "https://nix-logseq-git-flake.cachix.org" ];
extra-trusted-public-keys = [
"nix-logseq-git-flake.cachix.org-1:DSBNW07PSRyCvS926tpIWahb53OIydwwZhsP6LhJNZo="
];Add the input:
{
inputs.logseq-nightly = {
url = "github:Bad3r/nix-logseq-git-flake";
inputs.nixpkgs.follows = "nixpkgs";
};
}Use the packages directly from a module where inputs and pkgs are in scope:
environment.systemPackages = [
inputs.logseq-nightly.packages.${pkgs.stdenv.hostPlatform.system}.logseq
inputs.logseq-nightly.packages.${pkgs.stdenv.hostPlatform.system}.logseq-cli
];Or use the overlay:
nixpkgs.overlays = [ inputs.logseq-nightly.overlays.default ];
environment.systemPackages = [
pkgs.logseq-nightly.logseq
pkgs.logseq-nightly.logseq-cli
];homeManagerModules.default adds programs.logseq.themePlugin, which renders
a dark theme from a semantic palette into a theme-only plugin under
~/.logseq/plugins/<name>/. Unset colours keep a VS Code Dark palette, and
the accent tones derive from accent; the twelve neutral keys (background
through text) form one ordered scale, so replace them together. The options
in modules/_home-manager/theme-plugin.nix list every key, and extraCss
appends custom rules.
The layout follows VS Code: the top bar, both sidebars, and dialogs sit on
sidebar around background content with border edges, menus on popup,
and list hover and selection are translucent bright overlays.
{ inputs, ... }:
{
imports = [ inputs.logseq-nightly.homeManagerModules.default ];
programs.logseq.themePlugin = {
enable = true;
name = "my-theme";
colors.accent = "#4fc1ff";
};
}After activation, restart Logseq, switch to dark mode, and pick the theme once
in the theme picker (t i); changing name requires picking it again. The
checks.<system>.logseq-theme-plugin check fails when a nightly stops using a
variable or selector the theme relies on.
Upstream's CLI self-identifies as logseq; this flake installs the wrapper as
logseq-cli so it can coexist with the desktop launcher.
logseq-cli --help
logseq-cli doctor
logseq-cli example <command>doctor is a smoke check for the OCaml/Melange CLI runtime and the bundled
shadow-cljs db-worker-node.js. The db-worker requires keytar, whose native binding is
built from source with node-gyp (and libsecret on Linux); the
logseq-cli-help check boots the worker so a missing binding fails the build.
Current command groups include:
- Graph inspect and edit:
list,show,search,query,upsert,remove. - Graph management:
graph,graph backup,server,doctor. - Sync and auth:
sync,login,logout. - Utilities:
agent,completion,debug,example,skill.
Global options include -g/--graph, -o/--output, --root-dir, --config,
--timeout-ms, --profile, -v/--verbose, and --version.
data/logseq-nightly.json is generated data and is the source of truth for:
- per-system desktop artifact URLs and SRI hashes
- upstream Logseq revision and version
- CLI source, root pnpm,
cli/bundle pnpm, and Clojure dependency hashes
scripts/update-nightly.sh rewrites the manifest during the nightly release
flow. Manifest schema changes must update both that producer and
lib/loadManifest.nix.
Useful local checks:
nix build .#logseq
nix build .#logseq-cli
nix build .#checks.x86_64-linux.logseq-runtime-assets
nix build .#checks.x86_64-linux.logseq-cli-help
nix flake check --accept-flake-config --no-build --offline
nix fmtNote: logseq-cli takes its OCaml/Melange closure from the materialized
opam-nix solve in modules/_packages/logseq-cli/opam-defs.json, so
evaluating it needs no import-from-derivation (IFD).
scripts/update-nightly.sh regenerates it from
.#logseq-cli.opamDefs and stamps cliOpamDefsRev; evaluation fails when the
stamp differs from logseqRev. opam-deps.nix derives the closure from
cli/logseq-cli.opam and checks that the ocaml, dune, and melange
toolchain entries are present before the build proceeds.
The Darwin desktop package is validated by the validate-aarch64-darwin
workflow job, which builds the package on macOS, verifies the app signature, and
runs a bounded launch probe.