Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trilium-next: init at 0.90.4 #348144

Closed
wants to merge 2 commits into from

Conversation

eliandoran
Copy link
Contributor

@eliandoran eliandoran commented Oct 12, 2024

This PR adds TriliumNext Notes which is a fork of Trilium Notes, which has entered maintenance mode.

Basically I've taken the original package description for Trilium and adapted it for the fork. I've also changed the server module to take in a package attribute.

Note: I am also the upstream maintainer of TriliumNext Notes.

Closes #339237

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@eliandoran eliandoran marked this pull request as draft October 12, 2024 20:26
@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Oct 12, 2024
@@ -117,7 +119,7 @@ in
wantedBy = [ "multi-user.target" ];
environment.TRILIUM_DATA_DIR = cfg.dataDir;
serviceConfig = {
ExecStart = "${pkgs.trilium-server}/bin/trilium-server";
ExecStart = "${cfg.package}/bin/trilium-server";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ExecStart = "${cfg.package}/bin/trilium-server";
ExecStart = lib.getExe cfg.package;

Comment on lines +1 to +25
{ lib, callPackage, ... }:

let
metaCommon = with lib; {
description = "Hierarchical note taking application with focus on building large personal knowledge bases";
homepage = "https://github.com/TriliumNext/Notes";
license = licenses.agpl3Plus;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ eliandoran ];
};
version = "0.90.4";
in
{

trilium-next-desktop = callPackage ./desktop.nix {
metaCommon = metaCommon;
version = version;
};
trilium-next-server = callPackage ./server.nix {
metaCommon = metaCommon;
version = version;
};

}
Copy link
Member

@SuperSandro2000 SuperSandro2000 Oct 21, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{ lib, callPackage, ... }:
let
metaCommon = with lib; {
description = "Hierarchical note taking application with focus on building large personal knowledge bases";
homepage = "https://github.com/TriliumNext/Notes";
license = licenses.agpl3Plus;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ eliandoran ];
};
version = "0.90.4";
in
{
trilium-next-desktop = callPackage ./desktop.nix {
metaCommon = metaCommon;
version = version;
};
trilium-next-server = callPackage ./server.nix {
metaCommon = metaCommon;
version = version;
};
}
{ lib, callPackage }:
let
metaCommon = with lib; {
description = "Hierarchical note taking application with focus on building large personal knowledge bases";
homepage = "https://github.com/TriliumNext/Notes";
license = licenses.agpl3Plus;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ eliandoran ];
};
version = "0.90.4";
in
{
trilium-next-desktop = callPackage ./desktop.nix {
inherit metaCommon version;
};
trilium-next-server = callPackage ./server.nix {
inherit metaCommon version;
};
}


src = fetchurl linuxSource;

# TODO: migrate off autoPatchelfHook and use nixpkgs' electron
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, what's blocking that?

'';

postFixup = ''
cat > $out/bin/trilium-server <<EOF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use makeWrapper

@FliegendeWurst FliegendeWurst added the 11.by: upstream-developer This issue or PR was created by the developer of packaged software label Oct 31, 2024
};

in
if stdenv.isDarwin then darwin else linux
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if stdenv.isDarwin then darwin else linux
if stdenv.hostPlatform.isDarwin then darwin else linux

Comment on lines +13069 to +13072
inherit (callPackage ../applications/office/trilium-next {})
trilium-next-desktop
trilium-next-server
;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be in pkgs/by-name

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 10, 2024
@fabian-mv
Copy link

fabian-mv commented Nov 17, 2024

sadly this wont be coming out in 24.11, since branch out was 4 days ago. this is very bad, as trilium next is now more important as sync became incompatible with the old version.

this means that trilium next won't be in nixpkgs until mid-2025 (since releases are very 6months). pretty sad if you ask me

@eliandoran i can help if you need

@FliegendeWurst
Copy link
Member

New packages can always be backported. No problem there.

@FliegendeWurst
Copy link
Member

I tried to package using nixpkgs' electron instead: https://github.com/FliegendeWurst/nixpkgs/blob/trilium-next/pkgs/applications/office/trilium-next/desktop.nix

... but for some reason, locale data is missing:

Screenshot_20241118_092017

@eliandoran do you know how this could be fixed? Do I need to add some more flags to my electron invocation?

@FliegendeWurst
Copy link
Member

I fixed the above issue and created #356930

@eliandoran
Copy link
Contributor Author

Closing in favor of #356930.

@eliandoran eliandoran closed this Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes 11.by: upstream-developer This issue or PR was created by the developer of packaged software
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: TriliumNext-server and TriliumNext-desktop
5 participants