File tree Expand file tree Collapse file tree 1 file changed +26
-10
lines changed
pkgs/by-name/ag/age-plugin-fido2-hmac Expand file tree Collapse file tree 1 file changed +26
-10
lines changed Original file line number Diff line number Diff line change 1- { lib
2- , buildGoModule
3- , fetchFromGitHub
4- , libfido2
5- , stdenv
1+ {
2+ lib ,
3+ buildGoModule ,
4+ fetchFromGitHub ,
5+ stdenv ,
6+ libfido2 ,
7+ openssl ,
8+ libcbor
69} :
10+ let
11+ darwin_arch = if stdenv . hostPlatform . system == "aarch64-darwin" then "arm64" else "amd64" ;
12+ darwin_configure = ''
13+ chmod -R +w vendor/github.com/keys-pub/go-libfido2
14+ cat << EOF > vendor/github.com/keys-pub/go-libfido2/fido2_static_${ darwin_arch } .go
15+ package libfido2
716
17+ /*
18+ #cgo darwin LDFLAGS: -framework CoreFoundation -framework IOKit -L${ lib . getLib openssl } /lib -L${ lib . getLib libcbor } /lib -lfido2
19+ #cgo darwin CFLAGS: -I${ libfido2 . dev } /include -I${ openssl . dev } /include
20+ */
21+ import "C"
22+ EOF
23+ '' ;
24+ in
825buildGoModule rec {
926 pname = "age-plugin-fido2-hmac" ;
1027 version = "0.2.3" ;
@@ -18,18 +35,17 @@ buildGoModule rec {
1835
1936 vendorHash = "sha256-h4/tyq9oZt41IfRJmmsLHUpJiPJ7YuFu59ccM7jHsFo=" ;
2037
21- ldflags = [ "-s" "-w" ] ;
38+ ldflags = [ "-s" "-w" "-X main.version=v ${ version } " ] ;
2239
23- buildInputs = [
24- libfido2
25- ] ;
40+ buildInputs = [ libfido2 ] ;
41+
42+ postConfigure = lib . optional stdenv . isDarwin darwin_configure ;
2643
2744 meta = with lib ; {
2845 description = "Age plugin to encrypt files with fido2 tokens using the hmac-secret extension and non-discoverable credentials" ;
2946 homepage = "https://github.com/olastor/age-plugin-fido2-hmac/" ;
3047 license = licenses . mit ;
3148 maintainers = with maintainers ; [ matthewcroughan ] ;
3249 mainProgram = "age-plugin-fido2-hmac" ;
33- broken = stdenv . isDarwin ;
3450 } ;
3551}
You can’t perform that action at this time.
0 commit comments