From 8520e18ad256ae8e7a7ee1716fddc566b39a1a6b Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Mon, 20 Mar 2023 13:57:57 +0300 Subject: 2023-03-20 --- flake.nix | 22 ++++++-------- lib/default.nix | 2 +- modules/common/emacs/default.nix | 16 +++++----- modules/common/emacs/doom/config.el | 60 +++++++++++++++++-------------------- modules/common/password-store.nix | 2 +- modules/common/profiles/headful.nix | 2 +- modules/nixos/profiles/headful.nix | 5 +++- 7 files changed, 51 insertions(+), 58 deletions(-) diff --git a/flake.nix b/flake.nix index 4eb3fd0..4b5fa34 100644 --- a/flake.nix +++ b/flake.nix @@ -254,13 +254,10 @@ inherit (self.checks.${system}.preCommit) shellHook; }; - formatter = pkgs.writeShellApplication { - name = "fmt"; - runtimeInputs = with pkgs; [alejandra]; - text = '' - alejandra --quiet "$@" + formatter = with pkgs; + writeShellScriptBin "fmt" '' + ${alejandra}/bin/alejandra --quiet "$@" ''; - }; checks.preCommit = pre-commit-hooks.lib.${system}.run { src = ./.; @@ -283,20 +280,19 @@ settings.deadnix.edit = true; }; }) - // { + // (let + importConfigurations = dir: import dir {inherit inputs lib;}; + in { inherit lib; modules.nixfiles = import ./modules/common; nixosModules.nixfiles = import ./modules/nixos; - nixosConfigurations = - import ./nixosConfigurations {inherit inputs lib;}; + nixosConfigurations = importConfigurations ./nixosConfigurations; darwinModules.nixfiles = import ./modules/darwin; - darwinConfigurations = - import ./darwinConfigurations {inherit inputs lib;}; + darwinConfigurations = importConfigurations ./darwinConfigurations; - # TODO Make it so that self.packages also can use this. overlays.default = final: _: { bruh = final.callPackage ./packages/bruh.nix {}; mpv-autosub = final.callPackage ./packages/mpv-autosub.nix {}; @@ -304,5 +300,5 @@ nixfiles = final.callPackage ./packages/nixfiles.nix {}; throttled = final.callPackage ./packages/throttled.nix {}; }; - }; + }); } diff --git a/lib/default.nix b/lib/default.nix index da4b4d2..9e9cc1a 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -30,7 +30,7 @@ lib: _: rec { assert min <= ini && ini <= max; lib.concatMapStrings (x: toString x + " ") (map (pow 2) [min ini max]); - # TODO Move this somehow to the NGINX module itself. + # TODO Move this to the NGINX module. nginxInternalOnly = '' if ($internal != 1) { return 403; diff --git a/modules/common/emacs/default.nix b/modules/common/emacs/default.nix index c89fba5..3be560e 100644 --- a/modules/common/emacs/default.nix +++ b/modules/common/emacs/default.nix @@ -159,14 +159,14 @@ in { 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}))) + '((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 . (${personalAddresses}))) t) '') muAccounts; diff --git a/modules/common/emacs/doom/config.el b/modules/common/emacs/doom/config.el index 4863792..589b993 100644 --- a/modules/common/emacs/doom/config.el +++ b/modules/common/emacs/doom/config.el @@ -32,29 +32,27 @@ ;;; Org ;; -(setq org-directory "~/doc/org/") -(after! org - (setq org-todo-keywords '((sequence - "PROJ(p)" ; A master task. - "TODO(t)" ; A task that needs to be done with statues: - "STRT(s@)" ; - In progress. - "HOLD(l@/!)" ; - Paused because of me. - "WAIT(w@/!)" ; - Paused because of not me. - "|" - "DONE(d@/!)" ; Complete state. - "KILL(k@/!)")) ; Incomplete state. - org-todo-keyword-faces '(("PROJ" . +org-todo-project) - ("TODO" . +org-todo-active) - ("STRT" . +org-todo-active) - ("HOLD" . +org-todo-onhold) - ("WAIT" . +org-todo-onhold) - ("DONE" . +org-todo-cancel) - ("KILL" . +org-todo-cancel)))) +(setq org-directory "~/doc/org/" + org-todo-keywords '((sequence + "PROJ(p)" ; A master task. + "TODO(t)" ; A task that needs to be done with statues: + "STRT(s@)" ; - In progress. + "HOLD(l@/!)" ; - Paused because of me. + "WAIT(w@/!)" ; - Paused because of not me. + "|" + "DONE(d@/!)" ; Complete state. + "KILL(k@/!)")) ; Incomplete state. + org-todo-keyword-faces '(("PROJ" . +org-todo-project) + ("TODO" . +org-todo-active) + ("STRT" . +org-todo-active) + ("HOLD" . +org-todo-onhold) + ("WAIT" . +org-todo-onhold) + ("DONE" . +org-todo-cancel) + ("KILL" . +org-todo-cancel))) (add-hook! 'org-mode-hook 'auto-fill-mode) -(add-hook! 'org-mode-hook (lambda (&rest _) - (setq fill-column 80))) +(setq-hook! 'org-mode-hook fill-column 80) (setq org-roam-directory "~/doc/roam/" org-roam-db-location (concat org-roam-directory ".db")) @@ -72,7 +70,7 @@ ;;; Elisp ;; -(setq-default flycheck-disabled-checkers '(emacs-lisp-checkdoc)) +(pushnew! flycheck-disabled-checkers 'emacs-lisp-checkdoc) ;; ;;; Haskell @@ -96,7 +94,7 @@ ;; (add-hook! 'yaml-mode-hook - (defun +disable-flycheck-for-yaml-helm-templates () + (defun nixfiles/disable-flycheck-for-helm-templates-h () (when (and buffer-file-name (string-match-p "/templates/" buffer-file-name) (or (string-suffix-p ".yaml" buffer-file-name) @@ -121,17 +119,13 @@ ;;; mu4e ;; -(setq mu4e-root-maildir "~/mail" - mu4e-context-policy 'ask-if-none - mu4e-compose-context-policy 'always-ask - mu4e-update-interval 60 - sendmail-program (executable-find "msmtp") - send-mail-function #'message-send-mail-with-sendmail - message-send-mail-function #'message-send-mail-with-sendmail - message-sendmail-envelope-from 'header - message-sendmail-extra-arguments '("--read-envelope-from") - message-sendmail-f-is-evil t - message-kill-buffer-on-exit t) +(setq-hook! 'mu4e-main-mode-hook mu4e-update-interval 60) + +(setq-hook! 'mu4e-compose-mode-hook sendmail-program (executable-find "msmtp") + send-mail-function #'sendmail-send-it + message-send-mail-function #'message-send-mail-with-sendmail + message-sendmail-extra-arguments '("--read-envelope-from") + message-sendmail-f-is-evil t) ;; ;;; Circe diff --git a/modules/common/password-store.nix b/modules/common/password-store.nix index 1de8a55..c9a71ce 100644 --- a/modules/common/password-store.nix +++ b/modules/common/password-store.nix @@ -20,7 +20,7 @@ in { settings.PASSWORD_STORE_DIR = "${config.my.home}/.password-store"; }; - # https://github.com/NixOS/nixpkgs/issues/183604 + # HACK https://github.com/NixOS/nixpkgs/issues/183604 bash.initExtra = let completions = "${config.hm.programs.password-store.package}/share/bash-completion/completions"; in diff --git a/modules/common/profiles/headful.nix b/modules/common/profiles/headful.nix index f2f2487..fe9c794 100644 --- a/modules/common/profiles/headful.nix +++ b/modules/common/profiles/headful.nix @@ -89,7 +89,7 @@ in { }; smtp = { host = "shire.net"; - port = 587; + port = 465; tls.enable = true; }; userName = "azahi@shire.net"; diff --git a/modules/nixos/profiles/headful.nix b/modules/nixos/profiles/headful.nix index 6b19595..610f3c7 100644 --- a/modules/nixos/profiles/headful.nix +++ b/modules/nixos/profiles/headful.nix @@ -33,7 +33,10 @@ in { thunderbird = { enable = true; - profiles.default.isDefault = true; + profiles.default = { + isDefault = true; + withExternalGnupg = true; + }; settings = { "app.update.auto" = false; "browser.search.region" = "US"; -- cgit 1.4.1