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

oni2: init at 0.5.7 #136101

Merged
merged 2 commits into from
Nov 3, 2021
Merged

oni2: init at 0.5.7 #136101

merged 2 commits into from
Nov 3, 2021

Conversation

gardspirito
Copy link
Contributor

Init of unfree Onivim2 editor.

This is my first contribution to Nixpkgs. I may provide onivim2-mit version later.

Unfortunately, this derivation is very hacky because Nix does not yet have tools to support esy.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.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.

@r-rmcgibbo
Copy link

r-rmcgibbo commented Aug 29, 2021

Result of nixpkgs-review pr 136101 at c55b928b run on x86_64-linux 1

1 package built successfully:
  • oni2
3 suggestions:
  • warning: missing-phase-hooks

    buildPhase should probably contain runHook preBuild and runHook postBuild.

    Near pkgs/applications/editors/oni2/default.nix:188:7:

        |
    188 |       buildPhase = ''
        |       ^
    
  • warning: missing-phase-hooks

    installPhase should probably contain runHook preInstall and runHook postInstall.

    Near pkgs/applications/editors/oni2/default.nix:219:7:

        |
    219 |       installPhase = ''
        |       ^
    
  • warning: missing-phase-hooks

    configurePhase should probably contain runHook preConfigure and runHook postConfigure.

    Near pkgs/applications/editors/oni2/default.nix:165:7:

        |
    165 |       configurePhase = ''
        |       ^
    

Result of nixpkgs-review pr 136101 at c55b928b run on aarch64-linux 1

1 package failed to build:

Note that build failures may predate this PR, and could be nondeterministic or hardware dependent.
Please exercise your independent judgement. Does something look off? Please file an issue or reach out on IRC.

@gardspirito
Copy link
Contributor Author

Amend: fix Oni2 extensions not working.

@gardspirito
Copy link
Contributor Author

Amend: follow Robot Robert's tips, remove aarch64 (doesn't seem to be supported yet: onivim/oni2#2708).

@sefidel
Copy link
Member

sefidel commented Aug 29, 2021

Building fails with

        esy: internal error, uncaught exception:
            Unix.Unix_error(Unix.EACCES, "mkdir", "/build/")
       

@gardspirito gardspirito force-pushed the oni2 branch 2 times, most recently from 8075c9f to f38c09d Compare August 30, 2021 09:33
@gardspirito
Copy link
Contributor Author

@boppyt, thanks for reporting.

I accidentally used /build/ directly instead of using $NIX_BUILD_TOP. Should be fixed now.

@sefidel
Copy link
Member

sefidel commented Aug 30, 2021

Still failing for me,

error: builder for '/nix/store/03xiy4f1115anvcinx6xfqqj0k3sc82x-oni2-fetch-deps.drv' failed with exit code 1;
       last 10 log lines:
       >                                                 source: archive:https://registry.npmjs.org/@esy-ocaml/substs/-/substs-0.0.1.tgz#sha1:59ebdbbaedcda123fc7ed8fb2b302b7d819e9a46
       >                                                 error: error: error running curl: 'curl' '--silent' '--connect-timeout' '60' '--retry' '3' '--retry-delay' '5' '--fail' '--location' 'https://registry.npmjs.org/@esy-ocaml/substs/-/substs-0.0.1.tgz' '--output' '/build/_esy/release/tmp/esy-1dc69d/archive' '--write-out' '\n%{http_code}':
       >                                                        code: 0
       >                                                        stderr:
       >
       >                                                          fetching dist: archive:https://registry.npmjs.org/@esy-ocaml/substs/-/substs-0.0.1.tgz#sha1:59ebdbbaedcda123fc7ed8fb2b302b7d819e9a46
       > error: installation error
       >   fetching @esy-ocaml/[email protected]
       > esy: exiting due to errors above
       > builder for '/nix/store/03xiy4f1115anvcinx6xfqqj0k3sc82x-oni2-fetch-deps.drv' failed with exit code 1
       For full logs, run 'nix log /nix/store/03xiy4f1115anvcinx6xfqqj0k3sc82x-oni2-fetch-deps.drv'.
error: 1 dependencies of derivation '/nix/store/iijrvcb1lfj9kxixdchs18r33ap2vsn6-oni2-0.5.7.drv' failed to build

@sefidel
Copy link
Member

sefidel commented Aug 30, 2021

that one might be the issue with my build machine (might)

  • Another error i got here:
error: hash mismatch in fixed-output derivation '/nix/store/03xiy4f1115anvcinx6xfqqj0k3sc82x-oni2-fetch-deps.drv':
         specified: sha256-k7G6jPJfxCCSuSucPfiXljCVJhmjl/BxWMCEjv2tfhA=
            got:    sha256-qxQ7Dznxqv6yqMaXyWqkCN8cwlU/BY8jL3HHF486OEw=
error: 1 dependencies of derivation '/nix/store/iijrvcb1lfj9kxixdchs18r33ap2vsn6-oni2-0.5.7.drv' failed to build

Copy link
Member

@sefidel sefidel left a comment

Choose a reason for hiding this comment

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

I think it'd be better to move the mkOni2 out of this file.
Maybe create a file like common.nix?

You might wanna check pkgs/applications/editors/sublime/4 for reference.

@sefidel
Copy link
Member

sefidel commented Aug 30, 2021

I think it'd be better to move the mkOni2 out of this file.
Maybe create a file like common.nix?

You might wanna check pkgs/applications/editors/sublime/4 for reference.

I have rewrote the derivation using this approach. (Proposed in a patch format since I was unable to commit to this PR)

Patch for this approach

diff --git a/pkgs/applications/editors/oni2/common.nix b/pkgs/applications/editors/oni2/common.nix
new file mode 100644
index 00000000000..ffaeabd0d54
--- /dev/null
+++ b/pkgs/applications/editors/oni2/common.nix
@@ -0,0 +1,295 @@
+{ variant, version, rev, sha256, fetchDepsSha256, license }:
+
+{ lib
+, stdenv
+, nodePackages
+  # Fetch dependencies
+, fetchFromGitHub
+, gitMinimal
+, curlMinimal
+, cacert
+, yarn
+, unzip
+, xorg
+, nodejs
+, ripgrep
+, fontconfig
+, libGL
+, libGLU
+, ncurses
+, acl
+, harfbuzz
+, libjpeg
+, expat
+, icu58
+, libpng
+  # Build
+, jq
+, perl
+, makeWrapper
+, bash
+, which
+, nasm
+, python
+, gn
+, ninja
+, cmake
+, clang
+, fixup_yarn_lock
+, callPackage
+}:
+let
+  source = fetchFromGitHub {
+    repo = variant;
+    owner = "onivim";
+    inherit rev sha256;
+  };
+
+  fetchDeps = stdenv.mkDerivation {
+    name = "oni2-fetch-deps";
+
+    patches = [
+      # Patch esy_skia builder to use nixpkgs ninja, gn tools and icu, expat and libpng libraries.
+      ./esy_skia_use_nixpkgs.patch
+    ];
+
+    unpackPhase = ''
+      cp ${source}/release.json ./
+      cp ${source}/package.json ./
+     cp -r ${source}/release.esy.lock ./
+     cp -r ${source}/node ./
+     cp -r ${source}/extensions ./
+     chmod -R +w node
+     chmod -R +w extensions
+   '';
+
+    nativeBuildInputs = [
+      jq
+      nodePackages.esy
+      gitMinimal
+      curlMinimal
+      cacert
+      python
+      perl
+      unzip
+      yarn
+    ];
+
+    buildPhase = ''
+     export ESY__PREFIX=$NIX_BUILD_TOP/esy
+     export ESY__GLOBAL_PATH=PATH
+
+     esy '@release' install
+
+     ln -s $NIX_BUILD_TOP/esy/source/i/ $NIX_BUILD_TOP/source
+
+     cd $NIX_BUILD_TOP/source
+     cd $(ls | grep "^esy_skia")
+
+     # Prefetch esy_skia pinned dependencies
+     # angle2, dng_sdk, piex and sfntly are unique and need to be fetched
+     # zlib and webp used here seem to be outdated, so it's impossible to link esy_skia against upstream zlib and webp
+     cat DEPS | grep -E '{|}|angle2|dng_sdk|piex|sfntly|zlib|webp' > DEPS-upd
+     mv DEPS{-upd,}
+     python tools/git-sync-deps
+
+     # Patch esy_skia builder to use nixpkgs ninja, gn tools and icu, expat and libpng libraries.
+     #cd esy
+     #patch build.sh ${./esy_skia_use_nixpkgs.patch}
+
+     cd $NIX_BUILD_TOP/source
+     cd $(ls | grep '^revery' | grep -v '__s__')
+     jq '.esy.build |= "bash -c \"\(.)\""' package.json > package-upd.json
+     mv package{-upd,}.json
+
+     # Delete esy_cmake and ninja dependencies (they are brought from Nixpkgs)
+     # Removing them from release.esy.lock is hard because it reports corruption
+     for d in "revery__s__esy_cmake" "ninja"
+     do
+         cd $NIX_BUILD_TOP/source
+         cd $(ls | grep $d)
+         rm -rf *
+     done
+
+     rm -rf $(find $NIX_BUILD_TOP/esy -name .git)
+   '';
+
+    installPhase = ''
+      mkdir $out
+      cp -r $NIX_BUILD_TOP/esy $out/
+    '';
+
+    dontPatchShebangs = true;
+
+    impureEnvVars = lib.fetchers.proxyImpureEnvVars;
+
+    outputHashMode = "recursive";
+    outputHashAlgo = "sha256";
+    outputHash = fetchDepsSha256;
+  };
+in
+stdenv.mkDerivation (rec {
+  pname = "oni2";
+  inherit version;
+
+  nativeBuildInputs = [
+    clang
+    makeWrapper
+    nodePackages.esy
+    bash
+    perl
+    which
+    nasm
+    python
+    gn
+    ninja
+    cmake
+    jq
+    yarn
+    fixup_yarn_lock
+  ];
+
+  buildInputs = [
+    nodejs
+    ripgrep
+    fontconfig
+    libGL
+    libGLU
+    ncurses
+    acl
+    harfbuzz
+    libjpeg
+    expat
+    icu58
+    libpng
+  ] ++ (with xorg; [
+    libX11
+    libXext
+    libXi
+    libXxf86vm
+    libXrandr
+    libXinerama
+    libXcursor
+    libICE
+    libSM
+    libXt
+    libxkbfile
+  ]);
+
+  unpackPhase = ''
+    cp -r ${source}/* ./
+    cp -r ${fetchDeps}/esy ./
+
+    chmod -R +w esy
+    chmod +w assets/configuration
+    chmod -R a+w node/
+    chmod -R a+w extensions/
+  '';
+
+  hardeningDisable = [ "fortify" ];
+
+  node = (callPackage ./node.nix { }).offline_cache;
+  extensions = (callPackage ./extensions.nix { }).offline_cache;
+
+  configurePhase = ''
+    runHook preConfigure
+
+    # Esy by default erases the entire environment, so the builder makes a wrapper over bash to automatically re-export it
+    mkdir wrapped-bash
+    set BASH $(which bash)
+    echo "#!$BASH" > wrapped-bash/bash
+    export | sed 's/PATH="/PATH="$PATH:/' >> wrapped-bash/bash
+    echo "exec $BASH \"\$@\"" >> wrapped-bash/bash
+    chmod +x wrapped-bash/bash
+
+    # Use custom builder for Oni2 to provide necessary environment to it
+    echo 'declare -x NIX_LDFLAGS="$NIX_LDFLAGS -lXext -lharfbuzz -ljpeg -lpthread -lpng -lexpat"' > build.sh
+    echo $(jq -r '.esy.build' package.json) >> build.sh
+    jq '.esy.build |= "bash build.sh"' package.json > package-upd.json
+    mv package{-upd,}.json
+
+    export PATH="$NIX_BUILD_TOP/wrapped-bash:$PATH"
+    patchShebangs $NIX_BUILD_TOP/esy/source
+
+    echo "" > assets/configuration/setup.json # it will be set at installation phase.
+
+    substituteInPlace src/gen_buildinfo/generator.re --replace "git rev-parse --short HEAD" "echo '${version}'"
+
+    runHook postConfigure
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+
+    # Required by yarn
+    export HOME=$NIX_BUILD_TOP/
+
+    # Install pinned yarn packages
+    yarnInstall() {
+      # Remove `resolutions` section from package.json
+      jq 'del(.resolutions)' $3/package.json > $3/package-upd.json
+      cp $3/package{-upd,}.json
+
+      # Copy custom yarn.lock to match updated package.json, do fixup
+      cp $2 $3/yarn.lock
+      fixup_yarn_lock $3/yarn.lock
+
+    # Make yarn install prefetched dependencies
+     yarn config --offline set yarn-offline-mirror $1
+     # Set explicit node install directory for node-gyp.
+     npm_config_nodedir=${nodejs} yarn install --frozen-lockfile --offline --no-progress --non-interactive --cwd $3
+    }
+    yarnInstall ${node} ${./node.lock} node
+    yarnInstall ${extensions} ${./extensions.lock} extensions
+
+    export ESY__PREFIX="$NIX_BUILD_TOP/esy"
+    esy '@release' install # should do nothing
+
+    export ESY__GLOBAL_PATH=PATH
+    # Create link to bin directory, currently empty
+    esy '@release' sh -c "ln -s \$cur__bin result"
+    # Finish building Oni2
+    esy '@release' x Oni2 --help
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir $out
+
+    cp -Lr ./result $out/bin
+    cp -r ./node $out/
+    cp -r ./extensions $out/
+
+    chmod +w $out/bin
+    chmod +x $out/bin/Oni2 $out/bin/Oni2_editor
+    # Unset LANG. See https://github.com/onivim/oni2/issues/3772
+    mv $out/bin/Oni2{,_unwrapped}
+    makeWrapper $out/bin/Oni2{_unwrapped,} --unset LANG
+    mv $out/bin/Oni2_editor{,_unwrapped}
+    makeWrapper $out/bin/Oni2_editor{_unwrapped,} --unset LANG
+
+    rm -f $out/bin/setup.json
+    jq -n "{node: \"${nodejs}/bin/node\", nodeScript: \"$out/node\", bundledExtensions: \"$out/extensions\", rg: \"${ripgrep}/bin/rg\"}" > $out/bin/setup.json
+
+    mkdir -p $out/share/applications $out/share/pixmaps
+    cp ${source}/scripts/linux/Onivim2.desktop $out/share/applications
+    cp ${source}/assets/images/icon512.png $out/share/pixmaps/Onivim2.png
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Native, lightweight modal code editor";
+    longDescription = ''
+      Onivim 2 is a reimagination of the Oni editor. Onivim 2 aims to bring the speed of Sublime, the language integration of VSCode, and the modal editing experience of Vim together, in a single package.
+    '';
+    homepage = "https://v2.onivim.io/";
+    inherit license;
+    maintainers = with maintainers; [ gardspirito ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+  };
+})
+
diff --git a/pkgs/applications/editors/oni2/default.nix b/pkgs/applications/editors/oni2/default.nix
deleted file mode 100644
index af80b11cc0d..00000000000
--- a/pkgs/applications/editors/oni2/default.nix
+++ /dev/null
@@ -1,273 +0,0 @@
-{ lib, stdenv
-, nodePackages
-# Fetch dependencies
-, fetchFromGitHub, gitMinimal, curlMinimal, cacert, yarn, unzip
-, xorg, nodejs, ripgrep, fontconfig, libGL, libGLU, ncurses, acl, harfbuzz, libjpeg, expat, icu58, libpng
-# Build
-, jq, perl, makeWrapper, bash, which, nasm, python, gn, ninja, cmake, clang, fixup_yarn_lock, callPackage
-}:
-
-let
-  mkOni2 = { variant, version, rev, sha256, fetchDepsSha256, license }:
-    let
-      source = fetchFromGitHub {
-        repo = variant;
-        owner = "onivim";
-        inherit rev sha256;
-      };
-
-      fetchDeps = stdenv.mkDerivation {
-        name = "oni2-fetch-deps";

@gardspirito
Copy link
Contributor Author

gardspirito commented Aug 30, 2021

Regarding your problem: it doesn't really seem like Oni2 actually supports Wayland (onivim/oni2#3438), but I guess there is way to get it working if nix-shell --pure works... maybe. Maybe not.

Could you please try unsetting $BROWSER, rm -rf ~/.config/oni2 and running applications again. In my case, it stuck in the infinite loop. I don't really know, why, but this seems to be somehow related.
I also wonder if nix-shell --pure clears all the "Wayland" stuff or not. Maybe worths comparing regular environment and pure environment with git diff.

... or I just can mark Oni2 as currently broken for wayland.
Does it work through xWayland?

@sefidel
Copy link
Member

sefidel commented Aug 30, 2021

It does remove all the environment variables that lets the program know I'm running under WL. Unsetting browser & removing the config didn't work.

Seems like it works fine on XWayland though.

p.s do you mind adding me as a co author in the commit where you added my patch?

@gardspirito
Copy link
Contributor Author

p.s do you mind adding me as a co author in the commit where you added my patch?
Sorry, for sure I will, but tomorrow. But I guess it will be removed from Nixpkgs history in case of squash, unfortunately...

It would be nice if you provided diff of regular environment and environment of pure shell. If you want to. I'm unsure whether I'll manage to do something or not, so that's completely up to you.

@sefidel
Copy link
Member

sefidel commented Aug 30, 2021

p.s do you mind adding me as a co author in the commit where you added my patch?
Sorry, for sure I will, but tomorrow. But I guess it will be removed from Nixpkgs history in case of squash, unfortunately...

It would be nice if you provided diff of regular environment and environment of pure shell. If you want to. I'm unsure whether I'll manage to do something or not, so that's completely up to you.

iirc squashed commit will still include credit for co authors.

Alright, give me like 10 minutes.

@gardspirito
Copy link
Contributor Author

I'm going to sleep, so no need to hurry. Thanks.

@sefidel
Copy link
Member

sefidel commented Aug 30, 2021

Alright. + Did you perhaps happen to apply only fraction of my patch?
I have edited them (3 files, afaik), which includes changes made for oni2-mit (made oni2Packages), which either you or I will package later. all I see is 2 files getting affected.
my bad, seems like I gave you the old version of the patch

env diff

--- env.orig	2021-08-30 15:38:16.651868454 -0700
+++ env.pure	2021-08-30 15:38:22.047841432 -0700
@@ -1,86 +1,76 @@
-GTK_PATH=/home/boppy/.nix-profile/lib/gtk-2.0:/home/boppy/.nix-profile/lib/gtk-3.0:/etc/profiles/per-user/boppy/lib/gtk-2.0:/etc/profiles/per-user/boppy/lib/gtk-3.0:/nix/var/nix/profiles/default/lib/gtk-2.0:/nix/var/nix/profiles/default/lib/gtk-3.0:/run/current-system/sw/lib/gtk-2.0:/run/current-system/sw/lib/gtk-3.0
-GTK_USE_PORTAL=1
-HOME=/home/boppy
-INFOPATH=/home/boppy/.nix-profile/info:/home/boppy/.nix-profile/share/info:/etc/profiles/per-user/boppy/info:/etc/profiles/per-user/boppy/share/info:/nix/var/nix/profiles/default/info:/nix/var/nix/profiles/default/share/info:/run/current-system/sw/info:/run/current-system/sw/share/info
-KDEDIRS=/home/boppy/.nix-profile:/etc/profiles/per-user/boppy:/nix/var/nix/profiles/default:/run/current-system/sw
-LANG=en_US.UTF-8
-LD_LIBRARY_PATH=/run/current-system/sw/lib/pipewire
-LIBEXEC_PATH=/home/boppy/.nix-profile/lib/libexec:/etc/profiles/per-user/boppy/lib/libexec:/nix/var/nix/profiles/default/lib/libexec:/run/current-system/sw/lib/libexec
-LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
-LOGNAME=boppy
-MOZ_PLUGIN_PATH=/home/boppy/.nix-profile/lib/mozilla/plugins:/etc/profiles/per-user/boppy/lib/mozilla/plugins:/nix/var/nix/profiles/default/lib/mozilla/plugins:/run/current-system/sw/lib/mozilla/plugins
-NIX_PATH=repl=/nix/store/j3p2n1cs0hjixmh1ksrfz529cg7kzjpb-source/repl.nix:nixpkgs=/nix/store/vl9nz77wrif10w5g5wxxavb9qsn32wy8-source:home-manager=/nix/store/4n0cpbrcd3jd5ag31ic1v12ag9mw9yzg-source
-PATH=/run/wrappers/bin:/home/boppy/.nix-profile/bin:/etc/profiles/per-user/boppy/bin:/nix/var/nix/profiles/default/bin:/run/current-system/sw/bin:/home/boppy/~/.config/zsh/plugins/fast-syntax-highlighting:/home/boppy/~/.config/zsh/plugins/doas:/home/boppy/.config/scripts:/home/boppy/.local/bin
-QTWEBKIT_PLUGIN_PATH=/home/boppy/.nix-profile/lib/mozilla/plugins/:/etc/profiles/per-user/boppy/lib/mozilla/plugins/:/nix/var/nix/profiles/default/lib/mozilla/plugins/:/run/current-system/sw/lib/mozilla/plugins/
-QT_PLUGIN_PATH=/home/boppy/.nix-profile/lib/qt4/plugins:/home/boppy/.nix-profile/lib/kde4/plugins:/etc/profiles/per-user/boppy/lib/qt4/plugins:/etc/profiles/per-user/boppy/lib/kde4/plugins:/nix/var/nix/profiles/default/lib/qt4/plugins:/nix/var/nix/profiles/default/lib/kde4/plugins:/run/current-system/sw/lib/qt4/plugins:/run/current-system/sw/lib/kde4/plugins
-SHELL=/run/current-system/sw/bin/zsh
-TERMINFO_DIRS=/home/boppy/.nix-profile/share/terminfo:/etc/profiles/per-user/boppy/share/terminfo:/nix/var/nix/profiles/default/share/terminfo:/run/current-system/sw/share/terminfo
-TZDIR=/etc/zoneinfo
-USER=boppy
-XCURSOR_PATH=/home/boppy/.icons:/home/boppy/.local/share/icons:/home/boppy/.nix-profile/share/icons:/home/boppy/.nix-profile/share/pixmaps:/etc/profiles/per-user/boppy/share/icons:/etc/profiles/per-user/boppy/share/pixmaps:/nix/var/nix/profiles/default/share/icons:/nix/var/nix/profiles/default/share/pixmaps:/run/current-system/sw/share/icons:/run/current-system/sw/share/pixmaps
-XDG_CONFIG_DIRS=/etc/xdg:/home/boppy/.nix-profile/etc/xdg:/etc/profiles/per-user/boppy/etc/xdg:/nix/var/nix/profiles/default/etc/xdg:/run/current-system/sw/etc/xdg
-XDG_DATA_DIRS=/nix/store/6kchd1j03vdrr3v18wajsblg7hgn4c91-sway-1.6.1/share:/nix/store/qvmdkg2f09pvlsdr4bqasyiy5g0mbvrd-gtk+3-3.24.30/share/gsettings-schemas/gtk+3-3.24.30:/nix/store/3iikkf41lhl0qmad4hgzsacigh7dy318-gsettings-desktop-schemas-40.0/share/gsettings-schemas/gsettings-desktop-schemas-40.0:/nix/store/2ap8r86b2cmwcj407m99j7awh42mka4z-desktops/share:/home/boppy/.nix-profile/share:/etc/profiles/per-user/boppy/share:/nix/var/nix/profiles/default/share:/run/current-system/sw/share
-XDG_DESKTOP_PORTAL_DIR=/nix/store/ymhgzgy6fw44741dcz68jbc4ignqcw1s-xdg-portals/share/xdg-desktop-portal/portals
-XDG_RUNTIME_DIR=/run/user/1000
-_JAVA_AWT_WM_NONREPARENTING=1
-LOCALE_ARCHIVE_2_27=/nix/store/y2lj3m0mv05pnn19v0i2323xqkmv4chq-glibc-locales-2.33-47/lib/locale/locale-archive
-CLUTTER_BACKEND=wayland
-DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus
+HOST_PATH=/nix/store/1570w56jrkvr90w9x158vyb5vahnk18v-coreutils-8.32/bin:/nix/store/ihxk2vlm0vi7c4j3gpm084kbxvz6v585-findutils-4.8.0/bin:/nix/store/kjx1mv85c5cgsrr4bwar22j7hbwj834m-diffutils-3.7/bin:/nix/store/gm2w08wwsa3vd500d8vq879s2lv65ldh-gnused-4.8/bin:/nix/store/v0slhpb2y3xa7gmv4q6gblkdk7n0f09j-gnugrep-3.6/bin:/nix/store/2wn093wbc6ps4brcsppxjd14vxvaa8a2-gawk-5.1.0/bin:/nix/store/5bxrjkyvqmzn1p897652y3lwa9fxagpw-gnutar-1.34/bin:/nix/store/liva1jnjdskrn57s42kfawr2zz66szzm-gzip-1.10/bin:/nix/store/ih2zkh2mbrx2c766ryk2i9hhlkly7snr-bzip2-1.0.6.0.2-bin/bin:/nix/store/pvkiiw0mp1yx0b21b7k105yywccychgh-gnumake-4.3/bin:/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin:/nix/store/aicl3kwfnaizk45aygm8bviqv7lk0a16-patch-2.7.6/bin:/nix/store/7jk6k46f56rszzc1bxi8mdrvcw53pym4-xz-5.2.5-bin/bin
+LS_COLORS=
+propagatedBuildInputs=
+stdenv=/nix/store/r4bl79l2bdjawmr2rhhqvci56qh0fkvv-stdenv-linux
+__ETC_PROFILE_SOURCED=1
 DISPLAY=:0
-ECORE_EVAS_ENGINE=wayland
-EDITOR=/nix/store/vfn14lfja5yz942v5zfyy36jcxbyn971-neovim-unwrapped-master/bin/nvim
-ELM_ENGINE=wayland
-GDK_PIXBUF_MODULE_FILE=/nix/store/7ids0vgrzwdlgaijg0ai7lqk1nnr5nly-librsvg-2.50.7/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
-GIO_EXTRA_MODULES=/nix/store/izvdqx4h01j7cxcaaa6fx9a3n7agyfsx-dconf-0.40.0-lib/lib/gio/modules:/nix/store/izvdqx4h01j7cxcaaa6fx9a3n7agyfsx-dconf-0.40.0-lib/lib/gio/modules:/nix/store/izvdqx4h01j7cxcaaa6fx9a3n7agyfsx-dconf-0.40.0-lib/lib/gio/modules
-GREETD_SOCK=/run/greetd-1638.sock
-GTK_IM_MODULE=kime
-I3SOCK=/run/user/1000/sway-ipc.1000.1769.sock
-JAVA_HOME=/nix/store/6rikzwr29lka7p7mndvany0pqgdjmv31-openjdk-16+36/lib/openjdk
-MOZ_ENABLE_WAYLAND=1
-NIXPKGS_CONFIG=/etc/nix/nixpkgs-config.nix
-NIX_PROFILES=/run/current-system/sw /nix/var/nix/profiles/default /etc/profiles/per-user/boppy /home/boppy/.nix-profile
-NIX_USER_PROFILE_DIR=/nix/var/nix/profiles/per-user/boppy
-NO_AT_BRIDGE=1
+out=/nix/store/bcaljb1zi43bpls2njpp49kz6bdkx2gg-shell
+CONFIG_SHELL=/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin/bash
+buildInputs=
+builder=/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin/bash
+CC=gcc
+READELF=readelf
+buildCommandPath=/tmp/nix-shell-3514-0/.attr-0
+USER=boppy
 PAGER=less -R
+STRIP=strip
+depsBuildTarget=
+OBJCOPY=objcopy
+NIX_CC_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1
+propagatedNativeBuildInputs=
+depsTargetTarget=
+system=x86_64-linux
 PWD=/mnt/data/contrib/nixpkgs-upstream
-QT_IM_MODULE=kime
-QT_QPA_PLATFORM=wayland
-QT_QPA_PLATFORMTHEME=qt5ct
-QT_WAYLAND_DISABLE_WINDOWDECORATION=1
-SDL_VIDEODRIVER=wayland
-SHLVL=2
-SSH_ASKPASS=
-SWAYSOCK=/run/user/1000/sway-ipc.1000.1769.sock
+HOME=/home/boppy
+TMP=/run/user/1000
+strictDeps=
+NIX_ENFORCE_NO_NATIVE=1
+XDG_DATA_DIRS=/nix/store/435paza0j48aa9vgvf6r2l12nrg4ld11-patchelf-0.12/share
+RANLIB=ranlib
+OBJDUMP=objdump
+HISTFILE=/home/boppy/.config/.bash_history
+AS=as
+AR=ar
+SSL_CERT_FILE=/no-cert-file.crt
+NIX_CC=/nix/store/4xs1xyj8728yvh9y5v6ji819kwgfy2fv-gcc-wrapper-10.3.0
+NIX_CFLAGS_COMPILE= -frandom-seed=bcaljb1zi4
+depsBuildBuild=
+NIX_STORE=/nix/store
+outputs=out
+configureFlags=
+TMPDIR=/run/user/1000
+name=shell
+doInstallCheck=
+doCheck=
+IN_NIX_SHELL=pure
+NIX_BINTOOLS=/nix/store/29bjq5hw1qglybp1a5f3ij9gxc2fyf94-binutils-wrapper-2.35.1
+NM=nm
+depsHostHostPropagated=
+CXX=g++
+depsBuildBuildPropagated=
+SHELL=/nix/store/w07a7k61dw5gnsyxj3kgcq3shr76jax8-bash-interactive-4.4-p23/bin/bash
 TERM=foot
-WAYLAND_DISPLAY=wayland-1
-XCURSOR_SIZE=24
-XDG_CURRENT_DESKTOP=sway
-XDG_SEAT=seat0
-XDG_SESSION_CLASS=user
-XDG_SESSION_DESKTOP=sway
-XDG_SESSION_ID=3
-XDG_SESSION_TYPE=wayland
-XDG_VTNR=1
-XMODIFIERS=@im=kime
-_=/run/current-system/sw/bin/env
-_SWAY_WRAPPER_ALREADY_EXECUTED=1
-__ETC_PROFILE_DONE=1
-__NIXOS_SET_ENVIRONMENT_DONE=1
-MANAGERPID=1753
-INVOCATION_ID=a3d02b3a59664dd897124ab7526c080b
-JOURNAL_STREAM=8:30793
-COLORTERM=truecolor
-OLDPWD=/home/boppy
-LS_COLORS=bd=38;5;68:ca=38;5;17:cd=38;5;113;1:di=38;5;30:do=38;5;127:ex=38;5;208;1:pi=38;5;126:fi=0:ln=target:mh=38;5;222;1:no=0:or=48;5;196;38;5;232;1:ow=38;5;220;1:sg=48;5;3;38;5;0:su=38;5;220;1;3;100;1:so=38;5;197:st=38;5;86;48;5;234:tw=48;5;235;38;5;139;3:*LS_COLORS=48;5;89;38;5;197;1;3;4;7:*README=38;5;220;1:*README.rst=38;5;220;1:*README.md=38;5;220;1:*LICENSE=38;5;220;1:*COPYING=38;5;220;1:*INSTALL=38;5;220;1:*COPYRIGHT=38;5;220;1:*AUTHORS=38;5;220;1:*HISTORY=38;5;220;1:*CONTRIBUTORS=38;5;220;1:*PATENTS=38;5;220;1:*VERSION=38;5;220;1:*NOTICE=38;5;220;1:*CHANGES=38;5;220;1:*.log=38;5;190:*.txt=38;5;253:*.adoc=38;5;184:*.asciidoc=38;5;184:*.etx=38;5;184:*.info=38;5;184:*.markdown=38;5;184:*.md=38;5;184:*.mkd=38;5;184:*.nfo=38;5;184:*.pod=38;5;184:*.rst=38;5;184:*.tex=38;5;184:*.textile=38;5;184:*.bib=38;5;178:*.json=38;5;178:*.jsonl=38;5;178:*.jsonnet=38;5;178:*.libsonnet=38;5;142:*.ndjson=38;5;178:*.msg=38;5;178:*.pgn=38;5;178:*.rss=38;5;178:*.xml=38;5;178:*.fxml=38;5;178:*.toml=38;5;178:*.yaml=38;5;178:*.yml=38;5;178:*.RData=38;5;178:*.rdata=38;5;178:*.xsd=38;5;178:*.dtd=38;5;178:*.sgml=38;5;178:*.rng=38;5;178:*.rnc=38;5;178:*.cbr=38;5;141:*.cbz=38;5;141:*.chm=38;5;141:*.djvu=38;5;141:*.pdf=38;5;141:*.PDF=38;5;141:*.mobi=38;5;141:*.epub=38;5;141:*.docm=38;5;111;4:*.doc=38;5;111:*.docx=38;5;111:*.odb=38;5;111:*.odt=38;5;111:*.rtf=38;5;111:*.odp=38;5;166:*.pps=38;5;166:*.ppt=38;5;166:*.pptx=38;5;166:*.ppts=38;5;166:*.pptxm=38;5;166;4:*.pptsm=38;5;166;4:*.csv=38;5;78:*.tsv=38;5;78:*.ods=38;5;112:*.xla=38;5;76:*.xls=38;5;112:*.xlsx=38;5;112:*.xlsxm=38;5;112;4:*.xltm=38;5;73;4:*.xltx=38;5;73:*.pages=38;5;111:*.numbers=38;5;112:*.key=38;5;166:*config=1:*cfg=1:*conf=1:*rc=1:*authorized_keys=1:*known_hosts=1:*.ini=1:*.plist=1:*.viminfo=1:*.pcf=1:*.psf=1:*.hidden-color-scheme=1:*.hidden-tmTheme=1:*.last-run=1:*.merged-ca-bundle=1:*.sublime-build=1:*.sublime-commands=1:*.sublime-keymap=1:*.sublime-settings=1:*.sublime-snippet=1:*.sublime-project=1:*.sublime-workspace=1:*.tmTheme=1:*.user-ca-bundle=1:*.epf=1:*.git=38;5;197:*.gitignore=38;5;240:*.gitattributes=38;5;240:*.gitmodules=38;5;240:*.awk=38;5;172:*.bash=38;5;172:*.bat=38;5;172:*.BAT=38;5;172:*.sed=38;5;172:*.sh=38;5;172:*.zsh=38;5;172:*.vim=38;5;172:*.kak=38;5;172:*.ahk=38;5;41:*.py=38;5;41:*.ipynb=38;5;41:*.rb=38;5;41:*.gemspec=38;5;41:*.pl=38;5;208:*.PL=38;5;160:*.t=38;5;114:*.msql=38;5;222:*.mysql=38;5;222:*.pgsql=38;5;222:*.sql=38;5;222:*.tcl=38;5;64;1:*.r=38;5;49:*.R=38;5;49:*.gs=38;5;81:*.clj=38;5;41:*.cljs=38;5;41:*.cljc=38;5;41:*.cljw=38;5;41:*.scala=38;5;41:*.sc=38;5;41:*.dart=38;5;51:*.asm=38;5;81:*.cl=38;5;81:*.lisp=38;5;81:*.rkt=38;5;81:*.lua=38;5;81:*.moon=38;5;81:*.c=38;5;81:*.C=38;5;81:*.h=38;5;110:*.H=38;5;110:*.tcc=38;5;110:*.c++=38;5;81:*.h++=38;5;110:*.hpp=38;5;110:*.hxx=38;5;110:*.ii=38;5;110:*.M=38;5;110:*.m=38;5;110:*.cc=38;5;81:*.cs=38;5;81:*.cp=38;5;81:*.cpp=38;5;81:*.cxx=38;5;81:*.cr=38;5;81:*.go=38;5;81:*.f=38;5;81:*.F=38;5;81:*.for=38;5;81:*.ftn=38;5;81:*.f90=38;5;81:*.F90=38;5;81:*.f95=38;5;81:*.F95=38;5;81:*.f03=38;5;81:*.F03=38;5;81:*.f08=38;5;81:*.F08=38;5;81:*.nim=38;5;81:*.nimble=38;5;81:*.s=38;5;110:*.S=38;5;110:*.rs=38;5;81:*.scpt=38;5;219:*.swift=38;5;219:*.sx=38;5;81:*.vala=38;5;81:*.vapi=38;5;81:*.hi=38;5;110:*.hs=38;5;81:*.lhs=38;5;81:*.agda=38;5;81:*.lagda=38;5;81:*.lagda.tex=38;5;81:*.lagda.rst=38;5;81:*.lagda.md=38;5;81:*.agdai=38;5;110:*.zig=38;5;81:*.v=38;5;81:*.pyc=38;5;240:*.tf=38;5;168:*.tfstate=38;5;168:*.tfvars=38;5;168:*.css=38;5;125;1:*.less=38;5;125;1:*.sass=38;5;125;1:*.scss=38;5;125;1:*.htm=38;5;125;1:*.html=38;5;125;1:*.jhtm=38;5;125;1:*.mht=38;5;125;1:*.eml=38;5;125;1:*.mustache=38;5;125;1:*.coffee=38;5;074;1:*.java=38;5;074;1:*.js=38;5;074;1:*.mjs=38;5;074;1:*.jsm=38;5;074;1:*.jsp=38;5;074;1:*.php=38;5;81:*.ctp=38;5;81:*.twig=38;5;81:*.vb=38;5;81:*.vba=38;5;81:*.vbs=38;5;81:*Dockerfile=38;5;155:*.dockerignore=38;5;240:*Makefile=38;5;155:*MANIFEST=38;5;243:*pm_to_blib=38;5;240:*.nix=38;5;155:*.dhall=38;5;178:*.rake=38;5;155:*.am=38;5;242:*.in=38;5;242:*.hin=38;5;242:*.scan=38;5;242:*.m4=38;5;242:*.old=38;5;242:*.out=38;5;242:*.SKIP=38;5;244:*.diff=48;5;197;38;5;232:*.patch=48;5;197;38;5;232;1:*.bmp=38;5;97:*.dicom=38;5;97:*.tiff=38;5;97:*.tif=38;5;97:*.TIFF=38;5;97:*.cdr=38;5;97:*.flif=38;5;97:*.gif=38;5;97:*.icns=38;5;97:*.ico=38;5;97:*.jpeg=38;5;97:*.JPG=38;5;97:*.jpg=38;5;97:*.nth=38;5;97:*.png=38;5;97:*.psd=38;5;97:*.pxd=38;5;97:*.pxm=38;5;97:*.xpm=38;5;97:*.webp=38;5;97:*.ai=38;5;99:*.eps=38;5;99:*.epsf=38;5;99:*.drw=38;5;99:*.ps=38;5;99:*.svg=38;5;99:*.avi=38;5;114:*.divx=38;5;114:*.IFO=38;5;114:*.m2v=38;5;114:*.m4v=38;5;114:*.mkv=38;5;114:*.MOV=38;5;114:*.mov=38;5;114:*.mp4=38;5;114:*.mpeg=38;5;114:*.mpg=38;5;114:*.ogm=38;5;114:*.rmvb=38;5;114:*.sample=38;5;114:*.wmv=38;5;114:*.3g2=38;5;115:*.3gp=38;5;115:*.gp3=38;5;115:*.webm=38;5;115:*.gp4=38;5;115:*.asf=38;5;115:*.flv=38;5;115:*.ts=38;5;115:*.ogv=38;5;115:*.f4v=38;5;115:*.VOB=38;5;115;1:*.vob=38;5;115;1:*.ass=38;5;117:*.srt=38;5;117:*.ssa=38;5;117:*.sub=38;5;117:*.sup=38;5;117:*.vtt=38;5;117:*.3ga=38;5;137;1:*.S3M=38;5;137;1:*.aac=38;5;137;1:*.amr=38;5;137;1:*.au=38;5;137;1:*.caf=38;5;137;1:*.dat=38;5;137;1:*.dts=38;5;137;1:*.fcm=38;5;137;1:*.m4a=38;5;137;1:*.mod=38;5;137;1:*.mp3=38;5;137;1:*.mp4a=38;5;137;1:*.oga=38;5;137;1:*.ogg=38;5;137;1:*.opus=38;5;137;1:*.s3m=38;5;137;1:*.sid=38;5;137;1:*.wma=38;5;137;1:*.ape=38;5;136;1:*.aiff=38;5;136;1:*.cda=38;5;136;1:*.flac=38;5;136;1:*.alac=38;5;136;1:*.mid=38;5;136;1:*.midi=38;5;136;1:*.pcm=38;5;136;1:*.wav=38;5;136;1:*.wv=38;5;136;1:*.wvc=38;5;136;1:*.afm=38;5;66:*.fon=38;5;66:*.fnt=38;5;66:*.pfb=38;5;66:*.pfm=38;5;66:*.ttf=38;5;66:*.otf=38;5;66:*.woff=38;5;66:*.woff2=38;5;66:*.PFA=38;5;66:*.pfa=38;5;66:*.7z=38;5;40:*.a=38;5;40:*.arj=38;5;40:*.bz2=38;5;40:*.cpio=38;5;40:*.gz=38;5;40:*.lrz=38;5;40:*.lz=38;5;40:*.lzma=38;5;40:*.lzo=38;5;40:*.rar=38;5;40:*.s7z=38;5;40:*.sz=38;5;40:*.tar=38;5;40:*.tgz=38;5;40:*.warc=38;5;40:*.WARC=38;5;40:*.xz=38;5;40:*.z=38;5;40:*.zip=38;5;40:*.zipx=38;5;40:*.zoo=38;5;40:*.zpaq=38;5;40:*.zst=38;5;40:*.zstd=38;5;40:*.zz=38;5;40:*.apk=38;5;215:*.ipa=38;5;215:*.deb=38;5;215:*.rpm=38;5;215:*.jad=38;5;215:*.jar=38;5;215:*.cab=38;5;215:*.pak=38;5;215:*.pk3=38;5;215:*.vdf=38;5;215:*.vpk=38;5;215:*.bsp=38;5;215:*.dmg=38;5;215:*.r[0-9]{0,2}=38;5;239:*.zx[0-9]{0,2}=38;5;239:*.z[0-9]{0,2}=38;5;239:*.part=38;5;239:*.iso=38;5;124:*.bin=38;5;124:*.nrg=38;5;124:*.qcow=38;5;124:*.sparseimage=38;5;124:*.toast=38;5;124:*.vcd=38;5;124:*.vmdk=38;5;124:*.accdb=38;5;60:*.accde=38;5;60:*.accdr=38;5;60:*.accdt=38;5;60:*.db=38;5;60:*.fmp12=38;5;60:*.fp7=38;5;60:*.localstorage=38;5;60:*.mdb=38;5;60:*.mde=38;5;60:*.sqlite=38;5;60:*.typelib=38;5;60:*.nc=38;5;60:*.pacnew=38;5;33:*.un~=38;5;241:*.orig=38;5;241:*.BUP=38;5;241:*.bak=38;5;241:*.o=38;5;241:*core=38;5;241:*.mdump=38;5;241:*.rlib=38;5;241:*.dll=38;5;241:*.swp=38;5;244:*.swo=38;5;244:*.tmp=38;5;244:*.sassc=38;5;244:*.pid=38;5;248:*.state=38;5;248:*lockfile=38;5;248:*lock=38;5;248:*.err=38;5;160;1:*.error=38;5;160;1:*.stderr=38;5;160;1:*.aria2=38;5;241:*.dump=38;5;241:*.stackdump=38;5;241:*.zcompdump=38;5;241:*.zwc=38;5;241:*.pcap=38;5;29:*.cap=38;5;29:*.dmp=38;5;29:*.DS_Store=38;5;239:*.localized=38;5;239:*.CFUserTextEncoding=38;5;239:*.allow=38;5;112:*.deny=38;5;196:*.service=38;5;45:*@.service=38;5;45:*.socket=38;5;45:*.swap=38;5;45:*.device=38;5;45:*.mount=38;5;45:*.automount=38;5;45:*.target=38;5;45:*.path=38;5;45:*.timer=38;5;45:*.snapshot=38;5;45:*.application=38;5;116:*.cue=38;5;116:*.description=38;5;116:*.directory=38;5;116:*.m3u=38;5;116:*.m3u8=38;5;116:*.md5=38;5;116:*.properties=38;5;116:*.sfv=38;5;116:*.theme=38;5;116:*.torrent=38;5;116:*.urlview=38;5;116:*.webloc=38;5;116:*.lnk=38;5;39:*CodeResources=38;5;239:*PkgInfo=38;5;239:*.nib=38;5;57:*.car=38;5;57:*.dylib=38;5;241:*.entitlements=1:*.pbxproj=1:*.strings=1:*.storyboard=38;5;196:*.xcconfig=1:*.xcsettings=1:*.xcuserstate=1:*.xcworkspacedata=1:*.xib=38;5;208:*.asc=38;5;192;3:*.bfe=38;5;192;3:*.enc=38;5;192;3:*.gpg=38;5;192;3:*.signature=38;5;192;3:*.sig=38;5;192;3:*.p12=38;5;192;3:*.pem=38;5;192;3:*.pgp=38;5;192;3:*.p7s=38;5;192;3:*id_dsa=38;5;192;3:*id_rsa=38;5;192;3:*id_ecdsa=38;5;192;3:*id_ed25519=38;5;192;3:*.32x=38;5;213:*.cdi=38;5;213:*.fm2=38;5;213:*.rom=38;5;213:*.sav=38;5;213:*.st=38;5;213:*.a00=38;5;213:*.a52=38;5;213:*.A64=38;5;213:*.a64=38;5;213:*.a78=38;5;213:*.adf=38;5;213:*.atr=38;5;213:*.gb=38;5;213:*.gba=38;5;213:*.gbc=38;5;213:*.gel=38;5;213:*.gg=38;5;213:*.ggl=38;5;213:*.ipk=38;5;213:*.j64=38;5;213:*.nds=38;5;213:*.nes=38;5;213:*.sms=38;5;213:*.8xp=38;5;121:*.8eu=38;5;121:*.82p=38;5;121:*.83p=38;5;121:*.8xe=38;5;121:*.stl=38;5;216:*.dwg=38;5;216:*.ply=38;5;216:*.wrl=38;5;216:*.pot=38;5;7:*.pcb=38;5;7:*.mm=38;5;7:*.gbr=38;5;7:*.scm=38;5;7:*.xcf=38;5;7:*.spl=38;5;7:*.Rproj=38;5;11:*.sis=38;5;7:*.1p=38;5;7:*.3p=38;5;7:*.cnc=38;5;7:*.def=38;5;7:*.ex=38;5;7:*.example=38;5;7:*.feature=38;5;7:*.ger=38;5;7:*.ics=38;5;7:*.map=38;5;7:*.mf=38;5;7:*.mfasl=38;5;7:*.mi=38;5;7:*.mtx=38;5;7:*.pc=38;5;7:*.pi=38;5;7:*.plt=38;5;7:*.pm=38;5;7:*.rdf=38;5;7:*.ru=38;5;7:*.sch=38;5;7:*.sty=38;5;7:*.sug=38;5;7:*.tdy=38;5;7:*.tfm=38;5;7:*.tfnt=38;5;7:*.tg=38;5;7:*.vcard=38;5;7:*.vcf=38;5;7:*.xln=38;5;7:*.iml=38;5;166:
-__HM_SESS_VARS_SOURCED=1
-BROWSER=
-GTK2_RC_FILES=/home/boppy/.gtkrc-2.0
-MANPAGER=/nix/store/vfn14lfja5yz942v5zfyy36jcxbyn971-neovim-unwrapped-master/bin/nvim +Man!
-RUSTUP_HOME=/home/boppy/.local/share/rustup
-XDG_CACHE_HOME=/home/boppy/.cache
-XDG_CONFIG_HOME=/home/boppy/.config
-XDG_DATA_HOME=/home/boppy/.local/share
-GPG_TTY=/dev/pts/0
-STARSHIP_SHELL=zsh
-STARSHIP_SESSION_KEY=1888289763159995
-GITHUB_TOKEN=CENSORED
+NIX_LDFLAGS=-rpath /nix/store/bcaljb1zi43bpls2njpp49kz6bdkx2gg-shell/lib64 -rpath /nix/store/bcaljb1zi43bpls2njpp49kz6bdkx2gg-shell/lib 
+TEMPDIR=/run/user/1000
+shell=/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin/bash
+NIX_BINTOOLS_WRAPPER_TARGET_HOST_x86_64_unknown_linux_gnu=1
+NIX_HARDENING_ENABLE=fortify stackprotector pic strictoverflow format relro bindnow
+NIX_INDENT_MAKE=1
+passAsFile=buildCommand
+NIX_SSL_CERT_FILE=/no-cert-file.crt
+SHLVL=3
+NIX_BUILD_CORES=16
+SOURCE_DATE_EPOCH=315532800
+TEMP=/run/user/1000
+STRINGS=strings
+LOGNAME=boppy
+depsHostHost=
+PATH=/nix/store/w07a7k61dw5gnsyxj3kgcq3shr76jax8-bash-interactive-4.4-p23/bin:/nix/store/435paza0j48aa9vgvf6r2l12nrg4ld11-patchelf-0.12/bin:/nix/store/4xs1xyj8728yvh9y5v6ji819kwgfy2fv-gcc-wrapper-10.3.0/bin:/nix/store/dlni53myj53kx20pi4yhm7p68lw17b07-gcc-10.3.0/bin:/nix/store/6z35qvn00xrjvaznv9kfy8xddbbdz4gl-glibc-2.33-47-bin/bin:/nix/store/1570w56jrkvr90w9x158vyb5vahnk18v-coreutils-8.32/bin:/nix/store/29bjq5hw1qglybp1a5f3ij9gxc2fyf94-binutils-wrapper-2.35.1/bin:/nix/store/v8imx1nvyz0hgvx9cbcmh6gp4ngw3ffj-binutils-2.35.1/bin:/nix/store/1570w56jrkvr90w9x158vyb5vahnk18v-coreutils-8.32/bin:/nix/store/ihxk2vlm0vi7c4j3gpm084kbxvz6v585-findutils-4.8.0/bin:/nix/store/kjx1mv85c5cgsrr4bwar22j7hbwj834m-diffutils-3.7/bin:/nix/store/gm2w08wwsa3vd500d8vq879s2lv65ldh-gnused-4.8/bin:/nix/store/v0slhpb2y3xa7gmv4q6gblkdk7n0f09j-gnugrep-3.6/bin:/nix/store/2wn093wbc6ps4brcsppxjd14vxvaa8a2-gawk-5.1.0/bin:/nix/store/5bxrjkyvqmzn1p897652y3lwa9fxagpw-gnutar-1.34/bin:/nix/store/liva1jnjdskrn57s42kfawr2zz66szzm-gzip-1.10/bin:/nix/store/ih2zkh2mbrx2c766ryk2i9hhlkly7snr-bzip2-1.0.6.0.2-bin/bin:/nix/store/pvkiiw0mp1yx0b21b7k105yywccychgh-gnumake-4.3/bin:/nix/store/dpjnjrqbgbm8a5wvi1hya01vd8wyvsq4-bash-4.4-p23/bin:/nix/store/aicl3kwfnaizk45aygm8bviqv7lk0a16-patch-2.7.6/bin:/nix/store/7jk6k46f56rszzc1bxi8mdrvcw53pym4-xz-5.2.5-bin/bin
+NIX_BUILD_TOP=/run/user/1000
+depsBuildTargetPropagated=
+SIZE=size
+nativeBuildInputs=
+LD=ld
+patches=
+depsTargetTargetPropagated=
+_=/nix/store/1570w56jrkvr90w9x158vyb5vahnk18v-coreutils-8.32/bin/env

@sefidel
Copy link
Member

sefidel commented Aug 30, 2021

Latest version of the patch (make sure to check the contents!)

Patch

From 0efd9b48dbc985dddd557b27ca10f7cf195acd94 Mon Sep 17 00:00:00 2001
From: Zack A <[email protected]>
Date: Mon, 30 Aug 2021 08:29:12 -0700
Subject: [PATCH] oni2: commons & packages approach

---
 pkgs/applications/editors/oni2/common.nix     | 295 ++++++++++++++++++
 pkgs/applications/editors/oni2/default.nix    | 273 ----------------
 .../editors/oni2/esy_skia_use_nixpkgs.patch   |   6 +-
 pkgs/applications/editors/oni2/packages.nix   |  20 ++
 pkgs/top-level/all-packages.nix               |   4 +-
 5 files changed, 321 insertions(+), 277 deletions(-)
 create mode 100644 pkgs/applications/editors/oni2/common.nix
 delete mode 100644 pkgs/applications/editors/oni2/default.nix
 create mode 100644 pkgs/applications/editors/oni2/packages.nix

diff --git a/pkgs/applications/editors/oni2/common.nix b/pkgs/applications/editors/oni2/common.nix
new file mode 100644
index 00000000000..ffaeabd0d54
--- /dev/null
+++ b/pkgs/applications/editors/oni2/common.nix
@@ -0,0 +1,295 @@
+{ variant, version, rev, sha256, fetchDepsSha256, license }:
+
+{ lib
+, stdenv
+, nodePackages
+  # Fetch dependencies
+, fetchFromGitHub
+, gitMinimal
+, curlMinimal
+, cacert
+, yarn
+, unzip
+, xorg
+, nodejs
+, ripgrep
+, fontconfig
+, libGL
+, libGLU
+, ncurses
+, acl
+, harfbuzz
+, libjpeg
+, expat
+, icu58
+, libpng
+  # Build
+, jq
+, perl
+, makeWrapper
+, bash
+, which
+, nasm
+, python
+, gn
+, ninja
+, cmake
+, clang
+, fixup_yarn_lock
+, callPackage
+}:
+let
+  source = fetchFromGitHub {
+    repo = variant;
+    owner = "onivim";
+    inherit rev sha256;
+  };
+
+  fetchDeps = stdenv.mkDerivation {
+    name = "oni2-fetch-deps";
+
+    patches = [
+      # Patch esy_skia builder to use nixpkgs ninja, gn tools and icu, expat and libpng libraries.
+      ./esy_skia_use_nixpkgs.patch
+    ];
+
+    unpackPhase = ''
+      cp ${source}/release.json ./
+      cp ${source}/package.json ./
+      cp -r ${source}/release.esy.lock ./
+      cp -r ${source}/node ./
+      cp -r ${source}/extensions ./
+      chmod -R +w node
+      chmod -R +w extensions
+    '';
+
+    nativeBuildInputs = [
+      jq
+      nodePackages.esy
+      gitMinimal
+      curlMinimal
+      cacert
+      python
+      perl
+      unzip
+      yarn
+    ];
+
+    buildPhase = ''
+      export ESY__PREFIX=$NIX_BUILD_TOP/esy
+      export ESY__GLOBAL_PATH=PATH
+
+      esy '@release' install
+
+      ln -s $NIX_BUILD_TOP/esy/source/i/ $NIX_BUILD_TOP/source
+
+      cd $NIX_BUILD_TOP/source
+      cd $(ls | grep "^esy_skia")
+ 
+      # Prefetch esy_skia pinned dependencies
+      # angle2, dng_sdk, piex and sfntly are unique and need to be fetched
+      # zlib and webp used here seem to be outdated, so it's impossible to link esy_skia against upstream zlib and webp
+      cat DEPS | grep -E '{|}|angle2|dng_sdk|piex|sfntly|zlib|webp' > DEPS-upd
+      mv DEPS{-upd,}
+      python tools/git-sync-deps
+ 
+      # Patch esy_skia builder to use nixpkgs ninja, gn tools and icu, expat and libpng libraries.
+      #cd esy
+      #patch build.sh ${./esy_skia_use_nixpkgs.patch}
+ 
+      cd $NIX_BUILD_TOP/source
+      cd $(ls | grep '^revery' | grep -v '__s__')
+      jq '.esy.build |= "bash -c \"\(.)\""' package.json > package-upd.json
+      mv package{-upd,}.json
+
+      # Delete esy_cmake and ninja dependencies (they are brought from Nixpkgs)
+      # Removing them from release.esy.lock is hard because it reports corruption
+      for d in "revery__s__esy_cmake" "ninja"
+      do
+          cd $NIX_BUILD_TOP/source
+          cd $(ls | grep $d)
+          rm -rf *
+      done
+ 
+      rm -rf $(find $NIX_BUILD_TOP/esy -name .git)
+    '';
+
+    installPhase = ''
+      mkdir $out
+      cp -r $NIX_BUILD_TOP/esy $out/
+    '';
+
+    dontPatchShebangs = true;
+
+    impureEnvVars = lib.fetchers.proxyImpureEnvVars;
+
+    outputHashMode = "recursive";
+    outputHashAlgo = "sha256";
+    outputHash = fetchDepsSha256;
+  };
+in
+stdenv.mkDerivation (rec {
+  pname = "oni2";
+  inherit version;
+
+  nativeBuildInputs = [
+    clang
+    makeWrapper
+    nodePackages.esy
+    bash
+    perl
+    which
+    nasm
+    python
+    gn
+    ninja
+    cmake
+    jq
+    yarn
+    fixup_yarn_lock
+  ];
+
+  buildInputs = [
+    nodejs
+    ripgrep
+    fontconfig
+    libGL
+    libGLU
+    ncurses
+    acl
+    harfbuzz
+    libjpeg
+    expat
+    icu58
+    libpng
+  ] ++ (with xorg; [
+    libX11
+    libXext
+    libXi
+    libXxf86vm
+    libXrandr
+    libXinerama
+    libXcursor
+    libICE
+    libSM
+    libXt
+    libxkbfile
+  ]);
+
+  unpackPhase = ''
+    cp -r ${source}/* ./
+    cp -r ${fetchDeps}/esy ./
+
+    chmod -R +w esy
+    chmod +w assets/configuration
+    chmod -R a+w node/
+    chmod -R a+w extensions/
+  '';
+
+  hardeningDisable = [ "fortify" ];
+
+  node = (callPackage ./node.nix { }).offline_cache;
+  extensions = (callPackage ./extensions.nix { }).offline_cache;
+
+  configurePhase = ''
+    runHook preConfigure
+
+    # Esy by default erases the entire environment, so the builder makes a wrapper over bash to automatically re-export it
+    mkdir wrapped-bash
+    set BASH $(which bash)
+    echo "#!$BASH" > wrapped-bash/bash
+    export | sed 's/PATH="/PATH="$PATH:/' >> wrapped-bash/bash
+    echo "exec $BASH \"\$@\"" >> wrapped-bash/bash
+    chmod +x wrapped-bash/bash
+
+    # Use custom builder for Oni2 to provide necessary environment to it
+    echo 'declare -x NIX_LDFLAGS="$NIX_LDFLAGS -lXext -lharfbuzz -ljpeg -lpthread -lpng -lexpat"' > build.sh
+    echo $(jq -r '.esy.build' package.json) >> build.sh
+    jq '.esy.build |= "bash build.sh"' package.json > package-upd.json
+    mv package{-upd,}.json
+
+    export PATH="$NIX_BUILD_TOP/wrapped-bash:$PATH"
+    patchShebangs $NIX_BUILD_TOP/esy/source
+
+    echo "" > assets/configuration/setup.json # it will be set at installation phase.
+
+    substituteInPlace src/gen_buildinfo/generator.re --replace "git rev-parse --short HEAD" "echo '${version}'"
+
+    runHook postConfigure
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+
+    # Required by yarn
+    export HOME=$NIX_BUILD_TOP/
+
+    # Install pinned yarn packages
+    yarnInstall() {
+      # Remove `resolutions` section from package.json
+      jq 'del(.resolutions)' $3/package.json > $3/package-upd.json
+      cp $3/package{-upd,}.json
+
+      # Copy custom yarn.lock to match updated package.json, do fixup
+      cp $2 $3/yarn.lock
+      fixup_yarn_lock $3/yarn.lock
+
+    # Make yarn install prefetched dependencies
+     yarn config --offline set yarn-offline-mirror $1
+     # Set explicit node install directory for node-gyp.
+     npm_config_nodedir=${nodejs} yarn install --frozen-lockfile --offline --no-progress --non-interactive --cwd $3
+    }
+    yarnInstall ${node} ${./node.lock} node
+    yarnInstall ${extensions} ${./extensions.lock} extensions
+
+    export ESY__PREFIX="$NIX_BUILD_TOP/esy"
+    esy '@release' install # should do nothing
+
+    export ESY__GLOBAL_PATH=PATH
+    # Create link to bin directory, currently empty
+    esy '@release' sh -c "ln -s \$cur__bin result"
+    # Finish building Oni2
+    esy '@release' x Oni2 --help
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir $out
+
+    cp -Lr ./result $out/bin
+    cp -r ./node $out/
+    cp -r ./extensions $out/
+
+    chmod +w $out/bin
+    chmod +x $out/bin/Oni2 $out/bin/Oni2_editor
+    # Unset LANG. See https://github.com/onivim/oni2/issues/3772
+    mv $out/bin/Oni2{,_unwrapped}
+    makeWrapper $out/bin/Oni2{_unwrapped,} --unset LANG
+    mv $out/bin/Oni2_editor{,_unwrapped}
+    makeWrapper $out/bin/Oni2_editor{_unwrapped,} --unset LANG
+
+    rm -f $out/bin/setup.json
+    jq -n "{node: \"${nodejs}/bin/node\", nodeScript: \"$out/node\", bundledExtensions: \"$out/extensions\", rg: \"${ripgrep}/bin/rg\"}" > $out/bin/setup.json
+
+    mkdir -p $out/share/applications $out/share/pixmaps
+    cp ${source}/scripts/linux/Onivim2.desktop $out/share/applications
+    cp ${source}/assets/images/icon512.png $out/share/pixmaps/Onivim2.png
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Native, lightweight modal code editor";
+    longDescription = ''
+      Onivim 2 is a reimagination of the Oni editor. Onivim 2 aims to bring the speed of Sublime, the language integration of VSCode, and the modal editing experience of Vim together, in a single package.
+    '';
+    homepage = "https://v2.onivim.io/";
+    inherit license;
+    maintainers = with maintainers; [ gardspirito ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+  };
+})
+
diff --git a/pkgs/applications/editors/oni2/default.nix b/pkgs/applications/editors/oni2/default.nix
deleted file mode 100644
index af80b11cc0d..00000000000
--- a/pkgs/applications/editors/oni2/default.nix
+++ /dev/null
@@ -1,273 +0,0 @@
-{ lib, stdenv
-, nodePackages
-# Fetch dependencies
-, fetchFromGitHub, gitMinimal, curlMinimal, cacert, yarn, unzip
-, xorg, nodejs, ripgrep, fontconfig, libGL, libGLU, ncurses, acl, harfbuzz, libjpeg, expat, icu58, libpng
-# Build
-, jq, perl, makeWrapper, bash, which, nasm, python, gn, ninja, cmake, clang, fixup_yarn_lock, callPackage
-}:
-
-let
-  mkOni2 = { variant, version, rev, sha256, fetchDepsSha256, license }:
-    let
-      source = fetchFromGitHub {
-        repo = variant;
-        owner = "onivim";
-        inherit rev sha256;
-      };
-
-      fetchDeps = stdenv.mkDerivation {
-        name = "oni2-fetch-deps";
-
-        unpackPhase = ''
-          cp ${source}/release.json ./
-          cp ${source}/package.json ./
-          cp -r ${source}/release.esy.lock ./
-          cp -r ${source}/node ./
-          cp -r ${source}/extensions ./
-          chmod -R +w node
-          chmod -R +w extensions
-        '';
-
-        nativeBuildInputs = [
-          jq
-          nodePackages.esy
-          gitMinimal
-          curlMinimal
-          cacert
-          python
-          perl
-          unzip
-          yarn
-        ];
-
-        buildPhase = ''
-          export ESY__PREFIX=$NIX_BUILD_TOP/esy
-          export ESY__GLOBAL_PATH=PATH
-
-          esy '@release' install
-
-          ln -s $NIX_BUILD_TOP/esy/source/i/ $NIX_BUILD_TOP/source
-
-          cd $NIX_BUILD_TOP/source
-          cd $(ls | grep "^esy_skia")
-
-          # Prefetch esy_skia pinned dependencies
-          # angle2, dng_sdk, piex and sfntly are unique and need to be fetched
-          # zlib and webp used here seem to be outdated, so it's impossible to link esy_skia against upstream zlib and webp
-          cat DEPS | grep -E '{|}|angle2|dng_sdk|piex|sfntly|zlib|webp' > DEPS-upd
-          mv DEPS{-upd,}
-          python tools/git-sync-deps
-
-          # Patch esy_skia builder to use nixpkgs ninja, gn tools and icu, expat and libpng libraries.
-          cd esy
-          patch build.sh ${./esy_skia_use_nixpkgs.patch}
-
-          cd $NIX_BUILD_TOP/source
-          cd $(ls | grep '^revery' | grep -v '__s__')
-          jq '.esy.build |= "bash -c \"\(.)\""' package.json > package-upd.json
-          mv package{-upd,}.json
-
-          # Delete esy_cmake and ninja dependencies (they are brought from Nixpkgs)
-          # Removing them from release.esy.lock is hard because it reports corruption
-          for d in "revery__s__esy_cmake" "ninja"
-          do
-              cd $NIX_BUILD_TOP/source
-              cd $(ls | grep $d)
-              rm -rf *
-          done
-
-          rm -rf $(find $NIX_BUILD_TOP/esy -name .git)
-        '';
-
-        installPhase = ''
-          mkdir $out
-          cp -r $NIX_BUILD_TOP/esy $out/
-        '';
-
-        dontPatchShebangs = true;
-
-        impureEnvVars = lib.fetchers.proxyImpureEnvVars;
-
-        outputHashMode = "recursive";
-        outputHashAlgo = "sha256";
-        outputHash = fetchDepsSha256;
-      };
-    in stdenv.mkDerivation rec {
-      pname = "oni2";
-      inherit version;
-
-      nativeBuildInputs = [
-        clang
-        makeWrapper
-        nodePackages.esy
-        bash
-        perl
-        which
-        nasm
-        python
-        gn
-        ninja
-        cmake
-        jq
-        yarn
-        fixup_yarn_lock
-      ];
-
-      buildInputs = [
-        nodejs
-        ripgrep
-        fontconfig
-        libGL
-        libGLU
-        ncurses
-        acl
-        harfbuzz
-        libjpeg
-        expat
-        icu58
-        libpng
-      ] ++ (with xorg; [
-        libX11
-        libXext
-        libXi
-        libXxf86vm
-        libXrandr
-        libXinerama
-        libXcursor
-        libICE
-        libSM
-        libXt
-        libxkbfile
-      ]);
-
-      unpackPhase = ''
-        cp -r ${source}/* ./
-        cp -r ${fetchDeps}/esy ./
-
-        chmod -R +w esy
-        chmod +w assets/configuration
-        chmod -R a+w node/
-        chmod -R a+w extensions/
-      '';
-
-      hardeningDisable = [ "fortify" ];
-
-      node = (callPackage ./node.nix { }).offline_cache;
-      extensions = (callPackage ./extensions.nix { }).offline_cache;
-
-      configurePhase = ''
-        runHook preConfigure
-
-        # Esy by default erases the entire environment, so the builder makes a wrapper over bash to automatically re-export it
-        mkdir wrapped-bash
-        set BASH $(which bash)
-        echo "#!$BASH" > wrapped-bash/bash
-        export | sed 's/PATH="/PATH="$PATH:/' >> wrapped-bash/bash
-        echo "exec $BASH \"\$@\"" >> wrapped-bash/bash
-        chmod +x wrapped-bash/bash
-
-        # Use custom builder for Oni2 to provide necessary environment to it
-        echo 'declare -x NIX_LDFLAGS="$NIX_LDFLAGS -lXext -lharfbuzz -ljpeg -lpthread -lpng -lexpat"' > build.sh
-        echo $(jq -r '.esy.build' package.json) >> build.sh
-        jq '.esy.build |= "bash build.sh"' package.json > package-upd.json
-        mv package{-upd,}.json
-
-        export PATH="$NIX_BUILD_TOP/wrapped-bash:$PATH"
-        patchShebangs $NIX_BUILD_TOP/esy/source
-
-        echo "" > assets/configuration/setup.json # it will be set at installation phase.
-
-        substituteInPlace src/gen_buildinfo/generator.re --replace "git rev-parse --short HEAD" "echo '${version}'"
-
-        runHook postConfigure
-      '';
-
-      buildPhase = ''
-        runHook preBuild
-
-        # Required by yarn
-        export HOME=$NIX_BUILD_TOP/
-
-        # Install pinned yarn packages
-        yarnInstall() {
-          # Remove `resolutions` section from package.json
-          jq 'del(.resolutions)' $3/package.json > $3/package-upd.json
-          cp $3/package{-upd,}.json
-
-          # Copy custom yarn.lock to match updated package.json, do fixup
-          cp $2 $3/yarn.lock
-          fixup_yarn_lock $3/yarn.lock
-
-          # Make yarn install prefetched dependencies
-          yarn config --offline set yarn-offline-mirror $1
-          # Set explicit node install directory for node-gyp.
-          npm_config_nodedir=${nodejs} yarn install --frozen-lockfile --offline --no-progress --non-interactive --cwd $3
-        }
-        yarnInstall ${node} ${./node.lock} node
-        yarnInstall ${extensions} ${./extensions.lock} extensions
-
-        export ESY__PREFIX="$NIX_BUILD_TOP/esy"
-        esy '@release' install # should do nothing
-
-        export ESY__GLOBAL_PATH=PATH
-        # Create link to bin directory, currently empty
-        esy '@release' sh -c "ln -s \$cur__bin result"
-        # Finish building Oni2
-        esy '@release' x Oni2 --help
-
-        runHook postBuild
-      '';
-
-      installPhase = ''
-        runHook preInstall
-
-        mkdir $out
-
-        cp -Lr ./result $out/bin
-        cp -r ./node $out/
-        cp -r ./extensions $out/
-
-        chmod +w $out/bin
-        chmod +x $out/bin/Oni2 $out/bin/Oni2_editor
-        # Unset LANG. See https://github.com/onivim/oni2/issues/3772
-        mv $out/bin/Oni2{,_unwrapped}
-        makeWrapper $out/bin/Oni2{_unwrapped,} --unset LANG
-        mv $out/bin/Oni2_editor{,_unwrapped}
-        makeWrapper $out/bin/Oni2_editor{_unwrapped,} --unset LANG
-
-        rm -f $out/bin/setup.json
-        jq -n "{node: \"${nodejs}/bin/node\", nodeScript: \"$out/node\", bundledExtensions: \"$out/extensions\", rg: \"${ripgrep}/bin/rg\"}" > $out/bin/setup.json
-
-        mkdir -p $out/share/applications $out/share/pixmaps
-        cp ${source}/scripts/linux/Onivim2.desktop $out/share/applications
-        cp ${source}/assets/images/icon512.png $out/share/pixmaps/Onivim2.png
-
-        runHook postInstall
-      '';
-
-      meta = with lib; {
-        description = "Native, lightweight modal code editor";
-        longDescription = ''
-          Onivim 2 is a reimagination of the Oni editor. Onivim 2 aims to bring the speed of Sublime, the language integration of VSCode, and the modal editing experience of Vim together, in a single package.
-        '';
-        homepage = "https://v2.onivim.io/";
-        inherit license;
-        maintainers = with maintainers; [ gardspirito ];
-        platforms =
-          [ "x86_64-linux" "x86_64-darwin" ];
-      };
-    };
-in mkOni2 {
-  variant = "oni2";
-  license = {
-    fullName = "Outrun Labs End User License Agreement";
-    url =
-      "https://github.com/onivim/oni2/blob/master/Outrun-Labs-EULA-v1.1.md";
-    free = false;
-  };
-  version = "0.5.7";
-  rev = "v0.5.7";
-  sha256 = "NlN0Ntdwtx5XLjd1ltUzv/bjmJQR5eyRqtmicppP6YU=";
-  fetchDepsSha256 = "k7G6jPJfxCCSuSucPfiXljCVJhmjl/BxWMCEjv2tfhA=";
-}
diff --git a/pkgs/applications/editors/oni2/esy_skia_use_nixpkgs.patch b/pkgs/applications/editors/oni2/esy_skia_use_nixpkgs.patch
index 50a1802816c..49f49c34d6e 100644
--- a/pkgs/applications/editors/oni2/esy_skia_use_nixpkgs.patch
+++ b/pkgs/applications/editors/oni2/esy_skia_use_nixpkgs.patch
@@ -1,7 +1,7 @@
-diff --git a/build-or.sh b/build.sh
+diff --git a/esy/build-or.sh b/esy/build.sh
 index be0bc6f..fddc9cb 100644
---- a/build-or.sh
-+++ b/build.sh
+--- a/esy/build-or.sh
++++ b/esy/build.sh
 @@ -50,6 +50,6 @@ else
          echo "llvm toolset-7.0 does not need to be manually activated"
      fi
diff --git a/pkgs/applications/editors/oni2/packages.nix b/pkgs/applications/editors/oni2/packages.nix
new file mode 100644
index 00000000000..f1f149af9b5
--- /dev/null
+++ b/pkgs/applications/editors/oni2/packages.nix
@@ -0,0 +1,20 @@
+{ callPackage }:
+
+let
+  mkOni2 = opts: callPackage (import ./common.nix opts);
+in
+{
+  oni2 = mkOni2 {
+    variant = "oni2";
+    license = {
+      fullName = "Outrun Labs End User License Agreement";
+      url =
+        "https://github.com/onivim/oni2/blob/master/Outrun-Labs-EULA-v1.1.md";
+        free = false;
+    };
+    version = "0.5.7";
+    rev = "v0.5.7";
+    sha256 = "NlN0Ntdwtx5XLjd1ltUzv/bjmJQR5eyRqtmicppP6YU=";
+    fetchDepsSha256 = "k7G6jPJfxCCSuSucPfiXljCVJhmjl/BxWMCEjv2tfhA=";
+  } {};
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ab9739b64cc..ea8c765deb0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3199,7 +3199,9 @@ with pkgs;
 
   optar = callPackage ../tools/graphics/optar {};
 
-  oni2 = callPackage ../applications/editors/oni2 { };
+  oni2Packages = recurseIntoAttrs (callPackage ../applications/editors/oni2/packages.nix { });
+
+  oni2 = oni2Packages.oni2;
 
   obinskit = callPackage ../applications/misc/obinskit {};
 
-- 
2.32.0

@gardspirito
Copy link
Contributor Author

First of all, sorry for not responding. I thought I will get a notification.
Secondly, I'm noob, why do we need recurseIntoAttrs here if module itself doesn't get exported into all_packages? I couldn't find any documentation about this method so I don't really understand it's behaviour, but it just adds additional field in the attrset which will get instantly thrown by inherit, won't it?
And, again about Wayland. I've digged through Nixpkgs and found out that usually they set QT_QPA_PLATFORM=xcb to fix Wayland failures. Can you check if this helps? Or maybe I should just try installing Sway in the VM...

@sefidel
Copy link
Member

sefidel commented Sep 3, 2021

Weird, you should've received some notifications through email.

Setting the variable didn't work.

  • I have tested this package on the other machine, and applied some changes including removing the recurseIntoAttrs. This is the patch-all diff since f38c09d (the init commit). How's this?
diff

diff --git a/pkgs/applications/editors/oni2/common.nix b/pkgs/applications/editors/oni2/common.nix
new file mode 100644
index 00000000000..1759c30f07d
--- /dev/null
+++ b/pkgs/applications/editors/oni2/common.nix
@@ -0,0 +1,290 @@
+{ variant, version, rev, sha256, fetchDepsSha256, license }:
+
+{ lib
+, stdenv
+, nodePackages
+  # Fetch dependencies
+, fetchFromGitHub
+, gitMinimal
+, curlMinimal
+, cacert
+, yarn
+, unzip
+, xorg
+, nodejs
+, ripgrep
+, fontconfig
+, libGL
+, libGLU
+, ncurses
+, acl
+, harfbuzz
+, libjpeg
+, expat
+, icu58
+, libpng
+  # Build
+, jq
+, perl
+, makeWrapper
+, bash
+, which
+, nasm
+, python
+, gn
+, ninja
+, cmake
+, clang
+, fixup_yarn_lock
+, callPackage
+}:
+let
+  source = fetchFromGitHub {
+    repo = variant;
+    owner = "onivim";
+    inherit rev sha256;
+  };
+
+  fetchDeps = stdenv.mkDerivation {
+    name = "oni2-fetch-deps";
+
+    unpackPhase = ''
+      cp ${source}/release.json ./
+      cp ${source}/package.json ./
+      cp -r ${source}/release.esy.lock ./
+      cp -r ${source}/node ./
+      cp -r ${source}/extensions ./
+      chmod -R +w node
+      chmod -R +w extensions
+    '';
+
+    nativeBuildInputs = [
+      jq
+      nodePackages.esy
+      gitMinimal
+      curlMinimal
+      cacert
+      python
+      perl
+      unzip
+      yarn
+    ];
+
+    buildPhase = ''
+      export ESY__PREFIX=$NIX_BUILD_TOP/esy
+      export ESY__GLOBAL_PATH=PATH
+
+      esy '@release' install
+
+      ln -s $NIX_BUILD_TOP/esy/source/i/ $NIX_BUILD_TOP/source
+
+      cd $NIX_BUILD_TOP/source
+      cd $(ls | grep "^esy_skia")
+
+      # Prefetch esy_skia pinned dependencies
+      # angle2, dng_sdk, piex and sfntly are unique and need to be fetched
+      # zlib and webp used here seem to be outdated, so it's impossible to link esy_skia against upstream zlib and webp
+      cat DEPS | grep -E '{|}|angle2|dng_sdk|piex|sfntly|zlib|webp' > DEPS-upd
+      mv DEPS{-upd,}
+      python tools/git-sync-deps
+
+      # Patch esy_skia builder to use nixpkgs ninja, gn tools and icu, expat and libpng libraries.
+      cd esy
+      patch build.sh ${./esy_skia_use_nixpkgs.patch}
+
+      cd $NIX_BUILD_TOP/source
+      cd $(ls | grep '^revery' | grep -v '__s__')
+      jq '.esy.build |= "bash -c \"\(.)\""' package.json > package-upd.json
+      mv package{-upd,}.json
+
+      # Delete esy_cmake and ninja dependencies (they are brought from Nixpkgs)
+      # Removing them from release.esy.lock is hard because it reports corruption
+      for d in "revery__s__esy_cmake" "ninja"
+      do
+          cd $NIX_BUILD_TOP/source
+          cd $(ls | grep $d)
+          rm -rf *
+      done
+
+      rm -rf $(find $NIX_BUILD_TOP/esy -name .git)
+    '';
+
+    installPhase = ''
+      mkdir $out
+      cp -r $NIX_BUILD_TOP/esy $out/
+    '';
+
+    dontPatchShebangs = true;
+
+    impureEnvVars = lib.fetchers.proxyImpureEnvVars;
+
+    outputHashMode = "recursive";
+    outputHashAlgo = "sha256";
+    outputHash = fetchDepsSha256;
+  };
+in
+stdenv.mkDerivation (rec {
+  pname = "oni2";
+  inherit version;
+
+  nativeBuildInputs = [
+    clang
+    makeWrapper
+    nodePackages.esy
+    bash
+    perl
+    which
+    nasm
+    python
+    gn
+    ninja
+    cmake
+    jq
+    yarn
+    fixup_yarn_lock
+  ];
+
+  buildInputs = [
+    nodejs
+    ripgrep
+    fontconfig
+    libGL
+    libGLU
+    ncurses
+    acl
+    harfbuzz
+    libjpeg
+    expat
+    icu58
+    libpng
+  ] ++ (with xorg; [
+    libX11
+    libXext
+    libXi
+    libXxf86vm
+    libXrandr
+    libXinerama
+    libXcursor
+    libICE
+    libSM
+    libXt
+    libxkbfile
+  ]);
+
+  unpackPhase = ''
+    cp -r ${source}/* ./
+    cp -r ${fetchDeps}/esy ./
+
+    chmod -R +w esy
+    chmod +w assets/configuration
+    chmod -R a+w node/
+    chmod -R a+w extensions/
+  '';
+
+  hardeningDisable = [ "fortify" ];
+
+  node = (callPackage ./node.nix { }).offline_cache;
+  extensions = (callPackage ./extensions.nix { }).offline_cache;
+
+  configurePhase = ''
+    runHook preConfigure
+
+    # Esy by default erases the entire environment, so the builder makes a wrapper over bash to automatically re-export it
+    mkdir wrapped-bash
+    set BASH $(which bash)
+    echo "#!$BASH" > wrapped-bash/bash
+    export | sed 's/PATH="/PATH="$PATH:/' >> wrapped-bash/bash
+    echo "exec $BASH \"\$@\"" >> wrapped-bash/bash
+    chmod +x wrapped-bash/bash
+
+    # Use custom builder for Oni2 to provide necessary environment to it
+    echo 'declare -x NIX_LDFLAGS="$NIX_LDFLAGS -lXext -lharfbuzz -ljpeg -lpthread -lpng -lexpat"' > build.sh
+    echo $(jq -r '.esy.build' package.json) >> build.sh
+    jq '.esy.build |= "bash build.sh"' package.json > package-upd.json
+    mv package{-upd,}.json
+
+    export PATH="$NIX_BUILD_TOP/wrapped-bash:$PATH"
+    patchShebangs $NIX_BUILD_TOP/esy/source
+
+    echo "" > assets/configuration/setup.json # it will be set at installation phase.
+
+    substituteInPlace src/gen_buildinfo/generator.re --replace "git rev-parse --short HEAD" "echo '${version}'"
+
+    runHook postConfigure
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+
+    # Required by yarn
+    export HOME=$NIX_BUILD_TOP/
+
+    # Install pinned yarn packages
+    yarnInstall() {
+      # Remove `resolutions` section from package.json
+      jq 'del(.resolutions)' $3/package.json > $3/package-upd.json
+      cp $3/package{-upd,}.json
+
+      # Copy custom yarn.lock to match updated package.json, do fixup
+      cp $2 $3/yarn.lock
+      fixup_yarn_lock $3/yarn.lock
+
+    # Make yarn install prefetched dependencies
+     yarn config --offline set yarn-offline-mirror $1
+     # Set explicit node install directory for node-gyp.
+     npm_config_nodedir=${nodejs} yarn install --frozen-lockfile --offline --no-progress --non-interactive --cwd $3
+    }
+    yarnInstall ${node} ${./node.lock} node
+    yarnInstall ${extensions} ${./extensions.lock} extensions
+
+    export ESY__PREFIX="$NIX_BUILD_TOP/esy"
+    esy '@release' install # should do nothing
+
+    export ESY__GLOBAL_PATH=PATH
+    # Create link to bin directory, currently empty
+    esy '@release' sh -c "ln -s \$cur__bin result"
+    # Finish building Oni2
+    esy '@release' x Oni2 --help
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir $out
+
+    cp -Lr ./result $out/bin
+    cp -r ./node $out/
+    cp -r ./extensions $out/
+
+    chmod +w $out/bin
+    chmod +x $out/bin/Oni2 $out/bin/Oni2_editor
+    # Unset LANG. See https://github.com/onivim/oni2/issues/3772
+    mv $out/bin/Oni2{,_unwrapped}
+    makeWrapper $out/bin/Oni2{_unwrapped,} --unset LANG
+    mv $out/bin/Oni2_editor{,_unwrapped}
+    makeWrapper $out/bin/Oni2_editor{_unwrapped,} --unset LANG
+
+    rm -f $out/bin/setup.json
+    jq -n "{node: \"${nodejs}/bin/node\", nodeScript: \"$out/node\", bundledExtensions: \"$out/extensions\", rg: \"${ripgrep}/bin/rg\"}" > $out/bin/setup.json
+
+    mkdir -p $out/share/applications $out/share/pixmaps
+    cp ${source}/scripts/linux/Onivim2.desktop $out/share/applications
+    cp ${source}/assets/images/icon512.png $out/share/pixmaps/Onivim2.png
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Native, lightweight modal code editor";
+    longDescription = ''
+      Onivim 2 is a reimagination of the Oni editor. Onivim 2 aims to bring the speed of Sublime, the language integration of VSCode, and the modal editing experience of Vim together, in a single package.
+    '';
+    homepage = "https://v2.onivim.io/";
+    inherit license;
+    maintainers = with maintainers; [ gardspirito ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+  };
+})
+
diff --git a/pkgs/applications/editors/oni2/default.nix b/pkgs/applications/editors/oni2/default.nix
deleted file mode 100644
index af80b11cc0d..00000000000
--- a/pkgs/applications/editors/oni2/default.nix
+++ /dev/null
@@ -1,273 +0,0 @@
-{ lib, stdenv
-, nodePackages
-# Fetch dependencies
-, fetchFromGitHub, gitMinimal, curlMinimal, cacert, yarn, unzip
-, xorg, nodejs, ripgrep, fontconfig, libGL, libGLU, ncurses, acl, harfbuzz, libjpeg, expat, icu58, libpng
-# Build
-, jq, perl, makeWrapper, bash, which, nasm, python, gn, ninja, cmake, clang, fixup_yarn_lock, callPackage
-}:
-
-let
-  mkOni2 = { variant, version, rev, sha256, fetchDepsSha256, license }:
-    let
-      source = fetchFromGitHub {
-        repo = variant;
-        owner = "onivim";
-        inherit rev sha256;
-      };
-
-      fetchDeps = stdenv.mkDerivation {
-        name = "oni2-fetch-deps";
-
-        unpackPhase = ''
-          cp ${source}/release.json ./
-          cp ${source}/package.json ./
-          cp -r ${source}/release.esy.lock ./
-          cp -r ${source}/node ./
-          cp -r ${source}/extensions ./
-          chmod -R +w node
-          chmod -R +w extensions
-        '';
-
-        nativeBuildInputs = [
-          jq
-          nodePackages.esy
-          gitMinimal
-          curlMinimal
-          cacert
-          python
-          perl
-          unzip
-          yarn
-        ];
-
-        buildPhase = ''
-          export ESY__PREFIX=$NIX_BUILD_TOP/esy
-          export ESY__GLOBAL_PATH=PATH
-
-          esy '@release' install
-
-          ln -s $NIX_BUILD_TOP/esy/source/i/ $NIX_BUILD_TOP/source
-
-          cd $NIX_BUILD_TOP/source
-          cd $(ls | grep "^esy_skia")
-
-          # Prefetch esy_skia pinned dependencies
-          # angle2, dng_sdk, piex and sfntly are unique and need to be fetched
-          # zlib and webp used here seem to be outdated, so it's impossible to link esy_skia against upstream zlib and webp
-          cat DEPS | grep -E '{|}|angle2|dng_sdk|piex|sfntly|zlib|webp' > DEPS-upd
-          mv DEPS{-upd,}
-          python tools/git-sync-deps
-
-          # Patch esy_skia builder to use nixpkgs ninja, gn tools and icu, expat and libpng libraries.
-          cd esy
-          patch build.sh ${./esy_skia_use_nixpkgs.patch}
-
-          cd $NIX_BUILD_TOP/source
-          cd $(ls | grep '^revery' | grep -v '__s__')
-          jq '.esy.build |= "bash -c \"\(.)\""' package.json > package-upd.json
-          mv package{-upd,}.json
-
-          # Delete esy_cmake and ninja dependencies (they are brought from Nixpkgs)
-          # Removing them from release.esy.lock is hard because it reports corruption
-          for d in "revery__s__esy_cmake" "ninja"
-          do
-              cd $NIX_BUILD_TOP/source
-              cd $(ls | grep $d)
-              rm -rf *
-          done
-
-          rm -rf $(find $NIX_BUILD_TOP/esy -name .git)
-        '';
-
-        installPhase = ''
-          mkdir $out
-          cp -r $NIX_BUILD_TOP/esy $out/
-        '';
-
-        dontPatchShebangs = true;
-
-        impureEnvVars = lib.fetchers.proxyImpureEnvVars;
-
-        outputHashMode = "recursive";
-        outputHashAlgo = "sha256";
-        outputHash = fetchDepsSha256;
-      };
-    in stdenv.mkDerivation rec {
-      pname = "oni2";
-      inherit version;
-
-      nativeBuildInputs = [
-        clang
-        makeWrapper
-        nodePackages.esy
-        bash
-        perl
-        which
-        nasm
-        python
-        gn
-        ninja
-        cmake
-        jq
-        yarn
-        fixup_yarn_lock
-      ];
-
-      buildInputs = [
-        nodejs
-        ripgrep
-        fontconfig
-        libGL
-        libGLU
-        ncurses
-        acl
-        harfbuzz
-        libjpeg
-        expat
-        icu58
-        libpng
-      ] ++ (with xorg; [
-        libX11
-        libXext
-        libXi
-        libXxf86vm
-        libXrandr
-        libXinerama
-        libXcursor
-        libICE
-        libSM
-        libXt
-        libxkbfile
-      ]);
-
-      unpackPhase = ''
-        cp -r ${source}/* ./
-        cp -r ${fetchDeps}/esy ./
-
-        chmod -R +w esy
-        chmod +w assets/configuration
-        chmod -R a+w node/
-        chmod -R a+w extensions/
-      '';
-
-      hardeningDisable = [ "fortify" ];
-
-      node = (callPackage ./node.nix { }).offline_cache;
-      extensions = (callPackage ./extensions.nix { }).offline_cache;
-
-      configurePhase = ''
-        runHook preConfigure
-
-        # Esy by default erases the entire environment, so the builder makes a wrapper over bash to automatically re-export it
-        mkdir wrapped-bash
-        set BASH $(which bash)
-        echo "#!$BASH" > wrapped-bash/bash
-        export | sed 's/PATH="/PATH="$PATH:/' >> wrapped-bash/bash
-        echo "exec $BASH \"\$@\"" >> wrapped-bash/bash
-        chmod +x wrapped-bash/bash
-
-        # Use custom builder for Oni2 to provide necessary environment to it
-        echo 'declare -x NIX_LDFLAGS="$NIX_LDFLAGS -lXext -lharfbuzz -ljpeg -lpthread -lpng -lexpat"' > build.sh
-        echo $(jq -r '.esy.build' package.json) >> build.sh
-        jq '.esy.build |= "bash build.sh"' package.json > package-upd.json
-        mv package{-upd,}.json
-
-        export PATH="$NIX_BUILD_TOP/wrapped-bash:$PATH"
-        patchShebangs $NIX_BUILD_TOP/esy/source
-
-        echo "" > assets/configuration/setup.json # it will be set at installation phase.
-
-        substituteInPlace src/gen_buildinfo/generator.re --replace "git rev-parse --short HEAD" "echo '${version}'"
-
-        runHook postConfigure
-      '';
-
-      buildPhase = ''
-        runHook preBuild
-
-        # Required by yarn
-        export HOME=$NIX_BUILD_TOP/
-
-        # Install pinned yarn packages
-        yarnInstall() {
-          # Remove `resolutions` section from package.json
-          jq 'del(.resolutions)' $3/package.json > $3/package-upd.json
-          cp $3/package{-upd,}.json
-
-          # Copy custom yarn.lock to match updated package.json, do fixup
-          cp $2 $3/yarn.lock
-          fixup_yarn_lock $3/yarn.lock
-
-          # Make yarn install prefetched dependencies
-          yarn config --offline set yarn-offline-mirror $1
-          # Set explicit node install directory for node-gyp.
-          npm_config_nodedir=${nodejs} yarn install --frozen-lockfile --offline --no-progress --non-interactive --cwd $3
-        }
-        yarnInstall ${node} ${./node.lock} node
-        yarnInstall ${extensions} ${./extensions.lock} extensions
-
-        export ESY__PREFIX="$NIX_BUILD_TOP/esy"
-        esy '@release' install # should do nothing
-
-        export ESY__GLOBAL_PATH=PATH
-        # Create link to bin directory, currently empty
-        esy '@release' sh -c "ln -s \$cur__bin result"
-        # Finish building Oni2
-        esy '@release' x Oni2 --help
-
-        runHook postBuild
-      '';
-
-      installPhase = ''
-        runHook preInstall
-
-        mkdir $out
-
-        cp -Lr ./result $out/bin
-        cp -r ./node $out/
-        cp -r ./extensions $out/
-
-        chmod +w $out/bin
-        chmod +x $out/bin/Oni2 $out/bin/Oni2_editor
-        # Unset LANG. See https://github.com/onivim/oni2/issues/3772
-        mv $out/bin/Oni2{,_unwrapped}
-        makeWrapper $out/bin/Oni2{_unwrapped,} --unset LANG
-        mv $out/bin/Oni2_editor{,_unwrapped}
-        makeWrapper $out/bin/Oni2_editor{_unwrapped,} --unset LANG
-
-        rm -f $out/bin/setup.json
-        jq -n "{node: \"${nodejs}/bin/node\", nodeScript: \"$out/node\", bundledExtensions: \"$out/extensions\", rg: \"${ripgrep}/bin/rg\"}" > $out/bin/setup.json
-
-        mkdir -p $out/share/applications $out/share/pixmaps
-        cp ${source}/scripts/linux/Onivim2.desktop $out/share/applications
-        cp ${source}/assets/images/icon512.png $out/share/pixmaps/Onivim2.png
-
-        runHook postInstall
-      '';
-
-      meta = with lib; {
-        description = "Native, lightweight modal code editor";
-        longDescription = ''
-          Onivim 2 is a reimagination of the Oni editor. Onivim 2 aims to bring the speed of Sublime, the language integration of VSCode, and the modal editing experience of Vim together, in a single package.
-        '';
-        homepage = "https://v2.onivim.io/";
-        inherit license;
-        maintainers = with maintainers; [ gardspirito ];
-        platforms =
-          [ "x86_64-linux" "x86_64-darwin" ];
-      };
-    };
-in mkOni2 {
-  variant = "oni2";
-  license = {
-    fullName = "Outrun Labs End User License Agreement";
-    url =
-      "https://github.com/onivim/oni2/blob/master/Outrun-Labs-EULA-v1.1.md";
-    free = false;
-  };
-  version = "0.5.7";
-  rev = "v0.5.7";
-  sha256 = "NlN0Ntdwtx5XLjd1ltUzv/bjmJQR5eyRqtmicppP6YU=";
-  fetchDepsSha256 = "k7G6jPJfxCCSuSucPfiXljCVJhmjl/BxWMCEjv2tfhA=";
-}
diff --git a/pkgs/applications/editors/oni2/esy_skia_use_nixpkgs.patch b/pkgs/applications/editors/oni2/esy_skia_use_nixpkgs.patch
index 50a1802816c..b943826dd68 100644
--- a/pkgs/applications/editors/oni2/esy_skia_use_nixpkgs.patch
+++ b/pkgs/applications/editors/oni2/esy_skia_use_nixpkgs.patch
@@ -1,6 +1,6 @@
-diff --git a/build-or.sh b/build.sh
+diff --git a/build.sh b/build.sh
 index be0bc6f..fddc9cb 100644
---- a/build-or.sh
+--- a/build.sh
 +++ b/build.sh
 @@ -50,6 +50,6 @@ else
          echo "llvm toolset-7.0 does not need to be manually activated"
diff --git a/pkgs/applications/editors/oni2/packages.nix b/pkgs/applications/editors/oni2/packages.nix
new file mode 100644
index 00000000000..72790313b9b
--- /dev/null
+++ b/pkgs/applications/editors/oni2/packages.nix
@@ -0,0 +1,20 @@
+{ lib, callPackage }:
+
+let
+  mkOni2 = opts: callPackage (import ./common.nix opts);
+in
+{
+  oni2 = mkOni2 {
+    variant = "oni2";
+    license = {
+      fullName = "Outrun Labs End User License Agreement";
+      url =
+        "https://github.com/onivim/oni2/blob/master/Outrun-Labs-EULA-v1.1.md";
+        free = false;
+    };
+    version = "0.5.7";
+    rev = "v0.5.7";
+    sha256 = "NlN0Ntdwtx5XLjd1ltUzv/bjmJQR5eyRqtmicppP6YU=";
+    fetchDepsSha256 = "k7G6jPJfxCCSuSucPfiXljCVJhmjl/BxWMCEjv2tfhA=";
+  } {};
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ab9739b64cc..ea3b92824b0 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3199,7 +3199,8 @@ with pkgs;
 
   optar = callPackage ../tools/graphics/optar {};
 
-  oni2 = callPackage ../applications/editors/oni2 { };
+  inherit (callPackage ../applications/editors/oni2/packages.nix { })
+    oni2;
 
   obinskit = callPackage ../applications/misc/obinskit {};

@@ -12354,4 +12354,10 @@
github = "rski";
githubId = 2960312;
};
gardspirito = {
Copy link
Member

Choose a reason for hiding this comment

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

Please sort this entry alphabetically.

pkgs/applications/editors/oni2/common.nix Outdated Show resolved Hide resolved
pkgs/applications/editors/oni2/common.nix Outdated Show resolved Hide resolved
pkgs/applications/editors/oni2/common.nix Outdated Show resolved Hide resolved
gitMinimal
curlMinimal
cacert
python
Copy link
Member

Choose a reason for hiding this comment

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

Can we use python3?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, no. python2 is explicitly required by the builder.

Copy link
Member

Choose a reason for hiding this comment

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

Then please use python2 explicitly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

python2Full?

Copy link
Member

Choose a reason for hiding this comment

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

Just python2 or python27.

pkgs/applications/editors/oni2/common.nix Outdated Show resolved Hide resolved
pkgs/applications/editors/oni2/common.nix Outdated Show resolved Hide resolved
pkgs/applications/editors/oni2/common.nix Outdated Show resolved Hide resolved
chmod +x wrapped-bash/bash

# Use custom builder for Oni2 to provide necessary environment to it
echo 'declare -x NIX_LDFLAGS="$NIX_LDFLAGS -lXext -lharfbuzz -ljpeg -lpthread -lpng -lexpat"' > build.sh
Copy link
Member

Choose a reason for hiding this comment

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

Can we set the variable globally?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that no. Building esy_skia, which also happens in this buildPhase, does not need these LD flags. At least it failed last time I tested.

pkgs/applications/editors/oni2/common.nix Outdated Show resolved Hide resolved
@gardspirito
Copy link
Contributor Author

gardspirito commented Sep 6, 2021

* I have tested this package on the other machine, and applied some changes including removing the `recurseIntoAttrs`.  This is the patch-all diff since [f38c09d](https://github.com/NixOS/nixpkgs/commit/f38c09d53cc21314fcac328d2e7dd483f3c73890) (the `init` commit). How's this?

The patch is broken, but I believe everything from it is already included in the current version, isn't it?

P.S: Sorry, my fault, I forgot to add you as a co-author. I guess I will when I finally squash all those temporary commits, if you don't mind.

Currently working on Wayland.

@gardspirito
Copy link
Contributor Author

gardspirito commented Sep 6, 2021

... I didn't manage to start sway on my machine and I don't really know how to understand the source of the problem. One my final guess is that both SDL_VIDEODRIVER and QT_QPA_PLATFORM need to be unsetted (or unset SDL_VIDEODRIVER and set QT_QPA_PLATFORM=xcb), but I'm pretty certain this won't help.

@gardspirito
Copy link
Contributor Author

I rechecked everything yet once again. Unsetting both SDL_VIDEODRIVER and XMODIFIERS fixes the issue with Wayland for me. Does it, boppyt?

@sefidel
Copy link
Member

sefidel commented Sep 7, 2021

Can confirm unsetting those variables work.

not sure if it makes it run on XWayland, though.

@sefidel
Copy link
Member

sefidel commented Sep 13, 2021

Built successfully, binary works.

You might want to alphabetize inputs, though.

@akshatagarwl
Copy link
Member

Result of nixpkgs-review pr 136101 run on x86_64-linux 1

1 package failed to build:
  • oni2

@gardspirito
Copy link
Contributor Author

@humancalico, thanks for reporting, but I could get use of more details... It successfully builds on machine.

@akshatagarwl
Copy link
Member

@gardspirito I just ran nixpkgs-review on this PR not sure if this helps but I'm on GNOME(Wayland)

@gardspirito
Copy link
Contributor Author

@humancalico, maybe it could help if you posted logs/oni2.log after running nixpkgs-review. Thank you.

@akshatagarwl
Copy link
Member

@gardspirito It's empty

@gardspirito
Copy link
Contributor Author

How's that? Oh, maybe fetching dependencies fails... I am unsure how can I debug this.

@sefidel
Copy link
Member

sefidel commented Sep 22, 2021

Result of nixpkgs-review pr 136101 run on x86_64-linux 1

1 package built:
  • oni2

@sefidel
Copy link
Member

sefidel commented Sep 22, 2021

Build went just fine for me;
NixOS 21.11.20210921.a403c08 (Porcupine)
Wayland (Sway)
tested execution of binary Oni2

@gardspirito
Copy link
Contributor Author

@SuperSandro2000, sorry for the call?..

@mkg20001
Copy link
Member

mkg20001 commented Nov 3, 2021

Rebased and squashed. Tested application before rebase, I'll let ofborg do it the second time (build takes ~1h).

@mkg20001
Copy link
Member

mkg20001 commented Nov 3, 2021

Ofborg doesn't build unfree so built locally, all seems good.

@mkg20001 mkg20001 merged commit 27b8cb1 into NixOS:master Nov 3, 2021
@gardspirito gardspirito deleted the oni2 branch November 4, 2021 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants