Skip to content

Commit 2d57b9d

Browse files
NovaViperbrianmcgee
andcommitted
feat: add age plugin and fido2 hmac support
Co-authored-by: brianmcgee <[email protected]>
1 parent 6e5a38e commit 2d57b9d

File tree

4 files changed

+26
-0
lines changed

4 files changed

+26
-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
@@ -249,6 +249,14 @@ in
249249
'';
250250
};
251251

252+
plugins = lib.mkOption {
253+
type = lib.types.listOf lib.types.package;
254+
default = [ ];
255+
description = ''
256+
List of plugins to use for sops decryption.
257+
'';
258+
};
259+
252260
generateKey = lib.mkOption {
253261
type = lib.types.bool;
254262
default = false;
@@ -348,6 +356,8 @@ in
348356
))
349357
];
350358

359+
PATH = lib.makeBinPath cfg.age.plugins;
360+
351361
QUBES_GPG_DOMAIN = lib.mkIf cfg.gnupg.qubes-split-gpg.enable (
352362
lib.mkDefault cfg.gnupg.qubes-split-gpg.domain
353363
);

modules/sops/default.nix

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ let
4343
# [1] https://github.com/getsops/sops/pull/1692
4444
cfg = lib.recursiveUpdate cfg {
4545
environment.HOME = "/var/empty";
46+
environment.PATH = lib.makeBinPath cfg.age.plugins;
4647
};
4748
inherit lib;
4849
};
@@ -329,6 +330,14 @@ in
329330
'';
330331
};
331332

333+
plugins = lib.mkOption {
334+
type = lib.types.listOf lib.types.package;
335+
default = [ ];
336+
description = ''
337+
List of plugins to use for sops decryption.
338+
'';
339+
};
340+
332341
generateKey = lib.mkOption {
333342
type = lib.types.bool;
334343
default = false;
@@ -438,6 +447,7 @@ in
438447
after = [ "systemd-sysusers.service" ];
439448
environment = cfg.environment;
440449
unitConfig.DefaultDependencies = "no";
450+
path = cfg.age.plugins;
441451

442452
serviceConfig = {
443453
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)