depot/pkgs/by-name/ni/nix-store-veritysetup-generator/package.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00

43 lines
1.2 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
systemd,
}:
rustPlatform.buildRustPackage rec {
pname = "nix-store-veritysetup-generator";
version = "0.1.0";
src = fetchFromGitHub {
owner = "nikstur";
repo = "nix-store-veritysetup-generator";
rev = version;
hash = "sha256-kQ+mFBnvxmEH2+z1sDaehGInEsBpfZu8LMAseGjZ3/I=";
};
sourceRoot = "${src.name}/rust";
cargoHash = "sha256-NCxPLsBJX4Dp8LcWrjVrocqDBvWc587DF3WPXZg1uFY=";
env = {
SYSTEMD_VERITYSETUP_PATH = "${systemd}/lib/systemd/systemd-veritysetup";
SYSTEMD_ESCAPE_PATH = "${systemd}/bin/systemd-escape";
};
# Use a fake path in tests so that they are not dependent on specific Nix
# Store paths and thus don't break on different Nixpkgs invocations. This is
# relevant so that this package can be compiled on different architectures.
preCheck = ''
export SYSTEMD_VERITYSETUP_PATH="systemd-veritysetup";
'';
stripAllList = [ "bin" ];
meta = with lib; {
description = "Systemd unit generator for a verity protected Nix Store";
homepage = "https://github.com/nikstur/nix-store-veritysetup-generator";
license = licenses.mit;
maintainers = with lib.maintainers; [ nikstur ];
};
}