Skip to content

Commit 9ff208c

Browse files
P-E-Meunierkolloch
authored andcommitted
Adding the dependency to libsecret on Linux (for private registries)
1 parent 1511224 commit 9ff208c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

crate2nix/default.nix

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
, defaultCrateOverrides ? pkgs.defaultCrateOverrides
1414
, nix ? pkgs.nix
1515
, cargo ? pkgs.cargo
16+
, libsecret ? pkgs.libsecret
1617
, callPackage ? pkgs.callPackage
1718
, nix-prefetch-git ? pkgs.nix-prefetch-git
1819
# Seperate arguements that are NOT filled by callPackage.
@@ -26,7 +27,7 @@ let
2627
baseName = builtins.baseNameOf (builtins.toString name);
2728
in
2829
!(baseName == "templates" && type == "directory");
29-
crate2nix = cargoNix.rootCrate.build.override {
30+
crate2nix = (cargoNix.rootCrate.build.override {
3031
testCrateFlags = [
3132
"--skip nix_integration_tests"
3233
];
@@ -46,7 +47,11 @@ let
4647
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
4748
};
4849
};
49-
};
50+
}).overrideAttrs (attrs: {
51+
postInstall = lib.optionalString stdenv.isLinux ''
52+
patchelf --add-needed ${libsecret}/lib/libsecret-1.so.0 $out/bin/crate2nix
53+
'';
54+
});
5055
set_templates = if release then "" else "--set TEMPLATES_DIR ${./templates}";
5156
in
5257
symlinkJoin {

0 commit comments

Comments
 (0)