nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit b6faaf421264eb5561dbbff4cf155d3abb6d0dc8
parent 1ad1463f6f8072d204335511e2cec16664d81378
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Tue,  6 Sep 2022 10:02:47 +0300

aerc added to home-manager

Diffstat:
Mmodules/default.nix | 1-
Dmodules/home-manager/programs/aerc.nix | 73-------------------------------------------------------------------------
2 files changed, 0 insertions(+), 74 deletions(-)

diff --git a/modules/default.nix b/modules/default.nix @@ -3,7 +3,6 @@ home-manager = { programs = { - aerc = ./home-manager/programs/aerc.nix; goldendict = ./home-manager/programs/goldendict.nix; gpxsee = ./home-manager/programs/gpxsee.nix; josm = ./home-manager/programs/josm.nix; diff --git a/modules/home-manager/programs/aerc.nix b/modules/home-manager/programs/aerc.nix @@ -1,73 +0,0 @@ -{ config, lib, pkgs, ... }: - -with lib; -let - cfg = config.programs.aerc; - configDir = "${config.xdg.configHome}/aerc"; - - accountConfFile = with cfg; - generators.toINI - { } - { - Personal = { - source = "imaps://${gUsername}:${gPassword}@imap.gmail.com:993"; - outgoing = "smtp+plain://${gUsername}:${gPassword}@smtp.gmail.com:587"; - default = "INBOX"; - smtp-starttls = "yes"; - from = - if fullName != "" then - "${fullName} <${gUsername}@gmail.com>" - else - "${gUsername}@gmail.com"; - copy-to = "Sent"; - }; - }; - - activationScript = '' - $DRY_RUN_CMD install -Dm644 ${pkgs.aerc}/share/aerc/aerc.conf -t ${configDir} - $DRY_RUN_CMD install -Dm644 ${pkgs.aerc}/share/aerc/binds.conf -t ${configDir} - '' + optionalString (cfg.gUsername != "" && cfg.gPassword != "") '' - $DRY_RUN_CMD eval "echo '${accountConfFile}' > ${configDir}/accounts.conf" - $DRY_RUN_CMD chmod 600 ${configDir}/accounts.conf - ''; -in -{ - meta.maintainers = [ maintainers.sikmir ]; - - options.programs.aerc = { - enable = mkEnableOption "aerc is an email client for your terminal"; - - package = mkOption { - type = types.package; - default = pkgs.aerc; - defaultText = literalExpression "pkgs.aerc"; - description = "aerc package to install."; - }; - - gUsername = mkOption { - type = types.str; - default = ""; - description = "Google username."; - }; - - gPassword = mkOption { - type = types.str; - default = ""; - description = "Google app password."; - }; - - fullName = mkOption { - type = types.str; - default = ""; - description = "Full name."; - }; - }; - - config = mkIf cfg.enable { - home.packages = [ cfg.package ]; - - home.activation = { - accountsConf = lib.hm.dag.entryAfter [ "writeBoundary" ] activationScript; - }; - }; -}