about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/common/emacs/default.nix41
-rw-r--r--modules/common/emacs/doom/config.el70
-rw-r--r--modules/common/emacs/doom/packages.el6
-rw-r--r--modules/common/profiles/headful.nix44
-rw-r--r--modules/nixos/beets.nix30
-rw-r--r--modules/nixos/firefox/default.nix1
-rw-r--r--modules/nixos/grafana.nix2
-rw-r--r--modules/nixos/kde.nix1
-rw-r--r--modules/nixos/profiles/headful.nix33
9 files changed, 153 insertions, 75 deletions
diff --git a/modules/common/emacs/default.nix b/modules/common/emacs/default.nix
index 2dbe53f..c89fba5 100644
--- a/modules/common/emacs/default.nix
+++ b/modules/common/emacs/default.nix
@@ -69,7 +69,6 @@ in {
                   json-language-server # :lang (json +lsp)
                   libtool # :term vterm
                   nix-language-server # :lang (nix +lsp)
-                  nixfmt # :lang nix :editor format
                   nodePackages.eslint # :lang (json +lsp)
                   nodePackages.js-beautify # :lang web
                   nodePackages.prettier # :editor format
@@ -127,13 +126,11 @@ in {
               (appendq! auth-sources '("${config.secrets.authinfo.path}"))
 
               ;; Font must be set to N+2 because otherwise it looks too small.
-              (setq doom-font (font-spec :family "${config.fontScheme.monospaceFont.family}"
-                                          :size ${toString (config.fontScheme.monospaceFont.size + 2)})
+              (setq doom-font (font-spec
+                                :family "${config.fontScheme.monospaceFont.family}"
+                                :size ${toString (config.fontScheme.monospaceFont.size + 2)})
                     doom-unicode-font doom-font)
 
-              (setq user-full-name "${my.fullname}"
-                    user-mail-address "${my.email}")
-
               ;; :app irc
               (setq circe-default-nick "${my.username}"
                     circe-default-realname "${my.email}"
@@ -147,6 +144,36 @@ in {
 
               ;; :input japanese
               (setq skk-large-jisyo "${pkgs.skk-dicts}/share/skk/SKK-JISYO.L")
+
+              ;; :lang nix
+              (setq nix-nixfmt-bin "${pkgs.writeShellScript "nixfmt" ''
+                ${pkgs.alejandra}/bin/alejandra --quiet "$@"
+              ''}")
+            '')
+            (with config.hm.accounts.email; let
+              mu4eAccounts = let
+                muAccounts = filter (a: a.mu.enable) (attrValues accounts);
+              in
+                concatMapStringsSep "\n" (a:
+                  with a; let
+                    personalAddresses = concatMapStringsSep " " (v: ''"${v}"'') aliases;
+                  in ''
+                    (set-email-account! "${name}"
+                      '((user-full-name        . "${realName}")
+                        (user-mail-address     . "${address}")
+                        (mu4e-inbox-folder     . "/${name}/${folders.inbox}")
+                        (mu4e-sent-folder      . "/${name}/${folders.sent}")
+                        (mu4e-drafts-folder    . "/${name}/${folders.drafts}")
+                        (mu4e-trash-folder     . "/${name}/${folders.trash}")
+                        (mu4e-refile-folder    . "/${name}/Archive")
+                        (+mu4e-personal-addresses (list ${personalAddresses})))
+                      t)
+                  '')
+                muAccounts;
+            in ''
+              (setq mu4e-root-maildir "${maildirBasePath}")
+
+              ${mu4eAccounts}
             '')
             (builtins.readFile ./doom/config.el)
           ];
@@ -160,7 +187,7 @@ in {
             fi
 
             if [[ ! -d "$DOOMDIR" ]]; then
-              mkdir -p "$DOOMDIR"
+              mkdir -p "$DOOMDIR/snippets"
             fi
 
             if [[ -x "$EMACSDIR/bin/doom" ]]; then
diff --git a/modules/common/emacs/doom/config.el b/modules/common/emacs/doom/config.el
index 502ca27..4863792 100644
--- a/modules/common/emacs/doom/config.el
+++ b/modules/common/emacs/doom/config.el
@@ -84,8 +84,6 @@
 ;;; Nix
 ;;
 
-(setq nix-nixfmt-bin "alejandra")
-
 (after! lsp-mode
   (add-to-list 'lsp-language-id-configuration '(nix-mode . "nix"))
   (lsp-register-client
@@ -100,9 +98,9 @@
 (add-hook! 'yaml-mode-hook
   (defun +disable-flycheck-for-yaml-helm-templates ()
     (when (and buffer-file-name
-              (string-match-p "/templates/" buffer-file-name)
-              (or (string-suffix-p ".yaml" buffer-file-name)
-                  (string-suffix-p ".yml" buffer-file-name)))
+               (string-match-p "/templates/" buffer-file-name)
+               (or (string-suffix-p ".yaml" buffer-file-name)
+                   (string-suffix-p ".yml" buffer-file-name)))
       (remove-hook! 'yaml-mode-local-vars-hook #'lsp!)
       (pushnew! flycheck-disabled-checkers 'yaml-jsyaml 'yaml-ruby 'yaml-yamllint))))
 
@@ -126,66 +124,42 @@
 (setq mu4e-root-maildir "~/mail"
       mu4e-context-policy 'ask-if-none
       mu4e-compose-context-policy 'always-ask
-      mu4e-compose--org-msg-toggle-next nil
       mu4e-update-interval 60
       sendmail-program (executable-find "msmtp")
-      send-mail-function #'smtpmail-send-it
-      message-sendmail-f-is-evil t
-      message-sendmail-extra-arguments '("--read-envelope-from")
+      send-mail-function #'message-send-mail-with-sendmail
       message-send-mail-function #'message-send-mail-with-sendmail
-      +mu4e-personal-addresses (list "frodo@gondor.net"
-                                     "frodo@rohan.net"
-                                     "azahi@shire.me"
-                                     "admin@shire.me"
-                                     "ceo@shire.me"
-                                     "a.gondor@yahoo.com"
-                                     "a.gondor@yahoo.com"))
-
-(set-email-account! "shire"
-                    '((mu4e-drafts-folder . "/shire/Drafts")
-                      (mu4e-refile-folder . "/shire/Archive")
-                      (mu4e-sent-folder   . "/shire/Sent")
-                      (mu4e-trash-folder  . "/shire/Trash")
-                      (smtpmail-smtp-user . "azahi"))
-                    t)
-
-(set-email-account! "yahoo"
-                    '((mu4e-sent-folder   . "/yahoo/Sent")
-                      (mu4e-drafts-folder . "/yahoo/Drafts")
-                      (mu4e-trash-folder  . "/yahoo/Trash")
-                      (mu4e-refile-folder . "/yahoo/Archive")
-                      (smtpmail-smtp-user . "a.gondor"))
-                    t)
-
-(setq +mu4e-compose-org-msg-toggle-next nil)
+      message-sendmail-envelope-from 'header
+      message-sendmail-extra-arguments '("--read-envelope-from")
+      message-sendmail-f-is-evil t
+      message-kill-buffer-on-exit t)
 
 ;;
 ;;; Circe
 ;;
 
 (defun nixfiles/irc-bouncer-password-f (&rest _)
-  (+pass-get-secret "server/soju.manwe.shire.me/azahi"))
+  (+pass-get-secret "server/soju.manwe.shire.net/azahi"))
 
 (set-irc-server! "libera"
-  `(:host "shire.me"
+  `(:host "shire.net"
     :port 6667
     :user "azahi/libera"
     :pass nixfiles/irc-bouncer-password-f))
 
 (set-irc-server! "oftc"
-  `(:host "shire.me"
+  `(:host "shire.net"
     :port 6667
     :user "azahi/oftc"
     :pass nixfiles/irc-bouncer-password-f))
 
 (set-irc-server! "hackint"
-  `(:host "shire.me"
+  `(:host "shire.net"
     :port 6667
     :user "azahi/hackint"
     :pass nixfiles/irc-bouncer-password-f))
 
 (set-irc-server! "rizon"
-  `(:host "shire.me"
+  `(:host "shire.net"
     :port 6667
     :user "azahi/rizon"
     :pass nixfiles/irc-bouncer-password-f))
@@ -212,14 +186,14 @@
 ;;   :init
 ;;   (setq hledger-input-buffer-height 20))
 
-;; (use-package! kubernetes
-;;   :defer t
-;;   :commands (kubernetes-overview)
-;;   :init (setq kubernetes-poll-frequency 3600
-;;               kubernetes-redraw-frequency 3600))
+(use-package! kubernetes
+  :defer t
+  :commands (kubernetes-overview)
+  :init (setq kubernetes-poll-frequency 3600
+              kubernetes-redraw-frequency 3600))
 
-;; (use-package! kubernetes-evil
-;;   :after kubernetes-overview)
+(use-package! kubernetes-evil
+  :after kubernetes-overview)
 
-;; (use-package! kubernetes-tramp
-;;   :defer t)
+(use-package! kubernetes-tramp
+  :defer t)
diff --git a/modules/common/emacs/doom/packages.el b/modules/common/emacs/doom/packages.el
index 298a203..5df21b6 100644
--- a/modules/common/emacs/doom/packages.el
+++ b/modules/common/emacs/doom/packages.el
@@ -12,6 +12,6 @@
 
 ;; (package! hledger-mode)
 
-;; (package! kubernetes)
-;; (package! kubernetes-evil)
-;; (package! kubernetes-tramp)
+(package! kubernetes)
+(package! kubernetes-evil)
+(package! kubernetes-tramp)
diff --git a/modules/common/profiles/headful.nix b/modules/common/profiles/headful.nix
index 809605c..f2f2487 100644
--- a/modules/common/profiles/headful.nix
+++ b/modules/common/profiles/headful.nix
@@ -57,14 +57,23 @@ in {
                 };
                 msmtp.enable = true;
                 mu.enable = true;
+                thunderbird = {
+                  enable = pkgs.stdenv.isLinux;
+                  settings = id: {
+                    "mail.identity.id_${id}.compose_html" = false;
+                    "mail.identity.id_${id}.reply_on_top" = 0;
+                  };
+                };
               }
               attrs
             ];
 
-          pass = path: "${pkgs.pass}/bin/pass show ${path}";
-        in {
-          shire = mkAccount {
+          pass = path: "${config.hm.programs.password-store.package}/bin/pass show ${path}";
+        in rec {
+          shire = mkAccount rec {
             address = my.email;
+            aliases = [address "frodo@rohan.net" "azahi@shire.net"];
+            realName = my.fullname;
             gpg = {
               inherit (my.pgp) key;
               signByDefault = true;
@@ -73,19 +82,28 @@ in {
 
             primary = true;
 
-            imap.host = "shire.me";
-            smtp.host = "shire.me";
-            userName = "azahi@shire.me";
-            passwordCommand = pass "email/shire.me/azahi";
+            imap = {
+              host = "shire.net";
+              port = 993;
+              tls.enable = true;
+            };
+            smtp = {
+              host = "shire.net";
+              port = 587;
+              tls.enable = true;
+            };
+            userName = "azahi@shire.net";
+            passwordCommand = pass "email/shire.net/azahi";
           };
 
-          yahoo = mkAccount {
-            address = "a.gondor@yahoo.com";
+          yahoo = mkAccount rec {
+            address = "admin@yahoo.com";
+            aliases = [address "admin@yahoo.com"];
+            realName = "Багавиев Азат";
 
-            imap.host = "imap.yahoo.com";
-            smtp.host = "smtp.yahoo.com";
-            userName = "a.gondor@yahoo.com";
-            passwordCommand = pass "email/yahoo.com/a.gondor";
+            flavor = "yahoo.com";
+            userName = "admin@yahoo.com";
+            passwordCommand = pass "email/yahoo.com/admin";
           };
         };
       };
diff --git a/modules/nixos/beets.nix b/modules/nixos/beets.nix
index 83cbff1..7a380cc 100644
--- a/modules/nixos/beets.nix
+++ b/modules/nixos/beets.nix
@@ -13,7 +13,15 @@ in {
     hm = let
       beetsdir = "${config.dirs.data}/beets";
     in {
-      home.sessionVariables.BEETSDIR = beetsdir;
+      home = {
+        activation.initialiseBeets = ''
+          if [[ ! -d "${beetsdir}" ]]; then
+            mkdir -p ${beetsdir}
+          fi
+        '';
+
+        sessionVariables.BEETSDIR = beetsdir;
+      };
 
       programs = {
         beets = {
@@ -22,7 +30,16 @@ in {
           settings = {
             library = "${beetsdir}/library.db";
             directory = config.userDirs.music;
-            plugins = "badfiles edit fetchart info mbsync scrub";
+            plugins = concatStringsSep " " [
+              "badfiles"
+              "edit"
+              "fetchart"
+              "info"
+              "mbsync"
+              "mpdupdate"
+              "scrub"
+              "zero"
+            ];
             original_date = true;
             import = {
               write = true;
@@ -61,8 +78,17 @@ in {
               cautious = true;
               cover_names = "cover Cover folder Folder art Art album Album front Front";
               sources = "filesystem coverart itunes amazon albumart wikipedia";
+              high_resolution = true;
             };
             scrub.auto = true;
+            zero = {
+              fields = "comments genre";
+              update_database = true;
+            };
+            mpd = {
+              host = "127.0.0.1";
+              port = 6600;
+            };
           };
         };
 
diff --git a/modules/nixos/firefox/default.nix b/modules/nixos/firefox/default.nix
index 7038773..4f16767 100644
--- a/modules/nixos/firefox/default.nix
+++ b/modules/nixos/firefox/default.nix
@@ -239,6 +239,7 @@ in {
             "browser.newtabpage.activity-stream.feeds.topsites" = false;
             "browser.newtabpage.introShown" = true;
             "browser.onboarding.enabled" = false;
+            "browser.search.region" = "US";
             "browser.search.update" = false;
             "browser.startup.homepage_welcome_url" = "";
             "browser.startup.homepage_welcome_url.additional" = "";
diff --git a/modules/nixos/grafana.nix b/modules/nixos/grafana.nix
index 0b2e210..e8630c4 100644
--- a/modules/nixos/grafana.nix
+++ b/modules/nixos/grafana.nix
@@ -87,7 +87,7 @@ in {
             };
             smtp = {
               enable = true;
-              user = "azahi@shire.me";
+              user = "azahi@shire.net";
               host = my.domain.shire;
               password = "$__file{${config.secrets.grafana-smtp-password.path}}";
             };
diff --git a/modules/nixos/kde.nix b/modules/nixos/kde.nix
index 66fabbd..a430294 100644
--- a/modules/nixos/kde.nix
+++ b/modules/nixos/kde.nix
@@ -30,6 +30,7 @@ in {
         enable = true;
         excludePackages = with pkgs.plasma5Packages; [
           elisa
+          gwenview
           khelpcenter
           okular
           print-manager
diff --git a/modules/nixos/profiles/headful.nix b/modules/nixos/profiles/headful.nix
index 67bec29..6b19595 100644
--- a/modules/nixos/profiles/headful.nix
+++ b/modules/nixos/profiles/headful.nix
@@ -28,7 +28,38 @@ in {
         tor-browser
       ];
 
-      programs.bash.shellAliases.open = "${pkgs.xdg-utils}/bin/xdg-open";
+      programs = {
+        bash.shellAliases.open = "${pkgs.xdg-utils}/bin/xdg-open";
+
+        thunderbird = {
+          enable = true;
+          profiles.default.isDefault = true;
+          settings = {
+            "app.update.auto" = false;
+            "browser.search.region" = "US";
+            "browser.search.update" = false;
+            "datareporting.healthreport.uploadEnabled" = false;
+            "full-screen-api.warning.delay" = 0;
+            "full-screen-api.warning.timeout" = 0;
+            "general.autoScroll" = true;
+            "general.smoothScroll" = true;
+            "mail.default_send_format" = 0;
+            "mail.tabs.drawInTitlebar" =
+              if config.nixfiles.modules.kde.enable
+              then 1
+              else 0;
+            "mailnews.start_page.url" = "about:blank";
+            "media.autoplay.blocking_policy" = 2;
+            "media.autoplay.default" = 5;
+            "media.autoplay.enabled" = false;
+            "media.hardwaremediakeys.enabled" = false;
+            "network.cookie.cookieBehavior" = 2;
+            "places.history.enabled" = false;
+            "reader.parse-on-load.enabled" = false;
+            "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
+          };
+        };
+      };
     };
 
     boot = {

Consider giving Nix/NixOS a try! <3