Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion modules/home-manager/sops.nix
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,16 @@ in
};

gnupg = {
package = lib.mkOption {
type = lib.types.package;
default = pkgs.gnupg;
defaultText = lib.literalExpression "pkgs.gnupg";
description = ''
The gnupg package to use for sops operations.
Useful if you need a specific version or a wrapped instance.
'';
};

home = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
Expand Down Expand Up @@ -341,7 +351,7 @@ in
sops.environment = {
SOPS_GPG_EXEC = lib.mkMerge [
(lib.mkIf (cfg.gnupg.home != null || cfg.gnupg.sshKeyPaths != [ ]) (
lib.mkDefault "${pkgs.gnupg}/bin/gpg"
lib.mkDefault "${cfg.gnupg.package}/bin/gpg"
))
(lib.mkIf cfg.gnupg.qubes-split-gpg.enable (
lib.mkDefault config.home.sessionVariables.SOPS_GPG_EXEC
Expand Down
2 changes: 1 addition & 1 deletion modules/nix-darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ in

{
sops.environment.SOPS_GPG_EXEC = lib.mkIf (cfg.gnupg.home != null || cfg.gnupg.sshKeyPaths != [ ]) (
lib.mkDefault "${pkgs.gnupg}/bin/gpg"
lib.mkDefault "${cfg.gnupg.package}/bin/gpg"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The package option is missing a bit up.

);
}
];
Expand Down
12 changes: 11 additions & 1 deletion modules/sops/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,16 @@ in
This option must be explicitly unset if <literal>config.sops.gnupg.home</literal> is set.
'';
};

package = lib.mkOption {
type = lib.types.package;
default = pkgs.gnupg;
defaultText = lib.literalExpression "pkgs.gnupg";
description = ''
The gnupg package to use for sops operations.
'';
};

};
};
imports = [
Expand Down Expand Up @@ -442,7 +452,7 @@ in
);

sops.environment.SOPS_GPG_EXEC = lib.mkIf (cfg.gnupg.home != null || cfg.gnupg.sshKeyPaths != [ ]) (
lib.mkDefault "${pkgs.gnupg}/bin/gpg"
lib.mkDefault "${cfg.gnupg.package}/bin/gpg"
);

# When using sysusers we no longer are started as an activation script because those are started in initrd while sysusers is started later.
Expand Down
Loading