From 4567405cd4a6bcc9f5010d93eeec9c3aa3873c79 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Sat, 23 Apr 2022 22:46:58 +1200 Subject: [PATCH] emacs.pkgs.tsc: Remove `with` from top-level scope This is a huge anti-pattern that makes it next to impossible to know which attrset is providing which attr and it's very easy to make mistakes. Case in point: This package didn't properly scope `lib.maintainers`. --- .../editors/emacs/elisp-packages/tsc/default.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/editors/emacs/elisp-packages/tsc/default.nix b/pkgs/applications/editors/emacs/elisp-packages/tsc/default.nix index aefb7d02004d..3f686f96febe 100644 --- a/pkgs/applications/editors/emacs/elisp-packages/tsc/default.nix +++ b/pkgs/applications/editors/emacs/elisp-packages/tsc/default.nix @@ -7,9 +7,6 @@ , clang , llvmPackages }: -with lib.licenses; -with rustPlatform; -with llvmPackages; let version = "0.16.1"; @@ -37,7 +34,7 @@ let ''; }; - tsc-dyn = buildRustPackage { + tsc-dyn = rustPlatform.buildRustPackage { inherit version; inherit src; @@ -47,7 +44,7 @@ let sourceRoot = "source/core"; configurePhase = '' - export LIBCLANG_PATH="${libclang.lib}/lib" + export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib" ''; postInstall = '' @@ -61,13 +58,14 @@ let cargoSha256 = "sha256-7UOhs3wx6fGvqPjNxUKoEHwPtiJ5zgLFPwDSvhYlmis="; }; + in symlinkJoin { - name = "tsc"; + name = "tsc-${version}"; paths = [ tsc tsc-dyn ]; meta = { description = "The core APIs of the Emacs binding for tree-sitter."; - license = mit; - maintainers = with maintainers; [ pimeys ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ pimeys ]; }; }