Finish modularising config
There are still some things I want to change, but at least there aren't two systems now.
This commit is contained in:
parent
9f04c5d815
commit
0df4d5654f
68 changed files with 860 additions and 1441 deletions
44
modules/gnupg.nix
Normal file
44
modules/gnupg.nix
Normal file
|
@ -0,0 +1,44 @@
|
|||
{ config, lib, ... }:
|
||||
|
||||
{
|
||||
options.chvp.gnupg = {
|
||||
enable = lib.mkOption {
|
||||
default = false;
|
||||
example = true;
|
||||
};
|
||||
pinentryFlavor = lib.mkOption {
|
||||
type = lib.types.str;
|
||||
default = "curses";
|
||||
example = "qt";
|
||||
description = ''
|
||||
Pinentry flavor for gnupg.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf config.chvp.gnupg.enable {
|
||||
chvp.zfs.homeLinks = [
|
||||
{ path = ".gnupg/crls.d"; type = "data"; }
|
||||
{ path = ".gnupg/private-keys-v1.d"; type = "data"; }
|
||||
{ path = ".gnupg/pubring.kbx"; type = "data"; }
|
||||
{ path = ".gnupg/trustdb.gpg"; type = "data"; }
|
||||
];
|
||||
programs.gnupg.agent = {
|
||||
enable = true;
|
||||
pinentryFlavor = config.chvp.gnupg.pinentryFlavor;
|
||||
};
|
||||
home-manager.users.charlotte = { lib, ... }: {
|
||||
home.activation.fixPermissionsCommands = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
mkdir -p /home/charlotte/.gnupg
|
||||
chmod u=rwX,go= /home/charlotte/.gnupg
|
||||
'';
|
||||
programs.gpg.enable = true;
|
||||
services.gpg-agent = {
|
||||
enable = true;
|
||||
defaultCacheTtl = 7200;
|
||||
maxCacheTtl = 99999;
|
||||
pinentryFlavor = config.chvp.gnupg.pinentryFlavor;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue