Change:
<ins> { stdenv , lib , fetchFromGitHub , fetchurl , makeWrapper , linkFarmFromDrvs , dotnet-netcore , dotnet-sdk , dotnetPackages , dpkg , gtk3 , libX11 , libXrandr , libappindicator , libevdev , libnotify , udev , makeDesktopItem , wrapGAppsHook }: stdenv.mkDerivation rec { pname = "OpenTabletDriver"; version = "0.4.2"; src = fetchFromGitHub { owner = "InfinityGhost"; repo = "OpenTabletDriver"; rev = "v${version}"; sha256 = "048y7gjlk2yw4vh62px1d9w0va6ap1a0cndcpbirlyj9q6b8jxax"; }; debPkg = fetchurl { url = "https://github.com/InfinityGhost/OpenTabletDriver/releases/download/v${version}/OpenTabletDriver.deb"; sha256 = "13gg0dhvjy88h9lhcrp30fjiwgb9dzjsgk1k760pi1ki71a5vz2r"; }; nativeBuildInputs = [ dotnet-sdk dotnetPackages.Nuget dpkg makeWrapper wrapGAppsHook ]; nugetDeps = linkFarmFromDrvs "${pname}-nuget-deps" (import ./deps.nix { fetchNuGet = { name, version, sha256 }: fetchurl { name = "nuget-${name}-${version}.nupkg"; url = "https://www.nuget.org/api/v2/package/${name}/${version}"; inherit sha256; }; }); runtimeDeps = [ gtk3 libX11 libXrandr libappindicator libevdev libnotify udev ]; configurePhase = '' export HOME=$(mktemp -d) export DOTNET_CLI_TELEMETRY_OPTOUT=1 export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1 nuget sources Add -Name nixos -Source "$PWD/nixos" nuget init "$nugetDeps" "$PWD/nixos" # FIXME: https://github.com/NuGet/Home/issues/4413 mkdir -p $HOME/.nuget/NuGet cp $HOME/.config/NuGet/NuGet.Config $HOME/.nuget/NuGet for project in OpenTabletDriver.{Console,Daemon,UX.Gtk}; do dotnet restore --source "$PWD/nixos" $project done ''; buildPhase = '' for project in OpenTabletDriver.{Console,Daemon,UX.Gtk}; do dotnet build $project  --no-restore  --configuration Release  --framework net5 done ''; installPhase = '' mkdir -p $out/lib/OpenTabletDriver/ cp -r ./OpenTabletDriver/Configurations/ $out/lib/OpenTabletDriver/ for project in OpenTabletDriver.{Console,Daemon,UX.Gtk}; do dotnet publish $project  --no-build  --no-self-contained  --configuration Release  --framework net5  --output $out/lib done # Give a more "*nix" name to the binaries makeWrapper $out/lib/OpenTabletDriver.Console $out/bin/otd  "''${gappsWrapperArgs[@]}"  --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/"  --set DOTNET_ROOT "${dotnet-netcore}"  --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDeps}" makeWrapper $out/lib/OpenTabletDriver.Daemon $out/bin/otd-daemon  "''${gappsWrapperArgs[@]}"  --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/"  --set DOTNET_ROOT "${dotnet-netcore}"  --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDeps}" makeWrapper $out/lib/OpenTabletDriver.UX.Gtk $out/bin/otd-gui  "''${gappsWrapperArgs[@]}"  --prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/"  --set DOTNET_ROOT "${dotnet-netcore}"  --suffix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDeps}" mkdir -p $out/share/{applications,pixmaps} cp -r $src/OpenTabletDriver.UX/Assets/* $out/share/pixmaps cp -r ${makeDesktopItem { desktopName = "OpenTabletDriver"; name = "OpenTabletDriver"; exec = "otd-gui"; icon = "otd"; comment = meta.description; type = "Application"; categories = "Utility;"; }}/share/applications/* $out/share/applications # TODO: Ideally this should be build from OpenTabletDriver/OpenTabletDriver-udev instead dpkg-deb --fsys-tarfile ${debPkg} | tar xf - ./usr/lib/udev/rules.d/30-opentabletdriver.rules mkdir -p $out/lib/udev/rules.d cp ./usr/lib/udev/rules.d/* $out/lib/udev/rules.d ''; dontWrapGApps = true; dontStrip = true; meta = with lib; { description = "Open source, cross-platform, user-mode tablet driver"; homepage = "https://github.com/InfinityGhost/OpenTabletDriver"; license = licenses.lgpl3Plus; maintainers = with maintainers; [ thiagokokada ]; platforms = platforms.linux; }; } </ins>

Discussion:
Project description OpenTabletDriver is an open source, cross platform, user mode tablet driver. The goal of OpenTabletDriver is to be cross platform as possible with the highest compatibility in an easily configurable graphical user interface. It supports multiple tablets that are badly supported in Linux. Even for tablets already supported by other means (i.e.: or ), OpenTabletDriver offers a graphical interface, plugins and more customization. List of supported tablets: Metadata homepage URL: source URL: license: LGPLv3 platforms: Linux, Darwin
I tried to create a package but I can't wrap my head on how to build a .NET 5 application. Trying to follow just made me more and more confused. If it helps, here it is the from Arch Linux:
I have a older OTD package in my nix overlay , I just currently don't have the time to mess with it, I have a WIP .NET 5 package on my local machine that I could upload to a gist if needed
This would be great, since I am stuck on trying to compile thanks to some .NET 5 issue.
I tested your recipe in overlay and seems to work well. Still need to figure how to fix some of the following issues, though: Generate the file automatically, so we can update this package without updating every dependency by hand Wrap the launcher script so the daemon is launched automatically (as it happens in the Debian package I think?). Or as an alternative, just start this as a systemd service (as the AUR package does) Generate the udev rules and copy it to the appropriate place. Alternatively we can just extract the udev file from the .deb package, but this involves some manual operation Except for the first issue, for the other ones I think maybe it would be better to have a module (for example, ) so we could automatically enable the systemd service, set the udev rules and add the GUI to the . This seems the cleanest way to fix those issues.
have an initial build of OpenTabletDriver 0.4.2. It almost works, but needs some manual setup: Start the manually before opening . Alternatively, you can start the daemon as an systemd user service, something like this: For now, you need to add manually to your .

This can be fixed if we add a module, that once enabled do this automatically (and it may also create a systemd user service, fixing the first issue too) Now, while it builds and kinda works, I can't seem to make it detect my tablet (Huion HS64). I thought something was wrong with the udev rules but looking at the udev logs it seems that the rules are being applied correctly. The connection between the GUI and daemon itself seems fine, since it does redirect the logs to the daemon. So now I am stuck. Do you have some idea on how to solve the issue above?
Got the package to work with the help of OpenTabletDriver's Discord. It was missing the .