From 6fb9bb1a6b343de86dbaa5943a92875b4bae5ae6 Mon Sep 17 00:00:00 2001 From: Victor Mignot Date: Tue, 3 Dec 2024 09:53:55 +0100 Subject: [PATCH] workstation: drop gpg in favor of SSH key --- modules/workstation/home-manager/default.nix | 2 +- .../home-manager/development/default.nix | 5 ++-- modules/workstation/home-manager/gpg.nix | 29 ------------------- modules/workstation/home-manager/ssh.nix | 8 +++++ 4 files changed, 12 insertions(+), 32 deletions(-) delete mode 100644 modules/workstation/home-manager/gpg.nix create mode 100644 modules/workstation/home-manager/ssh.nix diff --git a/modules/workstation/home-manager/default.nix b/modules/workstation/home-manager/default.nix index c92b3b3..007178d 100644 --- a/modules/workstation/home-manager/default.nix +++ b/modules/workstation/home-manager/default.nix @@ -24,7 +24,7 @@ in ./desktop ./development ./fish.nix - ./gpg.nix + ./ssh.nix ./communication.nix ./mail.nix ./helix.nix diff --git a/modules/workstation/home-manager/development/default.nix b/modules/workstation/home-manager/development/default.nix index 48b0473..d5f60d7 100644 --- a/modules/workstation/home-manager/development/default.nix +++ b/modules/workstation/home-manager/development/default.nix @@ -25,14 +25,15 @@ with lib; package = pkgs.gitAndTools.gitFull; userName = "Victor Mignot"; userEmail = "dala@dalaran.fr"; - signing = mkIf config.my.pgp.enable { - key = "BEAFED3D"; + signing = { + key = "~/.ssh/id_ed25519_sk.pub"; signByDefault = true; }; extraConfig = { init = { defaultBranch = "main"; }; + gpg.format = "ssh"; core = { editor = "${pkgs.helix}/bin/hx"; }; diff --git a/modules/workstation/home-manager/gpg.nix b/modules/workstation/home-manager/gpg.nix deleted file mode 100644 index 3555b7b..0000000 --- a/modules/workstation/home-manager/gpg.nix +++ /dev/null @@ -1,29 +0,0 @@ -{ - config, - lib, - pkgs, - ... -}: -with lib; -{ - options.my.pgp.enable = mkOption { - type = types.bool; - default = true; - example = false; - description = '' - Add GPG keyring and GPG Agent configuration. - ''; - }; - - config = mkIf config.my.pgp.enable { - programs.gpg.enable = true; - - services.gpg-agent = { - enable = true; - enableScDaemon = true; - enableSshSupport = true; - sshKeys = [ "40DE2FEE4D3C5E2C" ]; - pinentryPackage = pkgs.pinentry-curses; - }; - }; -} diff --git a/modules/workstation/home-manager/ssh.nix b/modules/workstation/home-manager/ssh.nix new file mode 100644 index 0000000..e508894 --- /dev/null +++ b/modules/workstation/home-manager/ssh.nix @@ -0,0 +1,8 @@ +{ ... }: +{ + services.ssh-agent.enable = true; + programs.ssh = { + enable = true; + forwardAgent = true; + }; +}