From 6f5815b39200d70b6d29958d2751ffb15bdffce2 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 30 Mar 2024 23:05:05 +0100 Subject: [PATCH 1/3] [thunderbird] Sign mail with YubiKey --- nixos/modules/hardware/yubikey/default.nix | 10 ++++++---- nixos/users/tdpeuter/mail.nix | 17 +++++++++++++---- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/nixos/modules/hardware/yubikey/default.nix b/nixos/modules/hardware/yubikey/default.nix index 8deb1ed..116a7d1 100644 --- a/nixos/modules/hardware/yubikey/default.nix +++ b/nixos/modules/hardware/yubikey/default.nix @@ -6,12 +6,14 @@ in { options.sisyphus.hardware.yubikey.enable = lib.mkEnableOption "YubiKey support"; config = lib.mkIf cfg.enable { - # Enable smart card reading - services.pcscd.enable = true; - programs.gnupg.agent = { enable = true; - pinentryFlavor = "curses"; + # TODO Necessary? + # enableSSHSupport = true; + # pinentryFlavor = "curses"; }; + + # Enable smart card reading + services.pcscd.enable = true; }; } diff --git a/nixos/users/tdpeuter/mail.nix b/nixos/users/tdpeuter/mail.nix index a7335c9..d6b4928 100644 --- a/nixos/users/tdpeuter/mail.nix +++ b/nixos/users/tdpeuter/mail.nix @@ -67,9 +67,13 @@ in { thunderbird = { enable = true; settings = id: { - "mail.server.server_${id}.authMethod" = 10; + "mail.server.server_${id}.authMethod" = 10; "mail.smtpserver.smtp_${id}.authMethod" = 10; - "mail.identity.id_${id}.htmlSigText" = signatures.UGent; + "mail.identity.id_${id}.htmlSigText" = signatures.UGent; + + # Allow PGP + "mail.identity.id_${id}.openpgp_key_id" = "9B11F5243089DB5B"; # Your 'master' key + "mail.identity.id_${id}.attachPgpKey" = true; }; }; }; @@ -117,10 +121,15 @@ in { profiles.tdpeuter = { isDefault = true; settings = { - "mailnews.default_sort_order" = 2; # Sort descending + # View + "mailnews.default_sort_order" = 2; # Sort descending "mailnews.mark_message_read.delay" = true; "mailnews.start_page.enabled" = false; - "mail.pane_config.dynamic" = 2; # Vertical view + "mail.pane_config.dynamic" = 2; # Vertical view + + # Encryption + "mail.openpgp.allow_external_gnupg" = true; # Enable YubiKey GPG signing + "mail.e2ee.auto_enable" = true; # Automatically enable encryption when possible. }; }; }; From da6d195afbd4d5504cadcf95bc6f0791249deeae Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Sat, 6 Apr 2024 23:00:17 +0200 Subject: [PATCH 2/3] [yubikey] Add touch-detector --- nixos/modules/hardware/yubikey/default.nix | 27 ++++++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/nixos/modules/hardware/yubikey/default.nix b/nixos/modules/hardware/yubikey/default.nix index 116a7d1..708b9c1 100644 --- a/nixos/modules/hardware/yubikey/default.nix +++ b/nixos/modules/hardware/yubikey/default.nix @@ -6,14 +6,31 @@ in { options.sisyphus.hardware.yubikey.enable = lib.mkEnableOption "YubiKey support"; config = lib.mkIf cfg.enable { - programs.gnupg.agent = { - enable = true; - # TODO Necessary? - # enableSSHSupport = true; - # pinentryFlavor = "curses"; + programs = { + gnupg.agent = { + enable = true; + # TODO Necessary? + # enableSSHSupport = true; + # pinentryFlavor = "curses"; + }; + + # yubikey-touch-detector.enable = true; }; # Enable smart card reading services.pcscd.enable = true; + + environment.systemPackages = with pkgs; [ + yubikey-touch-detector + ]; + + # Send a notification if the YubiKey is waiting for touch. + systemd.user.services.yubikey-touch-detector = { + enable = true; + description = "Detects when your YubiKey is waiting for a touch"; + path = with pkgs; [ yubikey-touch-detector ]; + script = ''exec yubikey-touch-detector --notify''; + environment.YUBIKEY_TOUCH_DETECTOR_LIBNOTIFY = "true"; + }; }; } From ef9f891482a337bdca9a0e5cef33d356240b52db Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Tue, 9 Apr 2024 12:29:06 +0200 Subject: [PATCH 3/3] [sway] Attempt at improving startup time of launcher --- stow/sway/.config/sway/config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stow/sway/.config/sway/config b/stow/sway/.config/sway/config index 1b9ee29..922a75b 100644 --- a/stow/sway/.config/sway/config +++ b/stow/sway/.config/sway/config @@ -16,8 +16,8 @@ set { $scrollDown button5 # $term kitty || alacritty || foot - $term kitty - $menu j4-dmenu-desktop --dmenu "rofi -dmenu -i" --usage-log="/home/tdpeuter/.local/state/dmenu.log" + $term foot + $menu j4-dmenu-desktop --dmenu="rofi -dmenu -i" --no-generic --usage-log="/home/tdpeuter/.local/state/dmenu.log" --term=$term # TODO Find better location and better way to reference this. $window_switcher /home/tdpeuter/projects/fzf-jump/new.sh $lock swaylock -f