Skip to content

Commit

Permalink
flake-info: use saner nix packaging method
Browse files Browse the repository at this point in the history
When trying to first work in this I naive approached it with
`nix-shell`. That of course lead to the fixed output bollocks failing
with a hash mismatch. By making use of the `cargoLock` attribute on
`buildRustPackage` we can tame the FOD-beast and only have to provide
one hash manually for a single package (that we fetch from a GitHub
repository).

This also means that updating dependencies will be simpler as the native
Cargo.lock file can be used.
  • Loading branch information
andir committed Aug 23, 2021
1 parent 5ad7136 commit 80c87f6
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions flake-info/default.nix
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
{ pkgs ? import <nixpkgs> { } }: with pkgs;




rustPlatform.buildRustPackage rec {
name = "flake-info";
src = ./.;
cargoSha256 = "sha256-TA1WEvmOfnxQ+rRwkIPN1t4VPrDL6pq+WnPHVu2/CPE=";
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl openssl.dev ] ++ lib.optional pkgs.stdenv.isDarwin [libiconv darwin.apple_sdk.frameworks.Security];
checkFlags = [
"--skip elastic::tests"
"--skip nix_gc::tests"
];
name = "flake-info";
src = ./.;
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"elasticsearch-8.0.0-alpha.1" = "0x8iw4m16vy6i28mj30aqdwfw4a3hd174l8l9yigddn3cr53cagx";
};
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ openssl openssl.dev ] ++ lib.optional pkgs.stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.Security ];
checkFlags = [
"--skip elastic::tests"
"--skip nix_gc::tests"
];
}

0 comments on commit 80c87f6

Please sign in to comment.