nixpkgs/pkgs/tools/misc/betterdiscordctl/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

38 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, fetchpatch }:
stdenv.mkDerivation rec {
pname = "betterdiscordctl";
version = "1.7.0";
src = fetchFromGitHub {
owner = "bb010g";
repo = "betterdiscordctl";
rev = "v${version}";
sha256 = "0qpmm5l8jhm7k0kqblc0bnr9fl4b6z8iddhjar03bb4kqgr962fa";
};
patches = [
(fetchpatch { # Required till https://github.com/bb010g/betterdiscordctl/pull/67 is merged upstream.
url = "https://github.com/bb010g/betterdiscordctl/pull/67/commits/f1c7170fc2626d9aec4d244977b5a73c401aa1d4.patch";
sha256 = "003zqd9ljb9h674sjwjvvdfs7q4cw0p1ydg3lax132vb4vz9k0zi";
})
];
preBuild = "sed -i 's/^nix=$/&yes/g;s/^DISABLE_UPGRADE=$/&yes/g' ./betterdiscordctl";
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/share/doc/betterdiscordctl
install -Dm744 betterdiscordctl $out/bin/betterdiscordctl
install -Dm644 README.md $out/share/doc/betterdiscordctl/README.md
'';
meta = with lib; {
homepage = "https://github.com/bb010g/betterdiscordctl";
description = "A utility for managing BetterDiscord on Linux";
license = licenses.mit;
maintainers = with maintainers; [ ivar bb010g ];
platforms = platforms.linux;
};
}