summaryrefslogtreecommitdiffstats
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/simple/garage-k2v-client.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/simple/garage-k2v-client.nix b/pkgs/simple/garage-k2v-client.nix
new file mode 100644
index 0000000..6c517b8
--- /dev/null
+++ b/pkgs/simple/garage-k2v-client.nix
@@ -0,0 +1,40 @@
+{ pkgs }:
+
+pkgs.rustPlatform.buildRustPackage {
+ pname = "garage-k2v-client";
+ version = "0.0.4";
+
+ src = pkgs.fetchgit {
+ url = "https://git.deuxfleurs.fr/Deuxfleurs/garage.git";
+ rev = "v1.0.0";
+ hash = "sha256-5W5cXylFCrDup+HOOUVPWBJUSphOp8szgtpvRIv82b8=";
+ };
+
+ cargoHash = "sha256-Ggau8m0FVqpS1vMbpwBSkwBx6/2SrBw3ZpYhrjqkhNs=";
+
+ # Copied from nixpkgs@e402c3e's ./pkgs/tools/filesystems/garage/default.nix
+ postPatch = ''
+ # Starting in 0.9.x series, Garage is using mold in local development
+ # and this leaks in this packaging, we remove it to use the default linker.
+ rm .cargo/config.toml || true
+ '';
+
+ preBuild = ''
+ cd src/k2v-client
+ '';
+
+ postBuild = ''
+ cd -
+ '';
+
+ installPhase = ''
+ mkdir -p $out/bin
+ find target -executable -type f -name k2v-cli -exec cp {} $out/bin/ \;
+ '';
+
+ # Don't check otherwise we cannot cd - in postBuild
+ # (but would have to do it after the tests instead.)
+ doCheck = false;
+
+ buildFeatures = [ "cli" ];
+}