Skip to content

feat(packaging): update nix package to build from source instead - #1

Merged
hallwack merged 3 commits into
hallwack:packaging/nixfrom
justkrysteq:packaging/nix
Jun 14, 2026
Merged

hallwack merged 3 commits into
hallwack:packaging/nixfrom
justkrysteq:packaging/nix

Conversation

@justkrysteq

Copy link
Copy Markdown

Since AppImage files are meant to be used if traditional packaging from source is infeasible according to NixOS manual (https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-appimageTools) and it limits the package to x86_64-linux. I rewrote the package to build the app from source instead.

@hallwack

Copy link
Copy Markdown
Owner

Thank you for your PR. This is my first time working on Nix packaging, so I appreciate the help and feedback. And I tested the source-built package and the desktop application works properly.

One thing I noticed is that I couldn't find the bundled zen CLI in the package output. The package seems to only installs zennotes-desktop.

Have you tested the CLI installation flow from Settings -> CLI -> Install? On my side, when testing the AppImage-based package, I had to do some additional work to make the bundled CLI function correctly on NixOS.

The upstream project ships both the desktop application and the zen CLI, so I'm curious whether CLI support is expected to be installed through the GUI, or if the package should expose the zen executable directly.

@justkrysteq

Copy link
Copy Markdown
Author

The CLI wasn't meant to be bundled in this package as it is only for the desktop client. I don't think we'd want to bundle the CLI since (at least for me) it was not installed by default. The CLI after installation from Settings -> CLI -> Install works when launched from /home/user/.local/bin/zen so it's a matter of making it available in the path.

But from what I've seen the CLI is usually bundled as a separate package. For example in Joplin (which is a similar app) there are two separate packages for desktop and CLI. I propose we solve it the same way.

Also it makes it better if we make a Nix module, which could look like this for example:

programs.zennotes = {
  desktop.enable = true; # Enable desktop client
  cli.enable = true; # Enable CLI
};

Which could be extended to:

programs.zennotes = {
  desktop = {
    enable = true;
    package = pkgs.zennotes-desktop; # Specify the package
  };
  cli = {
    enable = true;
    package = pkgs.zennotes-cli;
  };
  web = {
    # ...
  };
  server = {
    # ...
  };
};

@hallwack

Copy link
Copy Markdown
Owner

Thank you for your explanation and for taking the time to improve the package.

This is my first contribution related to Nix packaging, so I'm still learning the conventions and best practices around packaging Nix and nixpkgs.

Your explanation about separating desktop and CLI packages, as well as the comparison with Joplin makes a lot of sense. I also like the idea of a future NixOS module that can manage the different ZenNotes components in a more declarative way.

I'll go ahead and approve and merge your changes into my branch so the upstream PR can benefit from your implementation.

@hallwack
hallwack merged commit 2e3ded5 into hallwack:packaging/nix Jun 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants