Skip to content

Commit 782693f

Browse files
NovaViperbrianmcgee
andcommitted
feat: add age plugin and fido2 hmac support
Co-authored-by: brianmcgee <brian@41north.dev>
1 parent e93ee1d commit 782693f

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

flake.nix

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
;
6262
# backward compatibility
6363
inherit (prev) ssh-to-pgp;
64+
65+
sops = prev.sops.withAgePlugins (p: [
66+
p.age-plugin-fido2-hmac
67+
]);
6468
};
6569
nixosModules = {
6670
sops = ./modules/sops;

modules/home-manager/sops.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,14 @@ in
240240
'';
241241
};
242242

243+
plugins = lib.mkOption {
244+
type = lib.types.listOf lib.types.package;
245+
default = [ ];
246+
description = ''
247+
List of plugins to use for sops decryption.
248+
'';
249+
};
250+
243251
generateKey = lib.mkOption {
244252
type = lib.types.bool;
245253
default = false;
@@ -339,6 +347,8 @@ in
339347
))
340348
];
341349

350+
PATH = lib.makeBinPath cfg.age.plugins;
351+
342352
QUBES_GPG_DOMAIN = lib.mkIf cfg.gnupg.qubes-split-gpg.enable (
343353
lib.mkDefault cfg.gnupg.qubes-split-gpg.domain
344354
);

modules/sops/default.nix

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,14 @@ in
329329
'';
330330
};
331331

332+
plugins = lib.mkOption {
333+
type = lib.types.listOf lib.types.package;
334+
default = [ ];
335+
description = ''
336+
List of plugins to use for sops decryption.
337+
'';
338+
};
339+
332340
generateKey = lib.mkOption {
333341
type = lib.types.bool;
334342
default = false;
@@ -438,6 +446,7 @@ in
438446
after = [ "systemd-sysusers.service" ];
439447
environment = cfg.environment;
440448
unitConfig.DefaultDependencies = "no";
449+
path = cfg.age.plugins;
441450

442451
serviceConfig = {
443452
Type = "oneshot";

modules/sops/secrets-for-users/default.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ let
1717
# See also the default NixOS module.
1818
cfg = lib.recursiveUpdate cfg {
1919
environment.HOME = "/var/empty";
20+
environment.PATH = lib.makeBinPath cfg.age.plugins;
2021
};
2122
inherit lib;
2223
};
@@ -36,6 +37,7 @@ in
3637
before = [ "systemd-sysusers.service" ];
3738
environment = cfg.environment;
3839
unitConfig.DefaultDependencies = "no";
40+
path = cfg.age.plugins;
3941

4042
serviceConfig = {
4143
Type = "oneshot";

0 commit comments

Comments
 (0)