From fc0dcffc62625cb247864328d5988646271f6bc8 Mon Sep 17 00:00:00 2001 From: CDaut Date: Thu, 18 Apr 2024 10:03:48 +0200 Subject: [PATCH] began setting up git signing --- configuration.nix | 4 ++++ programm_configs/git.nix | 4 ++++ programm_configs/yubikey-gpg.nix | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 programm_configs/yubikey-gpg.nix diff --git a/configuration.nix b/configuration.nix index a558f72..4a8417a 100644 --- a/configuration.nix +++ b/configuration.nix @@ -70,6 +70,10 @@ desktopManager.wallpaper.mode = "fill"; }; + imports = [ + ./programm_configs/yubikey-gpg.nix + ]; + services.gvfs.enable = true; # Configure console keymap diff --git a/programm_configs/git.nix b/programm_configs/git.nix index 344e202..e548548 100644 --- a/programm_configs/git.nix +++ b/programm_configs/git.nix @@ -3,5 +3,9 @@ enable = true; userName = "CDaut"; userEmail = "git@cdaut.de"; + signing = { + signByDefault = true; + key = null; + }; }; } \ No newline at end of file diff --git a/programm_configs/yubikey-gpg.nix b/programm_configs/yubikey-gpg.nix new file mode 100644 index 0000000..0701a4c --- /dev/null +++ b/programm_configs/yubikey-gpg.nix @@ -0,0 +1,24 @@ +{ config, lib, pkgs, ... }: + +{ + + services.pcscd.enable = true; + programs.ssh.startAgent = false; + + environment.systemPackages = with pkgs; [ + yubikey-personalization + ]; + + services.udev.packages = [ pkgs.yubikey-personalization ]; + + programs.gnupg.agent = { + enable = true; + enableSSHSupport = true; + }; + + environment.shellInit = '' + gpg-connect-agent /bye + export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket) + ''; + +} \ No newline at end of file