Skip to content

Commit

Permalink
Adding the dependency to libsecret on Linux (for private registries)
Browse files Browse the repository at this point in the history
  • Loading branch information
P-E-Meunier committed Oct 24, 2024
1 parent 236f6ad commit 9fc4cf8
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions crate2nix/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
, defaultCrateOverrides ? pkgs.defaultCrateOverrides
, nix ? pkgs.nix
, cargo ? pkgs.cargo
, libsecret ? pkgs.libsecret
, callPackage ? pkgs.callPackage
, nix-prefetch-git ? pkgs.nix-prefetch-git
# Seperate arguements that are NOT filled by callPackage.
Expand All @@ -26,7 +27,7 @@ let
baseName = builtins.baseNameOf (builtins.toString name);
in
!(baseName == "templates" && type == "directory");
crate2nix = cargoNix.rootCrate.build.override {
crate2nix = (cargoNix.rootCrate.build.override {
testCrateFlags = [
"--skip nix_integration_tests"
];
Expand All @@ -46,7 +47,11 @@ let
buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Security ];
};
};
};
}).overrideAttrs (attrs: {
postInstall = lib.optionalString stdenv.isLinux ''
patchelf --add-needed ${libsecret}/lib/libsecret-1.so.0 $out/bin/crate2nix
'';
});
set_templates = if release then "" else "--set TEMPLATES_DIR ${./templates}";
in
symlinkJoin {
Expand Down

0 comments on commit 9fc4cf8

Please sign in to comment.