Change:
Losslesscut crashes at startup due to missing Steps to reproduce the behavior: # crash # works Losslesscut works out-of-the-box. probably just needs a in .
It seems to come from a sandboxing feature of Chromium. (LosslessCut is an Electron app, and Electron uses Chromium, IIUC.) I'll add the flag when I'm available. Should it be to both the Linux and the Darwin binary, or just to the former?
I was only able to test on Linux. While you're at it: When bumping the version, filenames need a change (only tested for Linux): and is still open.
Thank you for reminding! After a quick test, 3.43.0 does run out-of-the-box on my machine Does it crash because the user namespaces is unavailable? Does the same problem happen to , it is another electron app packaged the same way. Does it happen to itself?
I can confirm that it works ootb on NixOS 21.11, but not on 22.05. Caprine crashes in a similar way on NixOS 22.05: Chromium works on both.
How about onlyoffice-bin? If does work, it might have something to do with .
works on 22.05
I'm working on it, but couldn't find a way to call in . To be exact, I don't know how to inject the dependency , a setup hook, into the builder. How should I do it? Thanks a lot for your patience.
Is this issue still relevant?
Last time I checked: Yes. I've got this still on my list and will close in case it is resolved.
It should now be fixed in .
Confirmed.

Discussion:
<del> { appimageTools, lib, fetchurl, version, sha256 }: let pname = "losslesscut"; nameRepo = "lossless-cut"; nameCamel = "LosslessCut"; name = "${pname}-${version}"; nameSource = "${nameCamel}-linux-x86_64.AppImage"; nameExecutable = "losslesscut"; owner = "mifi"; src = fetchurl { url = "https://github.com/${owner}/${nameRepo}/releases/download/v${version}/${nameSource}"; name = nameSource; inherit sha256; }; extracted = appimageTools.extractType2 { inherit name src; }; in appimageTools.wrapType2 { inherit name src; profile = '' export LC_ALL=C.UTF-8 ''; extraPkgs = ps: appimageTools.defaultFhsEnvArgs.multiPkgs ps; extraInstallCommands = '' mv $out/bin/{${name},${nameExecutable}} ( mkdir -p $out/share cd ${extracted}/usr find share -mindepth 1 -type d -exec mkdir -p $out/{} ; find share -mindepth 1 -type f,l -exec ln -s $PWD/{} $out/{} ; ) ln -s ${extracted}/${nameExecutable}.png $out/share/icons/${nameExecutable}.png mkdir $out/share/applications cp ${extracted}/${nameExecutable}.desktop $out/share/applications substituteInPlace $out/share/applications/${nameExecutable}.desktop  --replace AppRun ${nameExecutable} ''; meta.platforms = with lib.platforms; [ "x86_64-linux" ]; } </del>

<ins> { lib , appimageTools , fetchurl , makeWrapper , gtk3 , gsettings-desktop-schemas , pname , version , hash , metaCommon ? { } }: let pname = "losslesscut"; src = fetchurl { url = "https://github.com/mifi/lossless-cut/releases/download/v${version}/LosslessCut-linux-x86_64.AppImage"; inherit hash; }; extracted = appimageTools.extractType2 { inherit pname version src; }; in (appimageTools.wrapType2 { inherit pname version src; profile = '' export LC_ALL=C.UTF-8 ''; extraPkgs = ps: appimageTools.defaultFhsEnvArgs.multiPkgs ps; extraInstallCommands = '' mv $out/bin/{${pname}-${version},losslesscut} ( mkdir -p $out/share cd ${extracted}/usr find share -mindepth 1 -type d -exec mkdir -p $out/{} ; find share -mindepth 1 -type f,l -exec ln -s $PWD/{} $out/{} ; ) ln -s ${extracted}/losslesscut.png $out/share/icons/losslesscut.png mkdir $out/share/applications cp ${extracted}/losslesscut.desktop $out/share/applications substituteInPlace $out/share/applications/losslesscut.desktop  --replace AppRun losslesscut source "${makeWrapper}/nix-support/setup-hook" wrapProgram "$out/bin/losslesscut"  --add-flags "--disable-seccomp-filter-sandbox" ''; meta = metaCommon // { platforms = [ "x86_64-linux" ]; mainProgram = "losslesscut"; }; }) // { inherit pname version; } </ins>

<ins> { lib , stdenvNoCC , fetchurl , undmg , pname , version , hash , isAarch64 , metaCommon ? { } }: let pname = "losslesscut"; src = fetchurl { url = "https://github.com/mifi/lossless-cut/releases/download/v${version}/LosslessCut-mac-${if isAarch64 then "arm64" else "x64"}.dmg"; inherit hash; }; in stdenvNoCC.mkDerivation { inherit pname version src; nativeBuildInputs = [ undmg ]; sourceRoot = "LosslessCut.app"; installPhase = '' mkdir -p "$out/Applications/LosslessCut.app" cp -R . "$out/Applications/LosslessCut.app" mkdir -p "$out/bin" ln -s "$out/Applications/LosslessCut.app/Contents/MacOS/LosslessCut" "$out/bin/losslesscut" ''; meta = metaCommon // (with lib; { platforms = singleton (if isAarch64 then "aarch64-darwin" else "x86_64-darwin"); mainProgram = "losslesscut"; }); } </ins>

<ins> { lib , stdenvNoCC , fetchurl , p7zip , pname , version , hash , metaCommon ? { } }: stdenvNoCC.mkDerivation { inherit pname version; src = fetchurl { url = "https://github.com/mifi/lossless-cut/releases/download/v${version}/LosslessCut-win-x64.7z"; inherit hash; }; nativeBuildInputs = [ p7zip ]; unpackPhase = '' 7z x $src -oLosslessCut-win-x64 ''; sourceRoot = "LosslessCut-win-x64"; installPhase = '' mkdir -p $out/bin $out/libexec (cd .. && mv LosslessCut-win-x64 $out/libexec) ln -s "$out/libexec/LosslessCut-win-x64/LosslessCut.exe" "$out/bin/LosslessCut.exe" ''; meta = metaCommon // (with lib; { platforms = platforms.windows; mainProgram = "LosslessCut.exe"; }); } </ins>

<del> { callPackage, stdenvNoCC, lib }: </del> <ins> { lib , callPackage , buildPackages , hostPlatform }: </ins> let <del> version = "3.46.2"; appimage = callPackage ./appimage.nix { inherit version; sha256 = "sha256-p+HscYsChR90JHdYjurY4OOHgveGXbJomz1klBCsF2Q="; }; dmg = callPackage ./dmg.nix { inherit version; sha256 = "sha256-350MHWwyjCdvIv6W6lX6Hr6PLDiAwO/e+KW0yKi/Yoc="; }; windows = callPackage ./windows.nix { inherit version; sha256 = "sha256-48ifhvIWSPmmnBnW8tP7NeWPIWJYWNqGP925O50CAwQ="; }; in ( if stdenvNoCC.isDarwin then dmg else if stdenvNoCC.isCygwin then windows else appimage ).overrideAttrs (oldAttrs: { meta = with lib; { </del> <ins> pname = "losslesscut"; version = "3.48.2"; metaCommon = with lib; { </ins> description = "The swiss army knife of lossless video/audio editing"; homepage = "https://mifi.no/losslesscut/"; license = licenses.gpl2Only; maintainers = with maintainers; [ ShamrockLee ]; <del> } // oldAttrs.meta // { platforms = appimage.meta.platforms ++ dmg.meta.platforms ++ windows.meta.platforms; </del> }; <del> }) </del> <ins> x86_64-appimage = callPackage ./build-from-appimage.nix { inherit pname version metaCommon; hash = "sha256-5T5+eBVbyOI89YA9NMLWweHagD09RB3P03HFvaDAOZ8="; inherit (buildPackages) makeWrapper; }; x86_64-dmg = callPackage ./build-from-dmg.nix { inherit pname version metaCommon; hash = "sha256-PzjE0oJOuPG0S+mA7pgNU3MRgaE2jAPxWEN9J4PfqMQ="; isAarch64 = false; }; aarch64-dmg = callPackage ./build-from-dmg.nix { inherit pname version metaCommon; hash = "sha256-927CSczgFJcbBJm2cYXucFRidkGAtcowoLMlm2GTafc="; isAarch64 = true; }; x86_64-windows = callPackage ./build-from-windows.nix { inherit pname version metaCommon; hash = "sha256-+isxkGKxW7H+IjuA5G4yXuvDmX+4UlsD8sXwoHxgLM8="; }; in ( if hostPlatform.system == "aarch64-darwin" then aarch64-dmg else if hostPlatform.isDarwin then x86_64-dmg else if hostPlatform.isCygwin then x86_64-windows else x86_64-appimage ).overrideAttrs (oldAttrs: { passthru = (oldAttrs.passthru or { }) // { inherit x86_64-appimage x86_64-dmg aarch64-dmg x86_64-windows; }; meta = oldAttrs.meta // { platforms = lib.unique ( x86_64-appimage.meta.platforms ++ x86_64-dmg.meta.platforms ++ aarch64-dmg.meta.platforms ++ x86_64-windows.meta.platforms ); }; }) </ins>

<del> { stdenvNoCC, lib, fetchurl, undmg, version , sha256 }: let pname = "losslesscut"; nameRepo = "lossless-cut"; nameCamel = "LosslessCut"; nameSource = "${nameCamel}-mac-x64.dmg"; nameApp = nameCamel + ".app"; owner = "mifi"; src = fetchurl { url = "https://github.com/${owner}/${nameRepo}/releases/download/v${version}/${nameSource}"; name = nameSource; inherit sha256; }; in stdenvNoCC.mkDerivation { inherit pname version src; nativeBuildInputs = [ undmg ]; unpackPhase = '' undmg ${src} ''; sourceRoot = nameApp; installPhase = '' mkdir -p $out/Applications/${nameApp} cp -R . $out/Applications/${nameApp} ''; meta.platforms = lib.platforms.darwin; } </del>

<del> { stdenvNoCC , lib , fetchurl , p7zip , version , sha256 , useMklink ? false , customSymlinkCommand ? null }: let pname = "losslesscut"; nameRepo = "lossless-cut"; nameCamel = "LosslessCut"; nameSourceBase = "${nameCamel}-win-x64"; nameSource = "${nameSourceBase}.7z"; nameExecutable = "${nameCamel}.exe"; owner = "mifi"; getSymlinkCommand = if (customSymlinkCommand != null) then customSymlinkCommand else if useMklink then (targetPath: linkPath: "mklink ${targetPath} ${linkPath}") else (targetPath: linkPath: "ln -s ${targetPath} ${linkPath}"); in stdenvNoCC.mkDerivation { inherit pname version sha256; src = fetchurl { name = nameSource; url = "https://github.com/${owner}/${nameRepo}/releases/download/v${version}/${nameSource}"; inherit sha256; }; nativeBuildInputs = [ p7zip ]; unpackPhase = '' 7z x $src -o${nameSourceBase} ''; sourceRoot = nameSourceBase; installPhase = '' mkdir -p $out/bin $out/libexec cd .. mv ${nameSourceBase} $out/libexec '' + (getSymlinkCommand "${nameSourceBase}/${nameExecutable}" "$out/bin/${nameExecutable}"); meta.platforms = lib.platforms.windows; } </del>