Skip to content

euro-office-documentserver: init at 9.3.1#504934

Open
onny wants to merge 3 commits into
NixOS:masterfrom
onny:eu-office-init
Open

euro-office-documentserver: init at 9.3.1#504934
onny wants to merge 3 commits into
NixOS:masterfrom
onny:eu-office-init

Conversation

@onny

@onny onny commented Mar 30, 2026

Copy link
Copy Markdown
Contributor

packaging euro-office-documentserver, a hard-fork of onlyoffice-documentserver and „an online office suite comprising viewers and editors“

run tests with:

nix build -L .#euro-office-documentserver.passthru.tests.onlyoffice

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (new) This PR adds a new package 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS labels Mar 30, 2026
@onny onny marked this pull request as ready for review March 30, 2026 09:31
@nixpkgs-ci nixpkgs-ci Bot requested a review from raboof March 30, 2026 09:36
@nixpkgs-ci nixpkgs-ci Bot added 8.has: module (update) This PR changes an existing module in `nixos/` and removed 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Mar 30, 2026
Comment thread pkgs/by-name/eu/euro-office-documentserver/package.nix Outdated
@onny onny force-pushed the eu-office-init branch 2 times, most recently from 3749928 to c91e0d1 Compare March 31, 2026 08:33
@onny onny requested a review from SuperSandro2000 March 31, 2026 08:40
@onny

onny commented Mar 31, 2026

Copy link
Copy Markdown
Contributor Author

thank you @SuperSandro2000

@onny onny force-pushed the eu-office-init branch 2 times, most recently from 9d32cdd to bea3690 Compare March 31, 2026 09:27
# needs to be ran wrapped in FHS for now
# because the default config refers to many FHS paths
ExecStart = "${cfg.package.fhs}/bin/onlyoffice-wrapper ${cfg.package.fileconverter}/bin/fileconverter";
ExecStart = "${lib.getExe cfg.package.fhs} ${cfg.package.fileconverter}/bin/fileconverter";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
ExecStart = "${lib.getExe cfg.package.fhs} ${cfg.package.fileconverter}/bin/fileconverter";
ExecStart = "${lib.getExe cfg.package.fhs} ${lib.getExe cfg.package.fileconverter}";

};
serviceConfig = {
ExecStart = "${cfg.package.fhs}/bin/onlyoffice-wrapper ${cfg.package.docservice}/bin/docservice";
ExecStart = "${lib.getExe cfg.package.fhs} ${cfg.package.docservice}/bin/docservice";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
ExecStart = "${lib.getExe cfg.package.fhs} ${cfg.package.docservice}/bin/docservice";
ExecStart = "${lib.getExe cfg.package.fhs} ${lib.getExe cfg.package.docservice}";

--use-system=true

mkdir -p $out/bin
cp ${x2t}/bin/x2t $out/bin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
cp ${x2t}/bin/x2t $out/bin
ln -s ${lib.getExe x2t} $out/bin

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

(see other comment - this would make sense but I've had to convert several ln -s to cp because the codebase uses calls that don't follow symlinks, so not obvious if this is possible here)


mkdir -p $out/bin
cp ${x2t}/bin/x2t $out/bin
cat >$out/bin/DoctRenderer.config <<EOF

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why is a config file in $out/bin?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Because x2t hard-codes looking for it there. Earlier I carried a patch in the onlyoffice-documentserver package to load it from ../etc instead, but that was a pain to maintain so I gave in and dropped that.

Euro-office promises to be more open to contributions, so maybe we can fix it upstream this time - but not sure if it should be a priority.

echo Generating presentation themes
# creates temporary files next to sources...
mkdir working
cp ${x2t.components.sdkjs}/slide/themes/src/* working

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
cp ${x2t.components.sdkjs}/slide/themes/src/* working
ln -s ${x2t.components.sdkjs}/slide/themes/src/* working

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

this is worth testing, but generally a lot of the codebase is using calls that don't follow symlinks, so I had to convert a bunch of things that I initially used symlinks for to use cp.

# equivalent of usr/bin/documentserver-flush-cache.sh,
# busts cache also when fonts collection changes
mkdir $out/var/www/onlyoffice/documentserver/web-apps
${lndir}/bin/lndir -silent ${x2t.components.web-apps} $out/var/www/onlyoffice/documentserver/web-apps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
${lndir}/bin/lndir -silent ${x2t.components.web-apps} $out/var/www/onlyoffice/documentserver/web-apps
${lib.getExe lndir} -silent ${x2t.components.web-apps} $out/var/www/onlyoffice/documentserver/web-apps

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this really a pattern we want to push even in 'simple' cases like this? do we have that written down in a style guide somewhere yet?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this really a pattern we want to push even in 'simple' cases like this?

Yes, it is IMHO. If someone creates an overlay that overrides lndir such that the main program is no longer called lndir, we still want it to work correctly as long as the mainProgram is set correctly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

With lib.getExe we get a single source of truth for the relevant executable in a package. Yes, we want that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't that conflict with the advice to move from runCommand to mkDerivation and put the dependencies in nativeBuildInputs? Since people do that we can't expect overlays that change the main program to work anyway, right?

https://nixos.org/manual/nixpkgs/unstable/ also still uses the {pkg}/bin/pkg pattern in a bunch of places and doesn't document a clear preference.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doesn't that conflict with the advice to move from runCommand to mkDerivation and put the dependencies in nativeBuildInputs? Since people do that we can't expect overlays that change the main program to work anyway, right?

That's a fair point I hadn't thought about. I'll have to think on that.

https://nixos.org/manual/nixpkgs/unstable/ also still uses the {pkg}/bin/pkg pattern in a bunch of places and doesn't document a clear preference.

Instances of that pattern should 100% be replaced with lib.getExe or lib.getExe'.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems that a .exe attribute would pay off in terms of UX, without performance cost:

The increase in allocation is offset by better collectability. Eval times appear shorter.

I think it'd be nice. Wdyt?

];

extraBuildCommands = ''
mkdir -p $out/var/{lib/onlyoffice,www}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lib/onlyoffice seems unused

Comment thread pkgs/by-name/eu/euro-office-documentserver/package.nix Outdated
Comment thread pkgs/by-name/eu/euro-office-documentserver/package.nix Outdated
Comment thread pkgs/by-name/eu/euro-office-documentserver/package.nix Outdated
@raboof

raboof commented Apr 3, 2026

Copy link
Copy Markdown
Member

For background: euro-office is a fork of onlyoffice, so a lot of the comments here are actually comments on the onlyoffice package (too). As onlyoffice-documentserver maintainer, I'm already in contact with onny to see if/how we can co-maintain to keep things reasonably in sync, stay tuned.

@Pandapip1 Pandapip1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Mostly nitpicks

Comment on lines +82 to +85
mkdir -p $out/web
mkdir -p $out/converter
mkdir -p $out/images
mkdir -p $out/fonts

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick: this can be simplified

Suggested change
mkdir -p $out/web
mkdir -p $out/converter
mkdir -p $out/images
mkdir -p $out/fonts
mkdir -p $out/{web,converter,images,fonts}

Also, stdenvNoCC.mkDerivation instead of runCommand is my strong preference since:

  • It has better compatibility with other tooling
  • It lets you run allfontsgen in the build phase and copy to $out in the install phase
  • It lets you add script dependencies such as x2t, allfontsgen, etc... to nativeBuildInputs

Comment thread pkgs/by-name/eu/euro-office-documentserver/package.nix Outdated

echo Generating fonts
export CUSTOM_FONTS_PATHS=${lib.concatStringsSep ":" extra-fonts}
${x2t.components.allfontsgen}/bin/allfontsgen \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nit: either do the mkDerivation approach or

Suggested change
${x2t.components.allfontsgen}/bin/allfontsgen \
${lib.getExe x2t.components.allfontsgen} \

Comment thread pkgs/by-name/eu/euro-office-documentserver/package.nix Outdated
Comment on lines +115 to +125
${lib.getExe x2t.components.allthemesgen} \
--converter-dir="$out/bin"\
--src="working"\
--output="$out/images"
${x2t.components.allthemesgen}/bin/allthemesgen \
--converter-dir="$out/bin"\
--src="working"\
--output="$out/images"\
--postfix="ios"\
--params="280,224"
${x2t.components.allthemesgen}/bin/allthemesgen \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
${lib.getExe x2t.components.allthemesgen} \
--converter-dir="$out/bin"\
--src="working"\
--output="$out/images"
${x2t.components.allthemesgen}/bin/allthemesgen \
--converter-dir="$out/bin"\
--src="working"\
--output="$out/images"\
--postfix="ios"\
--params="280,224"
${x2t.components.allthemesgen}/bin/allthemesgen \
${lib.getExe x2t.components.allthemesgen} \
--converter-dir="$out/bin"\
--src="working"\
--output="$out/images"
${lib.getExe x2t.components.allthemesgen} \
--converter-dir="$out/bin"\
--src="working"\
--output="$out/images"\
--postfix="ios"\
--params="280,224"
${lib.getExe x2t.components.allthemesgen} \

echo "[]" > $out/var/www/onlyoffice/documentserver/sdkjs-plugins/plugin-list-default.json

mkdir -p $out/var/www/onlyoffice/documentserver/server/schema
cp -r ${server-src}/schema/* $out/var/www/onlyoffice/documentserver/server/schema

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nitpick: would you mind opening (and linking to in comments) upstream issues for not following symlinks? I'd do it myself except I'm not familiar with the codebase and don't have the time to test every instance of not following symlinks myself.

Comment thread pkgs/by-name/eu/euro-office-documentserver/package.nix Outdated

## required for bwrap --bind
chmod u+w $out/var
mkdir -p $out/var/lib/onlyoffice

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It looks like this isn't used in the main derivation? Why is this here?

Comment thread pkgs/by-name/eu/euro-office-documentserver/package.nix Outdated
Comment on lines +29 to +78
common = buildNpmPackage (finalAttrs: {
name = "euro-office-server-Common";
src = server-src;
sourceRoot = "${finalAttrs.src.name}/Common";
npmDepsHash = "sha256-zFGqDtnNFzXCwp6uvK04GDMRG6BATv6ti3Wi8ikLjBU=";
dontNpmBuild = true;
postPatch = ''
# https://github.com/ONLYOFFICE/build_tools/blob/ef8153c053bed41909ceb0762b124f8fe7faa0a7/scripts/build_server.py#L34
sed -e "s/^const buildVersion = '[0-9.]*'/const buildVersion = '${version}'/" -i sources/commondefines.js
'';
postInstall = ''
ln -s $out/lib/node_modules/common $out/lib/node_modules/Common
'';
});
docservice = buildNpmPackage (finalAttrs: {
name = "euro-office-server-DocService";
src = server-src;
sourceRoot = "${finalAttrs.src.name}/DocService";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
vips.dev
];
npmDepsHash = "sha256-eD7hyeIcSL0nLcmBE5+gDJcjT+LdUaqIZ+g5sPcn8HQ=";
npmFlags = [ "--loglevel=verbose" ];
dontNpmBuild = true;
postInstall = ''
# it would be neater if this were a 'ln -s', but this is not possible
# because common/sources/notificationService.js has a circular dependency
# back on DocService
cp -r ${common}/lib/node_modules/common $out/lib/node_modules/Common
ln -s $out/lib/node_modules/coauthoring $out/lib/node_modules/DocService
'';
});
fileconverter = buildNpmPackage (finalAttrs: {
name = "euro-office-server-FileConverter";
src = server-src;

sourceRoot = "${finalAttrs.src.name}/FileConverter";

npmDepsHash = "sha256-zGLZBbQYV2z0HgQKISKVhclRKbMB8RYEX13H0mB6qJw=";

dontNpmBuild = true;

postInstall = ''
ln -s ${common}/lib/node_modules/common $out/lib/node_modules/Common
ln -s ${docservice}/lib/node_modules/coauthoring $out/lib/node_modules/DocService
'';
});

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's a good argument to be made for moving these into separate packages, or at least separate files. This is what we did for stalwart (originally separate files, subsequently separate packages).

@Pandapip1

Copy link
Copy Markdown
Member

Also: if x2t-with-fonts-and-themes is shared between euro-office and onlyoffice, then that's a pretty good reason on its own to bring it out into its own package.

Comment on lines +57 to +61
# it would be neater if this were a 'ln -s', but this is not possible
# because common/sources/notificationService.js has a circular dependency
# back on DocService
cp -r ${common}/lib/node_modules/common $out/lib/node_modules/Common
ln -s $out/lib/node_modules/coauthoring $out/lib/node_modules/DocService

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Opened Euro-Office/server#17 which should resolve this issue and allow for proper symlinking

Comment on lines +74 to +77
postInstall = ''
ln -s ${common}/lib/node_modules/common $out/lib/node_modules/Common
ln -s ${docservice}/lib/node_modules/coauthoring $out/lib/node_modules/DocService
'';

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Euro-Office/server#17 should eliminate the need for this.

@onny onny changed the title euro-office-documentserver: init at 0-unstable-2026-03-27 euro-office-documentserver: init at 0-unstable-2026-04-08 Apr 15, 2026
@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Apr 15, 2026
@onny onny changed the title euro-office-documentserver: init at 0-unstable-2026-04-08 euro-office-documentserver: init at 9.3.1 Jun 15, 2026
@onny onny force-pushed the eu-office-init branch from 97a8abe to e60ca75 Compare June 15, 2026 09:46
@onny

onny commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

updated to 9.3.1

@Thatoo

Thatoo commented Jun 16, 2026

Copy link
Copy Markdown

Hi,
Will it be possible to backport it to stable 26.04?

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: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants