1 { lib, stdenv, fetchFromGitHub, libedit, libsecret, ncurses, pkg-config, readline, Security }:
3 stdenv.mkDerivation rec {
7 src = fetchFromGitHub {
11 sha256 = "sha256-QUy38kJzMbYOyT86as4/yq2ctcszSnB8a3eVWxgd4Fo=";
15 sed -i -e "s|-ltermcap|-lncurses|" Makefile
18 nativeBuildInputs = [ pkg-config ];
20 buildInputs = [ libsecret readline ]
21 ++ lib.optionals stdenv.hostPlatform.isDarwin [ libedit ncurses Security ];
23 makeFlags = [ "DESTDIR=$(out)" ];
26 description = "Set environment variables with macOS keychain or D-Bus secret service";
27 homepage = "https://github.com/sorah/envchain";
28 license = licenses.mit;
29 platforms = platforms.unix;
31 mainProgram = "envchain";