From 30498fc42b7ff79cded481231004e2c9c19eb439 Mon Sep 17 00:00:00 2001 From: reo101 Date: Thu, 13 Jul 2023 14:25:57 +0300 Subject: [PATCH] feat(pkgs): add `pest-ide-tools` and `srtool-cli` --- pkgs/default.nix | 2 ++ pkgs/pest-ide-tools/default.nix | 36 +++++++++++++++++++++++++++++++++ pkgs/srtool-cli/default.nix | 36 +++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 pkgs/pest-ide-tools/default.nix create mode 100644 pkgs/srtool-cli/default.nix diff --git a/pkgs/default.nix b/pkgs/default.nix index 2c24f52..77f0d85 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -8,6 +8,8 @@ advcpmv = pkgs.callPackage ./advcpmv { }; fennel-language-server = pkgs.callPackage ./fennel-language-server { }; parinfer-rust = pkgs.callPackage ./parinfer-rust { }; + pest-ide-tools = pkgs.callPackage ./pest-ide-tools { }; + srtool-cli = pkgs.callPackage ./srtool-cli { }; swww = pkgs.callPackage ./swww { }; vim-fmi-cli = pkgs.callPackage ./vim-fmi-cli { }; win2xcur = pkgs.callPackage ./win2xcur { }; diff --git a/pkgs/pest-ide-tools/default.nix b/pkgs/pest-ide-tools/default.nix new file mode 100644 index 0000000..b4a46b3 --- /dev/null +++ b/pkgs/pest-ide-tools/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, darwin, fetchFromGitHub, rustPlatform, openssl, pkg-config, libxkbcommon }: + +rustPlatform.buildRustPackage rec { + pname = "pest-ide-tools"; + version = "8de1ee91765b0257c2ccfbf48f6b5bd39158bc2c"; + + src = fetchFromGitHub { + owner = "pest-parser"; + repo = pname; + rev = "${version}"; + sha256 = "sha256-PSYbmFEYGGDPvHl9AjDSoedRx1Y7A5HT1gqPcGeVkv4="; + }; + + cargoSha256 = "sha256-wvMAo+XgnSfUb36nJWSAL3TAcnWzPOpaCdvJnpcyol0="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + SystemConfiguration + CoreServices + ]); + + PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; + LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; + + doCheck = false; + + meta = with lib; { + description = "IDE tools for writing pest grammars, using the Language Server Protocol for Visual Studio Code, Vim and other editors"; + homepage = "https://github.com/pest-ide-tools/pest-parser"; + license = licenses.mit; + maintainers = with maintainers; [ reo101 ]; + }; +} diff --git a/pkgs/srtool-cli/default.nix b/pkgs/srtool-cli/default.nix new file mode 100644 index 0000000..da85bb5 --- /dev/null +++ b/pkgs/srtool-cli/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, darwin, fetchFromGitHub, rustPlatform, openssl, pkg-config, libxkbcommon }: + +rustPlatform.buildRustPackage rec { + pname = "srtool-cli"; + version = "2e52c2c95d802d1a8a7da9b0f4c27a2b4ef5265a"; + + src = fetchFromGitHub { + owner = "chevdor"; + repo = pname; + rev = "${version}"; + sha256 = "sha256-/vOQL5ru+Hyyydab1N7zKdqV+yeYc5CsqpWn58Ni7Wk="; + }; + + cargoSha256 = "sha256-pxWuIxp4UjyIMiy1WWU40IRVElX2LRuw5VmiSAdcbMU="; + + nativeBuildInputs = [ + pkg-config + ]; + + buildInputs = [ ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + SystemConfiguration + CoreServices + ]); + + PKG_CONFIG_PATH = "${openssl.dev}/lib/pkgconfig"; + LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; + + doCheck = false; + + meta = with lib; { + description = "This cli utility helps you harness the srtool docker image witout breaking a sweat."; + homepage = "https://github.com/chevdor/srtool-cli"; + license = licenses.mit; + maintainers = with maintainers; [ reo101 ]; + }; +}