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

positron-bin: 2024.11.0-116 -> 2025.02.0-137 #373551

Merged
merged 2 commits into from
Feb 18, 2025

Conversation

b-rodrigues
Copy link
Contributor

@b-rodrigues b-rodrigues commented Jan 13, 2025

I had to change the update script because the url got changed.

fyi @detroyejr

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

@detroyejr
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 373551


x86_64-linux

✅ 1 package built:
  • positron-bin

@b-rodrigues b-rodrigues force-pushed the update_positron_202501 branch from 30e620c to f54da43 Compare January 21, 2025 20:06
@b-rodrigues
Copy link
Contributor Author

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 373551


x86_64-linux

✅ 1 package built:
  • positron-bin

@b-rodrigues b-rodrigues changed the title Update positron 202501 positron-bin: 2024.11.0-116 -> 2025.02.0-79 Jan 24, 2025
@b-rodrigues b-rodrigues force-pushed the update_positron_202501 branch from f54da43 to 9c5696c Compare January 24, 2025 13:31
@b-rodrigues b-rodrigues marked this pull request as ready for review January 24, 2025 13:32
@b-rodrigues b-rodrigues marked this pull request as draft January 24, 2025 13:35
@b-rodrigues b-rodrigues force-pushed the update_positron_202501 branch 6 times, most recently from cb35c3c to 9c5696c Compare January 24, 2025 16:12
@b-rodrigues b-rodrigues marked this pull request as ready for review January 24, 2025 16:13
@b-rodrigues b-rodrigues force-pushed the update_positron_202501 branch from 9c5696c to c8a7c8f Compare January 31, 2025 09:03
@b-rodrigues b-rodrigues changed the title positron-bin: 2024.11.0-116 -> 2025.02.0-79 positron-bin: 2024.11.0-116 -> 2025.02.0-137 Jan 31, 2025
@marsiwiec
Copy link

marsiwiec commented Feb 11, 2025

Hi! I tried to overlay this PR on top of nixos-unstable but I get this error when switching:
> cp: cannot stat 'usr/share/pixmaps': No such file or directory

I am not well-versed in nix (learning!) so I would be grateful for any pointers. Or is this a NixOS-specific problem?

EDIT: this is the relevant config I wrote:

{ lib, config, pkgs, ... }:
{
  options = {
    positron.enable = lib.mkEnableOption "positron IDE";
  };
  config = lib.mkIf config.positron.enable {
    nixpkgs.overlays = [
      (final: prev: {
        positron-bin = prev.positron-bin.overrideAttrs (old: {
          src = builtins.fetchGit {
            url = "https://github.com/NixOS/nixpkgs";
            ref = "pull/373551/head";
            rev = "5a3a76a43d9827acf2d9bd19b2cbe44a9750cdaf";
          };
        });
      })
    ];
    home.packages = with pkgs; [
      positron-bin
    ];
  };
}

@detroyejr
Copy link
Contributor

detroyejr commented Feb 13, 2025

I'm unsure the best way to pull a PR directly into a nix configuration. Maybe someone else has a good solution for that. I would either checkout the PR with git/gh and build the package yourself with nix-build or manually apply the few changes yourself. There are ways to apply PR's to nixpkgs directly but it's not straightforward. If you just want to try out the update, I think this will work:

{ lib, config, pkgs, ... }:
{
  options = {
    positron.enable = lib.mkEnableOption "positron IDE";
  };
  config = lib.mkIf config.positron.enable {
    home.packages = with pkgs; [
      (positron-bin.overrideAttrs(attrs: {
        src =  fetchurl {
          url = "https://github.com/posit-dev/positron/releases/download/2025.02.0-137/Positron-2025.02.0-137-x64.deb";
          hash = "sha256-Q4dDx4c3nNjoZPtoIkVAlisGShqtz4pIKXVh+5fngaI=";
        };
        installPhase = ''
          runHook preInstall
          mkdir -p "$out/share"
          cp -r usr/share/pixmaps "$out/share/pixmaps"
          cp -r usr/share/positron "$out/share/positron"

          mkdir -p "$out/share/applications"
          install -m 444 -D usr/share/applications/positron.desktop "$out/share/applications/positron.desktop"
          substituteInPlace "$out/share/applications/positron.desktop" \
            --replace-fail \
            "Icon=co.posit.positron" \
            "Icon=$out/share/pixmaps/co.posit.positron.png" \
            --replace-fail \
            "Exec=/usr/share/positron/positron %F" \
            "Exec=$out/share/positron/.positron-wrapped %F" \
            --replace-fail \
            "/usr/share/positron/positron --new-window %F" \
            "$out/share/positron/.positron-wrapped --new-window %F"

          # Fix libGL.so not found errors.
          wrapProgram "$out/share/positron/positron" \
            --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libglvnd ]}"

          mkdir -p "$out/bin"
          ln -s "$out/share/positron/positron" "$out/bin/positron"
          runHook postInstall
        '';
      }))
    ];
  };
}

Edit: an easier way to run this would be:

export NIXPKGS_ALLOW_UNFREE=1
nix run github:NixOS/nixpkgs/pull/373551/head#positron-bin --impure

@marsiwiec
Copy link

@detroyejr both options work really well thank you!
So from what I understand there was a change in the icon and naming scheme in recent builds and this creates the necessity for the updated installPhase bit?

Yeah I find the methods of overlaying PRs on nixpkgs quite tricky.

Once again thanks for helping out. Everything is working smoothly both directly through NixOS config/home manager as well as inside a devenv project.

@b-rodrigues b-rodrigues force-pushed the update_positron_202501 branch from c8a7c8f to bb9f954 Compare February 13, 2025 19:19
@detroyejr
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 373551


x86_64-linux

✅ 1 package built:
  • positron-bin

Copy link
Contributor

@detroyejr detroyejr left a comment

Choose a reason for hiding this comment

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

I noticed today that I can't save files in the editor on NixOS. Instead of opening up a file browser pop-up, the program crashes with the error: "No GSettings schemas are installed on the system." The fix seems to be just to add wrapGAppsHook to nativeBuildInputs.

diff --git a/pkgs/by-name/po/positron-bin/package.nix b/pkgs/by-name/po/positron-bin/package.nix
index 0e4b9f0a1283..ccf62f2e88a3 100644
--- a/pkgs/by-name/po/positron-bin/package.nix
+++ b/pkgs/by-name/po/positron-bin/package.nix
@@ -17,6 +17,7 @@
   patchelf,
   stdenv,
   systemd,
+  wrapGAppsHook,
   xorg,
 }:
 let
@@ -64,6 +65,7 @@ stdenv.mkDerivation {
     lib.optionals stdenv.hostPlatform.isLinux [
       autoPatchelfHook
       dpkg
+      wrapGAppsHook
     ]
     ++ lib.optionals stdenv.hostPlatform.isDarwin [
       _7zz

@b-rodrigues b-rodrigues force-pushed the update_positron_202501 branch from bb9f954 to 920f50d Compare February 15, 2025 10:35
@b-rodrigues
Copy link
Contributor Author

thanks, done!

@b-rodrigues b-rodrigues marked this pull request as draft February 15, 2025 10:47
@b-rodrigues b-rodrigues force-pushed the update_positron_202501 branch from 920f50d to 9fbfaf5 Compare February 15, 2025 20:10
@b-rodrigues b-rodrigues marked this pull request as ready for review February 15, 2025 20:13
@detroyejr
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 373551


x86_64-linux

✅ 1 package built:
  • positron-bin

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-already-reviewed/2617/2255

@SuperSandro2000 SuperSandro2000 merged commit 2131a25 into NixOS:master Feb 18, 2025
39 checks passed
@SuperSandro2000
Copy link
Member

The bin suffix should be removed

@detroyejr
Copy link
Contributor

Here's why we included the suffix previously:

This is great, one last nit: maybe we should call it positron-bin to keep positron free for a from source build.

Comment Source

But, I'm fine with making that change.

@b-rodrigues b-rodrigues deleted the update_positron_202501 branch February 18, 2025 17:12
@SuperSandro2000
Copy link
Member

Does that really apply? Why do we need a binary build if we have a source build? Also we have meta.sourceProvenance to lets people know if binaries are build from source or binaries.

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.

5 participants