flake

Francesco Saccone's Nix flake.
git clone https://git.francescosaccone.com/flake
Log | Files | Refs | README | LICENSE

commit c870ac8523391ab3847ab6e902fb7ece77c5b32e
parent 969d41ec3439a52189b336353d0ed55cfaea0b89
Author: Francesco Saccone <francesco@francescosaccone.com>
Date:   Thu, 15 May 2025 10:17:17 +0200

feat: remove amfora module

Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>

Diffstat:
Mhosts/laptop/home/default.nix | 10----------
Dmodules/home-manager/amfora/default.nix | 177-------------------------------------------------------------------------------
Mmodules/home-manager/default.nix | 1-
3 files changed, 0 insertions(+), 188 deletions(-)

diff --git a/hosts/laptop/home/default.nix b/hosts/laptop/home/default.nix @@ -27,16 +27,6 @@ username = "francesco%40francescosaccone.com"; }; }; - amfora = { - enable = true; - certificates = [ - { - host = "bbs.geminispace.org"; - certificate = ./gemini/cert.pem; - gpgEncryptedKey = ./gemini/key.pem.gpg; - } - ]; - }; git = { enable = true; name = "Francesco Saccone"; diff --git a/modules/home-manager/amfora/default.nix b/modules/home-manager/amfora/default.nix @@ -1,177 +0,0 @@ -{ - lib, - options, - config, - pkgs, - ... -}: -{ - options.modules.amfora = { - enable = lib.mkOption { - description = "Whether to enable Amfora."; - default = false; - type = lib.types.bool; - }; - certificates = lib.mkOption { - description = "The list of client certificates configurations per host."; - default = [ ]; - type = - lib.types.submodule { - options = { - host = lib.mkOption { - description = '' - The domain name where the client certificate is used. - ''; - type = lib.types.uniq lib.types.str; - }; - certificate = lib.mkOption { - description = "The certificate file."; - type = lib.types.uniq lib.types.path; - }; - gpgEncryptedKey = lib.mkOption { - description = '' - The key file, GPG encryped with the primary key specified in - the GPG module. - ''; - type = lib.types.uniq lib.types.path; - }; - }; - } - |> lib.types.listOf; - }; - }; - - config = lib.mkIf config.modules.amfora.enable { - home = { - packages = [ pkgs.amfora ]; - shellAliases = - let - inherit (config.modules) gpg; - inherit (config.modules.amfora) certificates; - certificatesIsEmpty = builtins.length certificates == 0; - in - lib.mkIf (gpg.enable && !certificatesIsEmpty) { - "amfora" = - let - decryptKeys = - certificates - |> builtins.map ( - { - host, - certificate, - gpgEncryptedKey, - }: - let - cacheDirectory = "${config.home.homeDirectory}/.cache"; - output = "${cacheDirectory}/amfora/keys/${host}"; - in - '' - ${pkgs.sbase}/bin/mkdir -p ${builtins.dirOf output} - - ${pkgs.gnupg}/bin/gpg -r "${gpg.primaryKey.fingerprint}" \ - -d ${gpgEncryptedKey} > ${output} - '' - ) - |> builtins.concatStringsSep "\n" - |> pkgs.writeShellScriptBin "decrypt-keys"; - in - "${decryptKeys}/bin/decrypt-keys && ${pkgs.amfora}/bin/amfora"; - }; - file = - let - authSection = - let - certs = - config.modules.amfora.certificates - |> builtins.map ( - { - host, - certificate, - ... - }: - '' - "${host}" = '${certificate}' - '' - ) - |> builtins.concatStringsSep "\n"; - keys = - config.modules.amfora.certificates - |> builtins.map ( - { - host, - ... - }: - let - cacheDirectory = "${config.home.homeDirectory}/.cache"; - in - '' - "${host}" = '${cacheDirectory}/amfora/keys/${host}' - '' - ) - |> builtins.concatStringsSep "\n"; - in - if config.modules.gpg.enable then - '' - [auth] - [auth.certs] - ${certs} - - [auth.keys] - ${keys} - '' - else - lib.warn '' - Since the GPG module was not enabled, the client certificates - were not enabled for Anfora. - '' ""; - in - { - ".config/amfora/config.toml".text = '' - ${authSection} - - [a-general] - home = "gemini://geminiprotocol.net" - auto_redirect = false - http = [ '${pkgs.ladybird}/bin/Ladybird' ] - search = "gemini://tlgs.one/search" - color = true - ansi = true - highlight_code = true - highlight_style = "monokai" - bullets = true - show_link = false - max_width = 80 - downloads = '${config.home.homeDirectory}/downloads' - page_max_size = 2097152 # 2 MiB - page_max_time = 10 # seconds - scrollbar = "auto" - underline = true - - [keybindings] - bind_search = "/" - bind_next_match = "n" - bind_prev_match = "N" - - [url-handlers] - other = 'default' - - [url-prompts] - other = true - gemini = false - - [cache] - max_size = 0 - max_pages = 30 - timeout = 1800 # 30 mins - - [subscriptions] - popup = true - update_interval = 1800 # 30 mins - workers = 10 - entries_per_page = 20 - header = false - ''; - }; - }; - }; -} diff --git a/modules/home-manager/default.nix b/modules/home-manager/default.nix @@ -4,7 +4,6 @@ { imports = [ ./aerc - ./amfora ./git ./gpg ./newsraft