diff options
author | Alan Pearce | 2017-07-06 13:39:26 +0200 |
---|---|---|
committer | Alan Pearce | 2017-07-06 13:39:26 +0200 |
commit | 98746fdaec9f4272619c2ceeadbbcfa7ec387ea4 (patch) | |
tree | eb91aba81fbcf80068bac747a84fa1cd36885ed8 | |
parent | 899f3d958cd55c81dc26bf431f272c4a5d7c2f0a (diff) | |
download | dotfiles-98746fdaec9f4272619c2ceeadbbcfa7ec387ea4.tar.lz dotfiles-98746fdaec9f4272619c2ceeadbbcfa7ec387ea4.tar.zst dotfiles-98746fdaec9f4272619c2ceeadbbcfa7ec387ea4.zip |
Nix: Create package for zr
-rw-r--r-- | nix/.config/nixpkgs/config.nix | 2 | ||||
-rw-r--r-- | nix/.config/nixpkgs/zr.nix | 42 |
2 files changed, 44 insertions, 0 deletions
diff --git a/nix/.config/nixpkgs/config.nix b/nix/.config/nixpkgs/config.nix index dc4e40a..aa0112e 100644 --- a/nix/.config/nixpkgs/config.nix +++ b/nix/.config/nixpkgs/config.nix @@ -6,6 +6,8 @@ emacs = if stdenv.isDarwin then emacs25Macport else emacs; }; nodejs = pkgs.nodejs-8_x; + + zr = super.callPackage ./zr.nix {}; }; allowUnfree = true; diff --git a/nix/.config/nixpkgs/zr.nix b/nix/.config/nixpkgs/zr.nix new file mode 100644 index 0000000..1ef3e32 --- /dev/null +++ b/nix/.config/nixpkgs/zr.nix @@ -0,0 +1,42 @@ +{ + fetchFromGitHub, + darwin, + stdenv, + rustPlatform, + cmake, + curl, + libiconv, + openssl, + zlib +}: +with rustPlatform; + +buildRustPackage rec { + name = "zr-${version}"; + version = "0.4.8"; + + src = fetchFromGitHub { + owner = "jedahan"; + repo = "zr"; + rev = "${version}"; + sha256 = "07kb8bk2zri1087dp3pk2zpqjy8rd40nw931z6nnm230ygq481zm"; + }; + + buildInputs = [ cmake curl openssl zlib libiconv ] ++ stdenv.lib.optionals stdenv.isDarwin + (with darwin.apple_sdk.frameworks; [ Security ]); + + cargoDepsHook = stdenv.lib.optionals stdenv.isDarwin '' + export OPENSSL_DIR=${openssl} + export OPENSSL_LIB_DIR=${openssl.out}/lib + export OPENSSL_INCLUDE_DIR=${openssl.dev}/include + ''; + + depsSha256 = "0cjnqilsb9la28b65j1w1n8gdr49b1d9m3z7wsl4q2w3qc42ad52"; + + meta = with stdenv.lib; { + description = "zsh plugin manager written in rust"; + homepage = https://github.com/jedahan/zr; + license = with licenses; [ unfree ]; + platforms = platforms.all; + }; +} |