-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
envchain: init at 1.0.1 #99978
envchain: init at 1.0.1 #99978
Conversation
Done. My bad, |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed some changes to build on darwin
diff --git a/pkgs/tools/misc/envchain/default.nix b/pkgs/tools/misc/envchain/default.nix
index 401714ca3e0..fae1f99de78 100644
--- a/pkgs/tools/misc/envchain/default.nix
+++ b/pkgs/tools/misc/envchain/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchFromGitHub, libsecret, pkg-config, readline }:
+{ stdenv, fetchFromGitHub, libsecret, pkg-config, readline
+, Security
+, libedit
+}:
stdenv.mkDerivation rec {
pname = "envchain";
@@ -13,8 +16,14 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkg-config ];
- buildInputs = [ libsecret readline ];
+ buildInputs = [ libsecret readline ]
+ ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin [
+ Security libedit
+ ];
+ preBuild = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+ substituteInPlace Makefile --replace '-ltermcap' ' '
+ '';
makeFlags = [ "DESTDIR=$(out)" ];
meta = {
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 1a72d0656f6..43f09113069 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3645,7 +3645,9 @@ in
entr = callPackage ../tools/misc/entr { };
- envchain = callPackage ../tools/misc/envchain { };
+ envchain = callPackage ../tools/misc/envchain {
+ inherit (darwin.apple_sdk.frameworks) Security;
+ };
eot_utilities = callPackage ../tools/misc/eot-utilities { };
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Result of 1 package built:
|
To build on darwin the following patch is required: diff --git a/pkgs/tools/misc/envchain/default.nix b/pkgs/tools/misc/envchain/default.nix
index 7f6cca2c1f87..fbd596c5f662 100644
--- a/pkgs/tools/misc/envchain/default.nix
+++ b/pkgs/tools/misc/envchain/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libsecret, pkg-config, readline }:
+{ stdenv, fetchFromGitHub, libedit, libsecret, ncurses, pkg-config, readline, Security }:
stdenv.mkDerivation rec {
pname = "envchain";
@@ -11,9 +11,14 @@ stdenv.mkDerivation rec {
sha256 = "0qxwiqhb8cg0zbn5p0mvnbyxx1xwvgiricrkjlvxz13sf2ngq87p";
};
+ postPatch = ''
+ sed -i -e "s|-ltermcap|-lncurses|" Makefile
+ '';
+
nativeBuildInputs = [ pkg-config ];
- buildInputs = [ libsecret readline ];
+ buildInputs = [ libsecret readline ]
+ ++ stdenv.lib.optionals stdenv.isDarwin [ libedit ncurses Security ];
makeFlags = [ "DESTDIR=$(out)" ];
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 37f0447b1e9e..fa71e5fca493 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3692,7 +3692,7 @@ in
entr = callPackage ../tools/misc/entr { };
- envchain = callPackage ../tools/misc/envchain { };
+ envchain = callPackage ../tools/misc/envchain { inherit (pkgs.darwin.apple_sdk.frameworks) Security; };
eot_utilities = callPackage ../tools/misc/eot-utilities { };
|
Co-authored-by: Jon <jonringer@users.noreply.github.com> Co-authored-by: r-burns <52847440+r-burns@users.noreply.github.com> Co-authored-by: Sandro Jäckel <sandro.jaeckel@gmail.com>
Done. Thanks @SuperSandro2000 |
Result of 1 package built:
|
Result of 1 package built:
|
Motivation for this change
This tool is to avoid having sensible things in
.env
files.Things done
Note that 1.0.1 is 4 years old.
The last commit in the repo is about 5 months old.
Tested saving a secret on Gnome. Didn't test it with envrc yet.
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)