From 1582871c32a9f0a42563d76ec916fbf6e757a00a Mon Sep 17 00:00:00 2001 From: cnst Date: Mon, 23 Sep 2024 19:00:26 +0200 Subject: [PATCH] Testing SSH signing --- flake.nix | 2 +- home/modules/default.nix | 1 + home/modules/userd/gpg/default.nix | 18 ++++++++++++++++++ home/modules/utils/ssh/default.nix | 1 + home/users/cnst/modules.nix | 4 ++++ home/users/cnst/shell.nix | 4 ---- 6 files changed, 25 insertions(+), 5 deletions(-) create mode 100644 home/modules/userd/gpg/default.nix diff --git a/flake.nix b/flake.nix index 88c03100..22340fff 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "Flake config, _heavily_ influenced by fufexan's"; + description = "cnix nix"; outputs = inputs: inputs.flake-parts.lib.mkFlake {inherit inputs;} { diff --git a/home/modules/default.nix b/home/modules/default.nix index 95a5e1d4..0f762fec 100644 --- a/home/modules/default.nix +++ b/home/modules/default.nix @@ -16,6 +16,7 @@ "${userModules}/userd/copyq" "${userModules}/userd/mako" "${userModules}/userd/udiskie" + "${userModules}/userd/gpg" "${userModules}/utils/anyrun" "${userModules}/utils/misc" "${userModules}/utils/rofi" diff --git a/home/modules/userd/gpg/default.nix b/home/modules/userd/gpg/default.nix new file mode 100644 index 00000000..59cfa8a3 --- /dev/null +++ b/home/modules/userd/gpg/default.nix @@ -0,0 +1,18 @@ +{ + config, + lib, + ... +}: let + inherit (lib) mkIf mkEnableOption; + cfg = config.modules.userd.gpg; +in { + options = { + modules.userd.gpg.enable = mkEnableOption "Enables gpg"; + }; + config = mkIf cfg.enable { + services.gpg-agent = { + enable = true; + enableSshSupport = true; + }; + }; +} diff --git a/home/modules/utils/ssh/default.nix b/home/modules/utils/ssh/default.nix index 3d05cd1e..dd9a3a1b 100644 --- a/home/modules/utils/ssh/default.nix +++ b/home/modules/utils/ssh/default.nix @@ -12,6 +12,7 @@ in { config = mkIf cfg.enable { programs.ssh = { enable = true; + userKnownHostsFile = "~/.ssh/known_hosts"; }; }; } diff --git a/home/users/cnst/modules.nix b/home/users/cnst/modules.nix index 737f3143..754c9279 100644 --- a/home/users/cnst/modules.nix +++ b/home/users/cnst/modules.nix @@ -53,6 +53,10 @@ copyq = { enable = true; }; + gpg = { + enable = true; + }; + mako = { enable = true; }; diff --git a/home/users/cnst/shell.nix b/home/users/cnst/shell.nix index e05d624e..301049a7 100644 --- a/home/users/cnst/shell.nix +++ b/home/users/cnst/shell.nix @@ -83,10 +83,6 @@ in { ZSH_THEME_VIRTUALENV_SUFFIX=$ZSH_THEME_VIRTUAL_ENV_PROMPT_SUFFIX ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=241' - ${lib.optionalString config.services.gpg-agent.enable '' - gnupg_path=$(ls $XDG_RUNTIME_DIR/gnupg) - export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/gnupg/$gnupg_path/S.gpg-agent.ssh" - ''} microfetch ''; };