50$ bounty for Modelio

Hi i am setting a 50$ (paypal) bounty for someone to bring Modelio 5.4.1 (latest) in the nixos pkgs store.

Here is the github link to the project: Modelio
It is a java project that uses eclipse and maven here is more information: Build Modelio Index

Here are other maybe relevant links:
Engineering apps · Issue #164019 · NixOS/nixpkgs · GitHub,
modelio: init at 5.1.0 by yuuyins · Pull Request #154188 · NixOS/nixpkgs · GitHub

How about donating the $50 for the Nix Foundation? :pray:

10 Likes

Thank you very much for your effort.
I get this error:

What did i do?
Enabled flakes in configuration.nix like it is described here: Enabling NixOS with Flakes | NixOS & Flakes Book

Forked your github repository → checked out the branch “nix”
→ run “nix run”
→ run “nix build”

As another question why are you using a flake? (I just started with flakes today and am working through the course i linked above)

How about donating the $50 for the Nix Foundation?

I take it that you want to divert the 50$ to the Nix Foundation is that assumption correct? (i would donate it here: NixOS - Open Collective)

You did nothing wrong, this is just maven being maven, paired with a grain of “this is how fixed output derivations work”.

Maybe basing the expression on maven.buildMavenPackage might be more succesfull, maybe the way how the maven project is written, simply doesn’t allow for using a FOD without patching.

1 Like

Doh! Sorry. Please try again.

Source is now pinned.

Thanks for having a look.
I still have the problem


I cloned the repo fresh as i first thought that maybe this is the problem.

If you don’t need a build from source, then here’s another option which I let the clankers clank out. It launches and seems to be functional. But this just takes the easy way out and packages the .deb (as does DBeaver for instance).

I can’t verify further though as hyprland/wayland/something-with-NixOS has issues rendering eclipse SWT which means I can’t properly see the UI elements (same happens with DBeaver though and afaik it works fine with other DEs).

Benefit being that updates should be much more stable (as we sidestep maven!)
By the way @randomizedcoder I think nix flake update won’t bump the version there. It should only change the pinned version in the flake.lock.

{
  description = "Modelio - Open-source UML, BPMN, ArchiMate and SysML modeling environment";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

  outputs =
    { nixpkgs, ... }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};

      modelio = pkgs.stdenvNoCC.mkDerivation (finalAttrs: {
        pname = "modelio";
        version = "5.4.1";

        src = pkgs.fetchurl {
          url = "https://github.com/ModelioOpenSource/Modelio/releases/download/v${finalAttrs.version}/modelio-open-source-${finalAttrs.version}_amd64.deb";
          hash = "sha256-cg7ruIYpOgz2nfax37M8sUs89Qvbb5PMudyR0ZNiURo=";
        };

        nativeBuildInputs = with pkgs; [
          dpkg
          makeWrapper
          autoPatchelfHook
          wrapGAppsHook3
        ];

        buildInputs = with pkgs; [
          gtk3
          glib
          libsecret
          libx11
          libxtst
        ];

        unpackPhase = ''
          runHook preUnpack
          dpkg-deb --extract $src .
          runHook postUnpack
        '';

        dontConfigure = true;
        dontBuild = true;

        installPhase =
          let
            # SWT 3.120 hardcodes dlopen("libwebkit2gtk-4.0.so.37") but nixpkgs
            # only ships webkitgtk_4_1 (soname libwebkit2gtk-4.1.so.0).
            # The 4.0→4.1 change was solely a libsoup2→libsoup3 switch; the
            # webkit2gtk C API and ABI are otherwise identical. SWT only uses
            # core functions (webkit_web_view_new, _load_uri, etc.) unrelated
            # to libsoup internals.
            # https://webkitgtk.org/reference/webkit2gtk/2.38.0/index.html
            webkitCompat = pkgs.stdenvNoCC.mkDerivation {
              name = "webkitgtk-4.0-compat";
              dontUnpack = true;
              installPhase = ''
                mkdir -p $out/lib
                ln -s ${pkgs.webkitgtk_4_1}/lib/libwebkit2gtk-4.1.so.0 $out/lib/libwebkit2gtk-4.0.so.37
              '';
            };
          in
          ''
            runHook preInstall

            rm -rf usr/lib/modelio-open-source5.4/jre

            mkdir -p $out/opt/modelio $out/bin
            cp -r usr/lib/modelio-open-source5.4/* $out/opt/modelio

            # Remove upstream's blanket TLS error suppression
            substituteInPlace $out/opt/modelio/modelio.ini \
              --replace-fail "-Dorg.eclipse.swt.internal.webkitgtk.ignoretlserrors=true" ""

            makeWrapper $out/opt/modelio/modelio $out/bin/modelio \
              --prefix PATH : "${pkgs.openjdk11}/bin" \
              --set JAVA_HOME "${pkgs.openjdk11.home}" \
              --set SWT_GTK3 "1" \
              --set SWT_WEBKIT2 "1" \
              --set UBUNTU_MENUPROXY "0" \
              --set LIBOVERLAY_SCROLLBAR "0" \
              --prefix GIO_EXTRA_MODULES : "${pkgs.glib-networking}/lib/gio/modules" \
              --prefix LD_LIBRARY_PATH : "${
                pkgs.lib.makeLibraryPath [
                  pkgs.gtk3
                  pkgs.glib
                  webkitCompat
                  pkgs.glib-networking
                ]
              }"

            mkdir -p $out/share/applications
            cp usr/share/applications/modelio-open-source5.4.desktop $out/share/applications/modelio.desktop
            substituteInPlace $out/share/applications/modelio.desktop \
              --replace-fail "Exec=/usr/bin/modelio-open-source5.4" "Exec=$out/bin/modelio" \
              --replace-fail "Icon=modelio-open-source5.4" "Icon=modelio"

            mkdir -p $out/share/icons/hicolor/scalable/apps
            cp usr/share/icons/hicolor/scalable/apps/modelio-open-source5.4.svg \
               $out/share/icons/hicolor/scalable/apps/modelio.svg

            runHook postInstall
          '';

        meta = with pkgs.lib; {
          homepage = "https://www.modelio.org/";
          changelog = "https://github.com/ModelioOpenSource/Modelio/releases/tag/v${finalAttrs.version}";
          description = "Open-source UML, BPMN, ArchiMate and SysML modeling environment";
          sourceProvenance = with sourceTypes; [ binaryNativeCode ];
          license = licenses.gpl3Plus;
          platforms = [ "x86_64-linux" ];
          mainProgram = "modelio";
        };
      });
    in
    {
      packages.${system}.default = modelio;
    };
}

i copied your code in a “flake.nix” file and tried running it with “nix run” it instantly crashes.


Interesting, does nix build && ./result/bin/modelio also crash? And could you provide the full error logs if possible?

yes it also crashes the log:

logs
17:39:35,299 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
17:39:35,299 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
17:39:35,299 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.xml]
17:39:35,300 |-INFO in ch.qos.logback.classic.BasicConfigurator@7c8f9c2e - Setting up default configuration.
17:39:35,323 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.rolling.RollingFileAppender]
17:39:35,325 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [LOGFILE]
17:39:35,330 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@159860059 - setting totalSizeCap to 1 GB
17:39:35,332 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@159860059 - Archive files will be limited to [50 MB] each.
17:39:35,335 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@159860059 - No compression will be used
17:39:35,336 |-INFO in c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy@159860059 - Will use the pattern /home/lukas/.modelio/5.4/modelio-%d{yyyy-MM-dd}-%i.log for the active file
17:39:35,337 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@782be4eb - The date pattern is 'yyyy-MM-dd' from file name pattern '/home/lukas/.modelio/5.4/modelio-%d{yyyy-MM-dd}-%i.log'.
17:39:35,337 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@782be4eb - Roll-over at midnight.
17:39:35,346 |-INFO in ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP@782be4eb - Setting initial period to Tue Mar 24 17:39:35 CET 2026
17:39:35,347 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
17:39:35,352 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[LOGFILE] - Active log file name: /home/lukas/.modelio/5.4/modelio-2026-03-24-0.log
17:39:35,352 |-INFO in ch.qos.logback.core.rolling.RollingFileAppender[LOGFILE] - File property is set to [null]
17:39:35,353 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
17:39:35,353 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
17:39:35,353 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
17:39:35,354 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to TRACE
17:39:35,354 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
17:39:35,354 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [LOGFILE] to Logger[ROOT]
17:39:35,354 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
17:39:35,354 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@7903d448 - Registering current configuration as safe fallback point
17:39:35.669 INFO  o.m.p.u.log.writers.PluginLogger Changing log level from ERROR to DEBUG
17:39:35.671 DEBUG org.modelio.platform.preferences Initializing 'org.modelio.platform.preferences' plugin preferences ...
17:39:35.674 DEBUG org.modelio.platform.preferences  - Initializing default values from 'org.modelio.app.admtool'...
17:39:35.674 DEBUG org.modelio.platform.preferences    - default pref value 'Log.LogLevel'='3'
17:39:35.675 DEBUG org.modelio.platform.preferences    - default pref value 'AdmTools.Show'='false'
17:39:35.675 DEBUG org.modelio.platform.preferences  - Initializing default values from 'org.modelio.app.diagram.editor'...
17:39:35.675 DEBUG org.modelio.platform.preferences    - default pref value 'DeleteMode'='DELETE'
17:39:35.675 DEBUG org.modelio.platform.preferences  - Initializing default values from 'org.modelio.app.module.catalog'...
17:39:35.675 DEBUG org.modelio.platform.preferences    - default pref value 'ModuleCatalog.ShowCompatible'='true'
17:39:35.675 DEBUG org.modelio.platform.preferences    - default pref value 'ModuleCatalog.ShowLatest'='true'
17:39:35.675 DEBUG org.modelio.platform.preferences  - Initializing default values from 'org.modelio.app.update.ext_org'...
17:39:35.675 DEBUG org.modelio.platform.preferences    - default pref value 'Update.Site'='https://www.modelio.org/updates'
17:39:35.675 INFO  o.m.p.u.log.writers.PluginLogger Changing log level from DEBUG to ERROR
17:39:35.675 INFO  o.m.p.u.log.writers.PluginLogger Changing log level from ERROR to INFO
17:39:35.704 INFO  org.modelio.app.ui               Modelio by modelio.org
17:39:35.708 INFO  org.modelio.app.ui               Modelio version            : '5.4.01'
17:39:35.708 INFO  org.modelio.app.ui               Modelio runtime data path  : '/home/lukas/.modelio/5.4'
17:39:35.708 INFO  org.modelio.app.ui               Modelio module catalog path: '/home/lukas/.modelio/5.4/modules'
17:39:35.708 INFO  org.modelio.app.ui               Modelio macro  catalog path: '/home/lukas/.modelio/5.4/macros'
17:39:35.708 INFO  org.modelio.app.ui               Instance location: file:/home/lukas/.modelio/5.4/opensource-cache/data/
17:39:35.708 INFO  org.modelio.app.ui               Command line arguments = '-clearPersistedState '
17:39:35.810 INFO  org.modelio.app.ui               Trusted server certificates store is '/home/lukas/.modelio/5.4/servercerts.db'
17:39:37.313 INFO  org.modelio.app.ui               SWAP is ENABLED
17:39:37.848 INFO  org.modelio.app.project.ui       Changing workspace to: /home/lukas/modelio/workspace
2026-03-24 17:39:38.307:INFO::Start Help Server: Logging initialized @4869ms to org.eclipse.jetty.util.log.StdErrLog
2026-03-24 17:39:38.434:INFO:oejs.session:Start Help Server: DefaultSessionIdManager workerName=node0
2026-03-24 17:39:38.434:INFO:oejs.session:Start Help Server: No SessionScavenger set, using defaults
2026-03-24 17:39:38.435:INFO:oejs.session:Start Help Server: node0 Scavenging every 600000ms
2026-03-24 17:39:38.468:INFO:oejs.session:Start Help Server: node0 Scavenging every 660000ms
17:39:39.306 INFO  org.modelio.platform.project     Running batch: project=null create=false workspace=null
Gdk-Message: 17:39:39.626: Error 71 (Protocol error) dispatching to Wayland display.

Interesting that it works for me because I’m also on wayland.
Anyways can you try this out? Might be able to make it work by forcing X11

            makeWrapper $out/opt/modelio/modelio $out/bin/modelio \
              --prefix PATH : "${pkgs.openjdk11}/bin" \
              --set JAVA_HOME "${pkgs.openjdk11.home}" \
              --set GDK_BACKEND "x11" \
              --set SWT_GTK3 "1" \
              --set SWT_WEBKIT2 "1" \
              --set UBUNTU_MENUPROXY "0" \
              --set LIBOVERLAY_SCROLLBAR "0" \
              --prefix GIO_EXTRA_MODULES : "${pkgs.glib-networking}/lib/gio/modules" \
              --prefix LD_LIBRARY_PATH : "${
                pkgs.lib.makeLibraryPath [
                  pkgs.gtk3
                  pkgs.glib
                  webkitCompat
                  pkgs.glib-networking
                ]
              }"
1 Like

It looks like it is working.

1 Like

Hell yeah. Glad I could be of help.

Also if anybody wants to go the extra mile and upstream it, then you are more than welcome to.
(as technically the bounty is still unfulfilled going by original wording :wink: )

1 Like

Thank you very much.

I didn’t use flakes until today.
I am still not sure why you guys used flakes instead of making it the “traditional” way.

(as technically the bounty is still unfulfilled going by original wording :wink: )

You are right.
As i think that the pkgs store has a wider audience and better search than flakes i will keep the bounty open.

Here is the final flake.nix thanks to @boostd

flake.nix
{
  description = "Modelio - Open-source UML, BPMN, ArchiMate and SysML modeling environment";

  inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";

  outputs =
    { nixpkgs, ... }:
    let
      system = "x86_64-linux";
      pkgs = nixpkgs.legacyPackages.${system};

      modelio = pkgs.stdenvNoCC.mkDerivation (finalAttrs: {
        pname = "modelio";
        version = "5.4.1";

        src = pkgs.fetchurl {
          url = "https://github.com/ModelioOpenSource/Modelio/releases/download/v${finalAttrs.version}/modelio-open-source-${finalAttrs.version}_amd64.deb";
          hash = "sha256-cg7ruIYpOgz2nfax37M8sUs89Qvbb5PMudyR0ZNiURo=";
        };

        nativeBuildInputs = with pkgs; [
          dpkg
          makeWrapper
          autoPatchelfHook
          wrapGAppsHook3
        ];

        buildInputs = with pkgs; [
          gtk3
          glib
          libsecret
          libx11
          libxtst
        ];

        unpackPhase = ''
          runHook preUnpack
          dpkg-deb --extract $src .
          runHook postUnpack
        '';

        dontConfigure = true;
        dontBuild = true;

        installPhase =
          let
            # SWT 3.120 hardcodes dlopen("libwebkit2gtk-4.0.so.37") but nixpkgs
            # only ships webkitgtk_4_1 (soname libwebkit2gtk-4.1.so.0).
            # The 4.0→4.1 change was solely a libsoup2→libsoup3 switch; the
            # webkit2gtk C API and ABI are otherwise identical. SWT only uses
            # core functions (webkit_web_view_new, _load_uri, etc.) unrelated
            # to libsoup internals.
            # https://webkitgtk.org/reference/webkit2gtk/2.38.0/index.html
            webkitCompat = pkgs.stdenvNoCC.mkDerivation {
              name = "webkitgtk-4.0-compat";
              dontUnpack = true;
              installPhase = ''
                mkdir -p $out/lib
                ln -s ${pkgs.webkitgtk_4_1}/lib/libwebkit2gtk-4.1.so.0 $out/lib/libwebkit2gtk-4.0.so.37
              '';
            };
          in
          ''
            runHook preInstall

            rm -rf usr/lib/modelio-open-source5.4/jre

            mkdir -p $out/opt/modelio $out/bin
            cp -r usr/lib/modelio-open-source5.4/* $out/opt/modelio

            # Remove upstream's blanket TLS error suppression
            substituteInPlace $out/opt/modelio/modelio.ini \
              --replace-fail "-Dorg.eclipse.swt.internal.webkitgtk.ignoretlserrors=true" ""

              makeWrapper $out/opt/modelio/modelio $out/bin/modelio \
              --prefix PATH : "${pkgs.openjdk11}/bin" \
              --set JAVA_HOME "${pkgs.openjdk11.home}" \
              --set GDK_BACKEND "x11" \
              --set SWT_GTK3 "1" \
              --set SWT_WEBKIT2 "1" \
              --set UBUNTU_MENUPROXY "0" \
              --set LIBOVERLAY_SCROLLBAR "0" \
              --prefix GIO_EXTRA_MODULES : "${pkgs.glib-networking}/lib/gio/modules" \
              --prefix LD_LIBRARY_PATH : "${
                pkgs.lib.makeLibraryPath [
                  pkgs.gtk3
                  pkgs.glib
                  webkitCompat
                  pkgs.glib-networking
                ]
              }"

            mkdir -p $out/share/applications
            cp usr/share/applications/modelio-open-source5.4.desktop $out/share/applications/modelio.desktop
            substituteInPlace $out/share/applications/modelio.desktop \
              --replace-fail "Exec=/usr/bin/modelio-open-source5.4" "Exec=$out/bin/modelio" \
              --replace-fail "Icon=modelio-open-source5.4" "Icon=modelio"

            mkdir -p $out/share/icons/hicolor/scalable/apps
            cp usr/share/icons/hicolor/scalable/apps/modelio-open-source5.4.svg \
               $out/share/icons/hicolor/scalable/apps/modelio.svg

            runHook postInstall
          '';

        meta = with pkgs.lib; {
          homepage = "https://www.modelio.org/";
          changelog = "https://github.com/ModelioOpenSource/Modelio/releases/tag/v${finalAttrs.version}";
          description = "Open-source UML, BPMN, ArchiMate and SysML modeling environment";
          sourceProvenance = with sourceTypes; [ binaryNativeCode ];
          license = licenses.gpl3Plus;
          platforms = [ "x86_64-linux" ];
          mainProgram = "modelio";
        };
      });
    in
    {
      packages.${system}.default = modelio;
    };
}

You need to enable flakes like it is described here: Enabling NixOS with Flakes | NixOS & Flakes Book
Just create a file with the name “flake.nix” and run “nix run”

1 Like

Heh yeah, flakes are a bit of a contentious topic.

But they are a fair bit easier to use standalone, and are “purer” and “more reproducible”. If you check the directory where you placed the flake.nix, then alongside it you will see a flake.lock. That file pins all of the input versions, so in theory even less can change (with legacy Nix the easiest example to give is the channel changing and breaking something). Usually the flake.lock would also be version controlled.

Upstreaming to nixpkgs isn’t too bad, but it’s a bit more involved than I could care for right now :smile:
One just has to open a pull request and go through the review cycle. LLMs can probably guide one through the entire process from here on: to convert the flake into the correct format, place it in the correct location, test the build, etc.

Doh! Sorry. Ok, there’s a lot more to Java than I realized. First time I’ve tried to nix-ify some Java :wink:

I just pushed a big update.

Please try “nix run .#container-run

Oh. I see you got it working. Sorry for the delay. I think the refactor is still worthwhile.