#6 trying to sign commits
This commit is contained in:
parent
45487e7d1b
commit
120baa6ab8
7 changed files with 117 additions and 11 deletions
56
modules/nixos/security/gpg/default.nix
Normal file
56
modules/nixos/security/gpg/default.nix
Normal file
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
with lib.wyrdgard;
|
||||
let
|
||||
cfg = config.wyrdgard.security.gpg;
|
||||
|
||||
gpgConf = "${inputs.gpg-base-conf}/gpg.conf";
|
||||
|
||||
gpgAgentConf = ''
|
||||
enable-ssh-support
|
||||
default-cache-ttl 60
|
||||
max-cache-ttl 120
|
||||
pinentry-program ${pkgs.pinentry-qt}/bin/pinentry-qt
|
||||
'';
|
||||
in
|
||||
{
|
||||
options.wyrdgard.security.gpg = with types; {
|
||||
enable = mkBoolOpt false "Wether or not to enable GPG.";
|
||||
agentTimeout = mkOpt int 5 "The amount of time to wait before continuing with shell init.";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
paperkey
|
||||
gnupg
|
||||
pinentry-curses
|
||||
pinentry-qt
|
||||
];
|
||||
|
||||
programs = {
|
||||
ssh.startAgent = false;
|
||||
|
||||
gnupg.agent = {
|
||||
enable = true;
|
||||
enableSSHSupport = true;
|
||||
enableExtraSocket = true;
|
||||
};
|
||||
};
|
||||
|
||||
wyrdgard = {
|
||||
home.file = {
|
||||
".gnupg/.keep".text = "";
|
||||
|
||||
".gnupg/gpg.conf".source = gpgConf;
|
||||
".gnupg/gpg-agent.conf".text = gpgAgentConf;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue