about summary refs log tree commit diff
path: root/modules/common
diff options
context:
space:
mode:
authorAzat Bahawi <azat@bahawi.net>2023-11-16 01:47:45 +0300
committerAzat Bahawi <azat@bahawi.net>2023-11-16 01:47:45 +0300
commit1b39cfb14b608f374208a9483db661ccd1a43230 (patch)
treebe2fefbe6c50f4598a1eb22f8b0a9260726b2c0a /modules/common
parent2023-11-13 (diff)
2023-11-16
Diffstat (limited to 'modules/common')
-rw-r--r--modules/common/emacs/default.nix86
-rw-r--r--modules/common/emacs/doom/config.el17
-rw-r--r--modules/common/emacs/doom/init.el6
-rw-r--r--modules/common/emacs/doom/packages.el3
-rw-r--r--modules/common/profiles/dev/containers.nix3
-rw-r--r--modules/common/profiles/dev/default.nix6
-rw-r--r--modules/common/profiles/dev/sql.nix14
7 files changed, 82 insertions, 53 deletions
diff --git a/modules/common/emacs/default.nix b/modules/common/emacs/default.nix
index c5cf7ed..b16fb83 100644
--- a/modules/common/emacs/default.nix
+++ b/modules/common/emacs/default.nix
@@ -58,36 +58,28 @@ in {
           text = concatLines [
             (
               let
-                # NOTE gopls will require the "go" executable which must be provided
-                # by the project's flake/shell.
                 extraBins = with pkgs;
                   [
                     (aspellWithDicts (p: with p; [en ru])) # :checkers (spell +aspell)
-                    (python3.withPackages (p:
-                      with p; [
-                        black # :lang python :editor format
-                        isort # :lang python
-                        pyflakes # :lang python
-                        python-lsp-server # :lang (python +lsp)
-                      ]))
                     asmfmt # :editor format
+                    cargo # :lang rust
                     clang-tools # :lang (cc +lsp) :editor format
-                    cmake # :term vterm
                     cmake-format # :lang cc :editor format
                     cmigemo # :lang japanese
                     dockerfile-language-server-nodejs # :tools (docker +lsp)
-                    dockfmt # :tools docker
+                    dockfmt # :tools docker :editor format
                     editorconfig-core-c # :tools editorconfig
                     fd # doom!
-                    gcc # :tools magit :term vterm
-                    gnumake # :term vterm
+                    ghc # :lang haskell
                     gnuplot # :lang (org +gnuplot)
                     gnutls # doom!
-                    go # :lang go org
+                    go # :lang go
                     gocode # :lang go org
+                    godef # :lang go
                     gomodifytags # :lang go
                     gopls # :lang (go +lsp)
                     gore # :lang go
+                    gotests # :lang go
                     gotools # :lang go
                     graphviz # :lang (org +roam2) :lang plantuml
                     haskellPackages.cabal-fmt # :lang haskell :editor format
@@ -95,10 +87,9 @@ in {
                     haskellPackages.haskell-language-server # :lang (haskell +lsp)
                     haskellPackages.hoogle # :lang haskell
                     haskellPackages.ormolu # :lang haskell :editor format
-                    html-tidy # :lang web
+                    html-tidy # :lang web :editor format
                     jre # :lang plantuml
-                    libtool # :term vterm
-                    libxml2 # :lang data
+                    libxml2 # :lang data :editor format
                     nil # :lang (nix +lsp)
                     nodePackages.bash-language-server # :lang (sh +lsp)
                     nodePackages.eslint # :lang (json +lsp)
@@ -107,12 +98,22 @@ in {
                     nodePackages.stylelint # :lang web
                     nodejs # :tools debugger
                     pandoc # :lang org markdown latex
-                    perl # term vterm
                     pinentry-emacs # doom!
+                    pipenv # :lang python
                     pre-commit # :tools magit
+                    python3 # :lang python
+                    python3Packages.black # :lang python :editor format
+                    python3Packages.isort # :lang python :editor format
+                    python3Packages.nose # :lang python
+                    python3Packages.pyflakes # :lang python :editor format
+                    python3Packages.pytest # :lang python
+                    python3Packages.python-lsp-server # :lang python :editor format
+                    racket # :lang racket :editor format
                     ripgrep # doom!
                     rust-analyzer # :lang (rust +lsp)
+                    rustc # :lang rust
                     rustfmt # :lang rust
+                    sbcl # :lang common-lisp
                     shellcheck # :lang sh
                     shfmt # :lang sh :editor format
                     sqlite # :lang (org +roam2) :tools lookup
@@ -121,6 +122,7 @@ in {
                     unzip # :tools debugger
                     wordnet # :tools (lookup +dictionary +offline)
                     yaml-language-server # :lang (yaml +lsp)
+                    zig # :lang zig :editor format
                     zls # :lang (zig +lsp)
                     zstd # :emacs undo
                   ]
@@ -142,7 +144,7 @@ in {
                   concatMapStringsSep ":" (x: "${x}/bin") extraBins
                 }"))
 
-                (appendq! auth-sources '("${config.secrets.authinfo.path}"))
+                (appendq! auth-sources '(("${config.secrets.authinfo.path}")))
 
                 ;; The font must be set to n+2, otherwise it looks too small.
                 (setq doom-font (font-spec
@@ -165,7 +167,7 @@ in {
                 (setq migemo-dictionary "${pkgs.cmigemo}/share/migemo/utf-8/migemo-dict")
 
                 ;; :input japanese
-                ;; (setq skk-large-jisyo "${pkgs.skk-dicts}/share/skk/SKK-JISYO.L")
+                (setq skk-large-jisyo "${pkgs.skk-dicts}/share/skk/SKK-JISYO.L")
 
                 ;; :lang nix
                 (setq nix-nixfmt-bin "${pkgs.writeShellScript "nixfmt" ''
@@ -210,7 +212,49 @@ in {
 
       programs.emacs = {
         enable = true;
-        package = pkgs.emacs29; # Pin to avoid surprises.
+        package =
+          (pkgs.emacs29.override (finalAttrs: {
+            stdenv = with pkgs;
+              useMoldLinker
+              (withCFlags ["-O2"]
+                (impureUseNativeOptimizations finalAttrs.stdenv));
+          }))
+          .overrideAttrs (_: final: {
+            configureFlags =
+              final.configureFlags
+              ++ [
+                "--without-mailutils"
+                "--without-pop"
+              ];
+          });
+        # TODO https://github.com/NixOS/nixpkgs/issues/267548
+        # packageX = let
+        #   emacs = "emacs29"; # Pin the version to avoid surprises.
+        # in
+        #   (pkgs.${emacs}.pkgs.overrideScope
+        #     (_: super: {
+        #       emacs =
+        #         (pkgs.${emacs}.override (finalAttrs: {
+        #           stdenv = with pkgs;
+        #             useMoldLinker
+        #             (withCFlags ["-O2"]
+        #               (impureUseNativeOptimizations finalAttrs.stdenv));
+        #         }))
+        #         .overrideAttrs (_: final: {
+        #           configureFlags =
+        #             final.configureFlags
+        #             ++ [
+        #               "--without-mailutils"
+        #               "--without-pop"
+        #             ];
+        #         });
+        #     }))
+        #   .withPackages (p:
+        #     with p; [
+        #       emacsql # :tools magit
+        #       mu4e # :email mu4e
+        #       vterm # :term vterm
+        #     ]);
       };
     };
   };
diff --git a/modules/common/emacs/doom/config.el b/modules/common/emacs/doom/config.el
index 7cecfba..257a3ea 100644
--- a/modules/common/emacs/doom/config.el
+++ b/modules/common/emacs/doom/config.el
@@ -29,7 +29,7 @@
 
 (setq lsp-enable-suggest-server-download nil
       lsp-enable-file-watchers t
-      lsp-file-watch-threshold 2048
+      lsp-file-watch-threshold 4096
       lsp-modeline-code-actions-enable nil)
 
 ;;
@@ -154,7 +154,7 @@
 
 (setq elfeed-db-directory "~/.elfeed"
       elfeed-enclosure-default-dir (concat elfeed-db-directory "/enclosures")
-      rmh-elfeed-org-files (list (concat elfeed-db-directory "/index.org"))
+      rmh-elfeed-org-files '((concat elfeed-db-directory "/index.org"))
       elfeed-goodies/powerline-default-separator nil
       elfeed-goodies/entry-pane-size 0.75
       elfeed-goodies/entry-pane-position 'bottom)
@@ -213,16 +213,3 @@
                                  (setq-local company-idle-delay 0.1))))
   :init
   (setq hledger-input-buffer-height 20))
-
-;;
-;;; Kubernetes
-;;
-
-(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)
diff --git a/modules/common/emacs/doom/init.el b/modules/common/emacs/doom/init.el
index 0acd008..3796fac 100644
--- a/modules/common/emacs/doom/init.el
+++ b/modules/common/emacs/doom/init.el
@@ -81,7 +81,7 @@
        (dhall +lsp +tree-sitter)
        (emacs-lisp +lsp +tree-sitter)
        (go +lsp +tree-sitter)
-       (:if IS-LINUX (haskell +lsp +tree-sitter))
+       (haskell +lsp +tree-sitter)
        (java +lsp +tree-sitter)
        (javascript +lsp +tree-sitter)
        (json +lsp +tree-sitter)
@@ -92,9 +92,9 @@
        (org +pandoc +roam2)
        plantuml
        (python +lsp +tree-sitter)
-       (:if IS-LINUX (racket +lsp +tree-sitter))
+       (racket +lsp +tree-sitter)
        (rust +lsp +tree-sitter)
-       (:if IS-LINUX (scheme +lsp +tree-sitter +racket))
+       (scheme +lsp +tree-sitter +racket)
        (sh +lsp +tree-sitter)
        web
        (yaml +lsp +tree-sitter)
diff --git a/modules/common/emacs/doom/packages.el b/modules/common/emacs/doom/packages.el
index 61ac680..26a1d31 100644
--- a/modules/common/emacs/doom/packages.el
+++ b/modules/common/emacs/doom/packages.el
@@ -10,6 +10,3 @@
            :branch "main"))
 
 (package! hledger-mode)
-
-(package! kubernetes)
-(package! kubernetes-evil)
diff --git a/modules/common/profiles/dev/containers.nix b/modules/common/profiles/dev/containers.nix
index 61a9f09..38852ad 100644
--- a/modules/common/profiles/dev/containers.nix
+++ b/modules/common/profiles/dev/containers.nix
@@ -44,7 +44,6 @@ in {
           kubelogin-oidc
           kubent
           kubernetes-helm
-          # kubescape
           kubeseal
           kubespy
           minikube
@@ -57,7 +56,7 @@ in {
       };
 
       programs.bash = {
-        shellAliases = with pkgs; {
+        shellAliases = {
           b = "buildah";
           h = "helm";
           k = "kubectl";
diff --git a/modules/common/profiles/dev/default.nix b/modules/common/profiles/dev/default.nix
index 4f2a80f..4c52961 100644
--- a/modules/common/profiles/dev/default.nix
+++ b/modules/common/profiles/dev/default.nix
@@ -45,11 +45,11 @@ in {
 
         ".stack/global-project/stack.yaml".text = generators.toYAML {} {
           packages = [];
-          resolver = "lts-20.14";
+          resolver = "lts-21.20";
         };
       };
 
-      sessionVariables = with config.dirs; rec {
+      sessionVariables = rec {
         CABAL_DIR = "${config.my.home}/.cabal";
         CABAL_CONFIG = pkgs.writeText "cabal-config" ''
           repository hackage.haskell.org
@@ -87,6 +87,8 @@ in {
         yq
         htmlq
         sops
+        httpie
+        logcli
       ];
     };
   };
diff --git a/modules/common/profiles/dev/sql.nix b/modules/common/profiles/dev/sql.nix
index 7a2a09c..6a32a76 100644
--- a/modules/common/profiles/dev/sql.nix
+++ b/modules/common/profiles/dev/sql.nix
@@ -73,25 +73,25 @@ in {
           {
             name = "pgcli";
             custom = {
+              prompt = "'\\u@\\h:\\d> '";
+              multi_line_mode = "psql";
+              on_error = "STOP";
               auto_expand = "True";
-              casing_file = "/dev/null";
               expand = "True";
-              history_file = "/dev/null";
               keyring = "False";
-              multi_line_mode = "psql";
-              on_error = "STOP";
-              prompt = "'\\u@\\h:\\d> '";
               vi = "True";
+              casing_file = "/dev/null";
+              history_file = "/dev/null";
             };
           }
           {
             name = "litecli";
             custom = {
-              audit_log = "/dev/null";
-              key_bindings = "vi";
               prompt = "'\\d> '";
               prompt_continuation = "'-> '";
               auto_vertical_output = "True";
+              key_bindings = "vi";
+              audit_log = "/dev/null";
             };
           }
         ]);

Consider giving Nix/NixOS a try! <3