From 852385ef4dc7853b222da08df873a4249f36528f Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Mon, 9 May 2022 22:55:10 -0400 Subject: [PATCH] initial gpg setup --- flake.nix | 3 +++ hosts/desktop/default.nix | 1 + modules/services/gnupg.nix | 15 +++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 modules/services/gnupg.nix diff --git a/flake.nix b/flake.nix index 39197c0..e4b27fe 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,9 @@ in { # Define my systems + # You can load it from an empty system with: + # nix-shell -p nixFlakes + # sudo nixos-rebuild switch --flake github:nmasur/dotfiles#desktop nixosConfigurations = { desktop = import ./hosts/desktop { inherit nixpkgs home-manager nur globals; }; diff --git a/hosts/desktop/default.nix b/hosts/desktop/default.nix index 348f390..03d26b7 100644 --- a/hosts/desktop/default.nix +++ b/hosts/desktop/default.nix @@ -20,6 +20,7 @@ nixpkgs.lib.nixosSystem { ../../modules/shell ../../modules/gaming ../../modules/services/keybase.nix + ../../modules/services/gnupg.nix ../../modules/applications/firefox.nix ../../modules/applications/alacritty.nix ../../modules/applications/media.nix diff --git a/modules/services/gnupg.nix b/modules/services/gnupg.nix new file mode 100644 index 0000000..2649f62 --- /dev/null +++ b/modules/services/gnupg.nix @@ -0,0 +1,15 @@ +{ config, ... }: { + + home-manager.users.${config.user} = { + programs.gpg.enable = true; + services.gpg-agent = { + enable = true; + defaultCacheTtl = 86400; # Resets when used + defaultCacheTtlSsh = 86400; # Resets when used + maxCacheTtl = 34560000; # Can never reset + maxCacheTtlSsh = 34560000; # Can never reset + pinentryFlavor = "tty"; + }; + }; + +}