File tree 4 files changed +64
-0
lines changed
4 files changed +64
-0
lines changed Original file line number Diff line number Diff line change 14
14
15
15
sops-import-keys-hook = pkgs . callPackage ./pkgs/sops-import-keys-hook { } ;
16
16
17
+ age-fido2-hmac = pkgs . callPackage ./pkgs/age-fido2-hmac { } ;
18
+ sops-fido2-hmac = pkgs . callPackage ./pkgs/sops-fido2-hmac { } ;
19
+
17
20
# backwards compatibility
18
21
inherit ( pkgs ) ssh-to-pgp ;
19
22
Original file line number Diff line number Diff line change 319
319
'' ;
320
320
} ;
321
321
322
+ plugins = lib . mkOption {
323
+ type = lib . types . listOf lib . types . package ;
324
+ default = [ ] ;
325
+ description = ''
326
+ List of plugins to use for sops decryption.
327
+ '' ;
328
+ } ;
329
+
322
330
generateKey = lib . mkOption {
323
331
type = lib . types . bool ;
324
332
default = false ;
431
439
sops . environment . SOPS_GPG_EXEC = lib . mkIf ( cfg . gnupg . home != null || cfg . gnupg . sshKeyPaths != [ ] ) (
432
440
lib . mkDefault "${ pkgs . gnupg } /bin/gpg"
433
441
) ;
442
+ sops . environment . PATH = lib . makeBinPath cfg . age . plugins ;
434
443
435
444
# When using sysusers we no longer are started as an activation script because those are started in initrd while sysusers is started later.
436
445
systemd . services . sops-install-secrets = lib . mkIf ( regularSecrets != { } && useSystemdActivation ) {
Original file line number Diff line number Diff line change
1
+ { age-plugin-fido2-hmac
2
+ , runCommand
3
+ , makeWrapper
4
+ , lib
5
+ , age
6
+ } :
7
+
8
+ runCommand "age" {
9
+ nativeBuildInputs = [ makeWrapper ] ;
10
+ } ''
11
+ mkdir -p $out/bin
12
+ makeWrapper ${ age } /bin/age $out/bin/age \
13
+ --prefix PATH : ${ lib . makeBinPath [ age-plugin-fido2-hmac ] }
14
+ ''
Original file line number Diff line number Diff line change
1
+ {
2
+ sops ,
3
+ fetchFromGitHub ,
4
+ buildGoModule ,
5
+ age-plugin-fido2-hmac ,
6
+ makeWrapper
7
+ } :
8
+
9
+ let
10
+ version = "2024-11-23" ;
11
+ in
12
+ buildGoModule {
13
+ pname = "sops-fido2-hmac" ;
14
+ inherit version ;
15
+ src = fetchFromGitHub {
16
+ owner = "brianmcgee" ;
17
+ repo = "sops" ;
18
+ rev = "0607eae847f1ae21205b5e2a919de6d5868f6395" ;
19
+ sha256 = "sha256-mWsIg9TXGlA8EuFD7Pb0w8PsD3LvCMCy1X9OTITxvsU=" ;
20
+ } ;
21
+ vendorHash = "sha256-NS0b25NQEJle///iRHAG3uTC5p6rlGSyHVwEESki3p4=" ;
22
+
23
+ subPackages = [ "cmd/sops" ] ;
24
+
25
+ ldflags = [
26
+ "-s"
27
+ "-w"
28
+ "-X github.com/getsops/sops/v3/version.Version=${ version } "
29
+ ] ;
30
+
31
+ nativeBuildInputs = [ makeWrapper ] ;
32
+
33
+ postInstall = ''
34
+ wrapProgram $out/bin/sops --prefix PATH : ${ age-plugin-fido2-hmac } /bin
35
+ '' ;
36
+
37
+ inherit ( sops ) meta ;
38
+ }
You can’t perform that action at this time.
0 commit comments