From 57252af57b3afb9acf2e03acb647262a9ffbe415 Mon Sep 17 00:00:00 2001 From: Gabe Venberg Date: Sat, 30 Mar 2024 19:43:52 -0500 Subject: [PATCH] added tiny irc client. This involved setting up the pass password manager to manage secrets, which in turn required setting up gpg, which needed syncthing to sync keys. --- modules/home-manager/terminal/default.nix | 5 ++- modules/home-manager/terminal/gpg.nix | 13 +++++++ .../home-manager/terminal/nushell/default.nix | 1 + modules/home-manager/terminal/nushell/env.nu | 3 +- modules/home-manager/terminal/pass.nix | 14 +++++++ modules/home-manager/terminal/tiny-irc.nix | 38 +++++++++++++++++++ modules/home-manager/terminal/zsh.nix | 1 + 7 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 modules/home-manager/terminal/gpg.nix create mode 100644 modules/home-manager/terminal/pass.nix create mode 100644 modules/home-manager/terminal/tiny-irc.nix diff --git a/modules/home-manager/terminal/default.nix b/modules/home-manager/terminal/default.nix index 02341fd..b0e0182 100644 --- a/modules/home-manager/terminal/default.nix +++ b/modules/home-manager/terminal/default.nix @@ -46,6 +46,9 @@ ./voice.nix ./nvim ./zellij + ./tiny-irc.nix + ./pass.nix + ./gpg.nix ]; programs = { @@ -62,5 +65,5 @@ }; }; - services.ssh-agent.enable = true; + services.syncthing.enable = true; } diff --git a/modules/home-manager/terminal/gpg.nix b/modules/home-manager/terminal/gpg.nix new file mode 100644 index 0000000..ff5f8eb --- /dev/null +++ b/modules/home-manager/terminal/gpg.nix @@ -0,0 +1,13 @@ +{ + config, + pkgs, + lib, + ... +}: { + programs.gpg.enable = true; + + services.gpg-agent={ + enable=true; + enableSshSupport = true; + }; +} diff --git a/modules/home-manager/terminal/nushell/default.nix b/modules/home-manager/terminal/nushell/default.nix index 9a4543f..a1680ad 100644 --- a/modules/home-manager/terminal/nushell/default.nix +++ b/modules/home-manager/terminal/nushell/default.nix @@ -22,6 +22,7 @@ enableNushellIntegration = true; }; programs.direnv.enableNushellIntegration = true; + services.gpg-agent.enableNushellIntegration = true; services.pueue = { enable = true; diff --git a/modules/home-manager/terminal/nushell/env.nu b/modules/home-manager/terminal/nushell/env.nu index ec4c366..2b3b764 100644 --- a/modules/home-manager/terminal/nushell/env.nu +++ b/modules/home-manager/terminal/nushell/env.nu @@ -21,7 +21,8 @@ $env.EDITOR = nvim $env.VISUAL = nvim $env.PIPENV_VENV_IN_PROJECT = 1 $env.POETRY_VIRTUALENVS_IN_PROJECT = 1 -$env.SSH_AUTH_SOCK = $"($env.XDG_RUNTIME_DIR)/ssh-agent" +$env.XDG_DATA_HOME = ( $env.HOME | path join ".local" "share" ) +$env.PASSWORD_STORE_DIR = ($env.XDG_DATA_HOME | path join "password-store") $env.NU_LIB_DIRS = [ ... diff --git a/modules/home-manager/terminal/pass.nix b/modules/home-manager/terminal/pass.nix new file mode 100644 index 0000000..c05ed3a --- /dev/null +++ b/modules/home-manager/terminal/pass.nix @@ -0,0 +1,14 @@ +{ + config, + pkgs, + lib, + ... +}: { + programs.password-store = { + enable = true; + }; + + home.packages = with pkgs; [ + ripasso-cursive + ]; +} diff --git a/modules/home-manager/terminal/tiny-irc.nix b/modules/home-manager/terminal/tiny-irc.nix new file mode 100644 index 0000000..e650ec4 --- /dev/null +++ b/modules/home-manager/terminal/tiny-irc.nix @@ -0,0 +1,38 @@ +{ + config, + pkgs, + lib, + ... +}: { + programs.tiny = { + enable = true; + settings = { + servers = [ + { + addr = "irc.libera.chat"; + port = 6697; + tls = true; + realname = "Gabe Venberg"; + nicks = ["toric"]; + join = [ + "#libera" + "#linux" + "#lobsters" + "#nixos" + ]; + sasl = { + username="toric"; + password={ + command= "pass show libera"; + }; + }; + } + ]; + defaults = { + nicks = ["toric"]; + realname = "Gabe Venberg"; + tls = true; + }; + }; + }; +} diff --git a/modules/home-manager/terminal/zsh.nix b/modules/home-manager/terminal/zsh.nix index c77dbb4..a96dca9 100644 --- a/modules/home-manager/terminal/zsh.nix +++ b/modules/home-manager/terminal/zsh.nix @@ -10,6 +10,7 @@ programs.carapace.enableZshIntegration = true; programs.direnv.enableZshIntegration = true; programs.kitty.shellIntegration.enableZshIntegration = true; + services.gpg-agent.enableZshIntegration = true; programs.zsh = { enable = true; enableCompletion = true;