2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2019-12-01 11:57:05 +00:00
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cryptsetup
|
|
|
|
, pkg-config
|
2020-10-13 10:01:23 +01:00
|
|
|
, clang
|
|
|
|
, llvmPackages
|
2019-12-01 11:57:05 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "fido2luks";
|
2021-07-27 02:20:18 +01:00
|
|
|
version = "0.2.19";
|
2019-12-01 11:57:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "shimunn";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-07-27 02:20:18 +01:00
|
|
|
sha256 = "sha256-o21KdsAE9KznobdMMKfVmVnENsLW3cMZjssnrsoN+KY=";
|
2019-12-01 11:57:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ cryptsetup ];
|
2020-10-13 10:01:23 +01:00
|
|
|
nativeBuildInputs = [ pkg-config clang ];
|
2019-12-01 11:57:05 +00:00
|
|
|
|
2020-10-13 10:01:23 +01:00
|
|
|
configurePhase = ''
|
llvmPackages: Multuple outputs for everythting
Also begin to start work on cross compilation, though that will have to
be finished later.
The patches are based on the first version of
https://reviews.llvm.org/D99484. It's very annoying to do the
back-porting but the review has uncovered nothing super major so I'm
fine sticking with what I've got.
Beyond making the outputs work, I also strove to re-sync the packages,
as they have been drifting pointlessly apart for some time.
----
Other misc notes, highly incomplete
- lvm-config-native and llvm-config are put in `dev` because they are
tools just for build time.
- Clang no longer has an lld dep. That was introduced in
db29857eb391ed002046090851a44c452b80bdbd, but if clang needs help
finding lld when it is used we should just pass it flags / put in the
resource dir. Providing it at build time increases critical path
length for no good reason.
----
A note on `nativeCC`:
`stdenv` takes tools from the previous stage, so:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.stdenv.cc`: `(?0, ?1, x)`
while:
1. `pkgsBuildBuild`: `(?1, x, x)`
2. `pkgsBuildBuild.targetPackages`: `(x, x, ?2)`
3. `pkgsBuildBuild.targetPackages.stdenv.cc`: `(?1, x, x)`
2020-10-15 09:23:57 +01:00
|
|
|
export LIBCLANG_PATH="${llvmPackages.libclang.lib}/lib"
|
2020-10-13 10:01:23 +01:00
|
|
|
'';
|
|
|
|
|
2021-07-27 02:20:18 +01:00
|
|
|
cargoSha256 = "sha256-8JFe3mivf2Ewu1nLMugeeK+9ZXAGPHaqCyKfWfwLOc8=";
|
2019-12-01 11:57:05 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-12-01 11:57:05 +00:00
|
|
|
description = "Decrypt your LUKS partition using a FIDO2 compatible authenticator";
|
|
|
|
homepage = "https://github.com/shimunn/fido2luks";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ prusnak mmahut ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|