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

betterdiscordctl: init at 1.7.0 #86943

Merged
merged 1 commit into from Jan 1, 2021

Conversation

IvarWithoutBones
Copy link
Member

@IvarWithoutBones IvarWithoutBones commented May 5, 2020

Motivation for this change

Adds betterdiscordctl, a pretty useful tool for customizing Discord. Tested with stable.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs 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/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Copy link

@ObserverOfTime ObserverOfTime left a comment

Choose a reason for hiding this comment

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

I'll add the package to the betterdiscordctl readme once this is merged. 👍

pkgs/tools/misc/betterdiscordctl/default.nix Outdated Show resolved Hide resolved
pkgs/tools/misc/betterdiscordctl/default.nix Outdated Show resolved Hide resolved
pkgs/tools/misc/betterdiscordctl/default.nix Outdated Show resolved Hide resolved
@bb010g
Copy link
Member

bb010g commented May 6, 2020

I wouldn't mind being marked as a maintainer (maintainers.bb010g).

@ofborg ofborg bot requested a review from bb010g May 6, 2020 11:27
@IvarWithoutBones IvarWithoutBones changed the title betterdiscordctl: init at 1.6.1 betterdiscordctl: init at 1.7.0 May 6, 2020
@IvarWithoutBones
Copy link
Member Author

IvarWithoutBones commented May 6, 2020

The ptb and canary branches now work as well if they're selected.

Also adressed other review comments, and updated to 1.7.0.

@ObserverOfTime
Copy link

Does this create a separate betterdiscordctl package for each version of Discord?

@IvarWithoutBones
Copy link
Member Author

IvarWithoutBones commented May 6, 2020

It does not, it allows you to select which branch to use with the branch variable (default is stable).
That sets the discord variable to the version of Discord selected, which gets used in the patchPhase.

@ObserverOfTime
Copy link

I'm not familiar with nix packaging. Can you change branches on the fly or do you have to reinstall it in order to use it on another Discord branch?

@IvarWithoutBones
Copy link
Member Author

IvarWithoutBones commented May 6, 2020

You'd have to reinstall as it needs to repatch. Not sure of a better solution. However as 99.99% of users just use 1 branch of Discord i dont think it should be much of an issue.

@ObserverOfTime
Copy link

How about patching it so that it prefixes /opt with ${pkgs.discord} or the corresponding flavor selected by the --flavor flag on runtime instead? This should probably be handled upstream by adding a --nix flag (akin to bb010g/betterdiscordctl#59) and enabling it by default in the nix package.

@IvarWithoutBones
Copy link
Member Author

IvarWithoutBones commented May 6, 2020

Sure, sounds good. If someone merges this (The installation derivation from that PR wouldn't be required as we handle that here) we can just wrap it to automatically use that flag here. Would indeed be a bit cleaner.

Edit: Oh, looks like that would only support the stable branch, as other binaries are named differently. Would require a bit more than just merging that.

@ObserverOfTime
Copy link

ObserverOfTime commented May 6, 2020

The PR implementation doesn't seem like it'll work with PTB or Canary either.
Anyway, I'll let @bb010g handle the rest since I'm way out of my depth here.

@IvarWithoutBones
Copy link
Member Author

IvarWithoutBones commented Jun 1, 2020

Any update on this? If not i think what I've done currently should be fine. I forgot to add documentation on how to switch discord versions in the package, so I'll add that now.

@IvarWithoutBones IvarWithoutBones force-pushed the betterdiscord branch 2 times, most recently from 7ade7fe to 919c55b Compare June 1, 2020 23:21
@ObserverOfTime
Copy link

ObserverOfTime commented Jun 2, 2020

I made an attempt over at bb010g/betterdiscordctl#67.

If it's merged, patchPhase can be replaced with:

substituteInPlace betterdiscordctl --replace "^DISABLE_UPGRADE=$" "DISABLE_UPGRADE=yes"
substituteInPlace betterdiscordctl --replace "^nix=$" "nix=yes"

(Assuming regular expressions are supported.)

Also, the version should be changed to 1.7.1 and the branch derivation won't be needed.

@IvarWithoutBones
Copy link
Member Author

IvarWithoutBones commented Jul 4, 2020

Since it's taking a while for that PR to get merged upstream, I've just patched it in here. Current derivation works just fine, and is a lot cleaner than before IMO :)

Should be ready to merge.

Also, the version should be changed to 1.7.1 and the branch derivation won't be needed.

That release does not seem to exist?

@ObserverOfTime
Copy link

That release does not seem to exist?

Yeah, I was going to publish it once the PR was merged.

@Artturin
Copy link
Member

is this ready? if the latest review is blocking then you could use sed right?

@IvarWithoutBones
Copy link
Member Author

is this ready? if the latest review is blocking then you could use sed right?

I've done that, should indeed be ready now 👍

Sorry about the wait, totally forgot about this one.

@thiagokokada
Copy link
Contributor

Result of nixpkgs-review pr 86943 1

1 package built:
  • betterdiscordctl

Copy link
Contributor

@thiagokokada thiagokokada left a comment

Choose a reason for hiding this comment

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

Didn't really try to patch my Discord, but it seems to find my installation correctly.

@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/312

@SuperSandro2000
Copy link
Member

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

1 package built:
  • betterdiscordctl

@SuperSandro2000 SuperSandro2000 merged commit 0acc363 into NixOS:master Jan 1, 2021
@ObserverOfTime
Copy link

ObserverOfTime commented Mar 31, 2021

@IvarWithoutBones v1.7.1 has been published now. (Though BD broke in the meantime.)

@IvarWithoutBones IvarWithoutBones deleted the betterdiscord branch April 2, 2021 20:35
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.

None yet

7 participants