Skip to content

Commit 88dd799

Browse files
NovaViperbrianmcgee
andcommitted
feat: add age plugin and fido2 hmac support
Co-authored-by: brianmcgee <[email protected]>
1 parent 94d8af6 commit 88dd799

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
@@ -60,6 +60,10 @@
6060
;
6161
# backward compatibility
6262
inherit (prev) ssh-to-pgp;
63+
64+
sops = prev.sops.withAgePlugins (p: [
65+
p.age-plugin-fido2-hmac
66+
]);
6367
};
6468
nixosModules = {
6569
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
@@ -39,6 +39,7 @@ let
3939
# [1] https://github.com/getsops/sops/pull/1692
4040
cfg = lib.recursiveUpdate cfg {
4141
environment.HOME = "/var/empty";
42+
environment.PATH = lib.makeBinPath cfg.age.plugins;
4243
};
4344
inherit lib;
4445
};
@@ -342,6 +343,14 @@ in
342343
'';
343344
};
344345

346+
plugins = lib.mkOption {
347+
type = lib.types.listOf lib.types.package;
348+
default = [ ];
349+
description = ''
350+
List of plugins to use for sops decryption.
351+
'';
352+
};
353+
345354
generateKey = lib.mkOption {
346355
type = lib.types.bool;
347356
default = false;
@@ -453,6 +462,7 @@ in
453462
before = [ "sysinit-reactivation.target" ];
454463
environment = cfg.environment;
455464
unitConfig.DefaultDependencies = "no";
465+
path = cfg.age.plugins;
456466

457467
serviceConfig = {
458468
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)