~vonfry/dotfiles

fa912c03ca59d02b33ac45e1c294ba4a11018fec — Vonfry 5 months ago 1f87dc3 + 24f20d5 20220701
Merge branch 'release/20220701'
M etc/nixos/modules/network.nix => etc/nixos/modules/network.nix +1 -1
@@ 25,7 25,7 @@ in {
      };
      networkmanager = {
        enable = mkDefault true;
        dhcp = "dhcpcd";
        dhcp = "internal";
      };
    };


M etc/nixos/modules/user/development.nix => etc/nixos/modules/user/development.nix +1 -0
@@ 249,6 249,7 @@ in {
          consult-lsp
          project
          ibuffer-project
          consult-flycheck
        ];
      };


M etc/nixos/modules/user/files/emacs.d/core/vonfry-local.el => etc/nixos/modules/user/files/emacs.d/core/vonfry-local.el +2 -2
@@ 28,9 28,9 @@ IMPORTANT!!! You must load the other files by youself. The only files under the 
(defconst vonfry-custom-file-after (expand-file-name "post-custom.el" vonfry-custom-dir)
  "custom for user's emacs. The file is loaded after custom. You can set some variables at here which affect the configure in modules.  You can only custom the var in init file, I think.")

(dolist (dir (list vonfry-cache-dir vonfry-local-dir))
(dolist (dir (list vonfry-cache-dir vonfry-local-dir vonfry-custom-dir))
  (unless (file-exists-p dir)
    (make-directory dir)))
    (make-directory dir t)))

(setq-default custom-file vonfry-custom-file)


M etc/nixos/modules/user/files/emacs.d/core/vonfry-packages.el => etc/nixos/modules/user/files/emacs.d/core/vonfry-packages.el +13 -3
@@ 29,11 29,18 @@

(defconst vonfry-modules-dir (expand-file-name "modules/" vonfry-config-dir))

(defcustom vonfry-package-ensure
  (not (or (executable-find "nixos-rebuild") (executable-find "home-manager")))
  "Whether ensure package is installed by emacs.
If t, package.el is used to install packages automatically."
  :type 'boolean
  :group 'vonfry)

(setq-default
 ;; nix replaces package.el to manage but we also set it.
 package-user-dir (expand-file-name "packages" vonfry-local-dir)
 use-package-always-demand t
 use-package-always-ensure nil)
 use-package-always-ensure vonfry-package-ensure)

;;
;; define some basic packages


@@ 47,6 54,8 @@
  )
  "These are the default basic packages, which are used by modules.")

(package-initialize)

;; load the basic packages
(dolist (pkg vonfry-basic-packages)
  (let ((qpkg `(quote ,pkg)))


@@ 81,12 90,13 @@ This function finds module with the file, and loads it."
  "This function load all modules exclude the modules/submodule(i.e. lang/haskell) name in arguments.

All modules should use function and macro in this file. By default, every modules should have a file named packages.el which is used to define the dependence with `use-package`. This file will be loaded at first for each modules. After all modules' packages.el are loaded, it will load config.el which is used to configure for the module which is the main file for a module.  Finally, the autoload.el will be loaded. It used to load some function for the modules."
  (let* ((module-list '())
  (let* ((flatten-exclude (-flatten exclude))
         (module-list '())
         (regexp-match "^[^\\.].*"))
    (dolist (module (directory-files vonfry-modules-dir nil regexp-match))
        (dolist (submodule (directory-files (expand-file-name module vonfry-modules-dir) nil regexp-match))
          (let ((module-name (concat module "/" submodule)))
            (unless (member module-name exclude)
            (unless (member module-name flatten-exclude)
              (push module-name module-list)))))
    (-map 'vonfry-load-module-config   module-list)
    (-map 'vonfry-load-module-packages module-list)

M etc/nixos/modules/user/files/emacs.d/modules/dev/direnv/packages.el => etc/nixos/modules/user/files/emacs.d/modules/dev/direnv/packages.el +2 -2
@@ 3,6 3,6 @@

(use-package envrc
  :general
  (nmap-leader :infix "'" :keymaps 'envrc-mode-map
    "e" 'envrc-command-map)
  (nmap-leader :keymaps 'envrc-mode-map
    "' e" 'envrc-command-map)
  :hook (emacs-startup . envrc-global-mode))

M etc/nixos/modules/user/files/emacs.d/modules/dev/lsp/packages.el => etc/nixos/modules/user/files/emacs.d/modules/dev/lsp/packages.el +1 -2
@@ 32,8 32,7 @@
    "> L h" 'lsp-lens-hide
    "> l"   'lsp-avy-lens)
  (vmap-leader :keymaps 'lsp-mode-map
    "="   'lsp-format-region
    "> =" 'align-regexp))
    "=" 'lsp-format-region))

(use-package consult-lsp
  :after (lsp-mode consult)

M etc/nixos/modules/user/files/emacs.d/modules/dev/nerd-commenter/packages.el => etc/nixos/modules/user/files/emacs.d/modules/dev/nerd-commenter/packages.el +10 -10
@@ 3,13 3,13 @@

(use-package evil-nerd-commenter
  :general
  (nmap-leader :infix "c" :keymaps 'prog-mode-map
    "i"  'evilnc-comment-or-uncomment-lines
    "l"  'evilnc-quick-comment-or-uncomment-to-the-line
    "c"  'evilnc-copy-and-comment-lines
    "p"  'evilnc-comment-or-uncomment-paragraphs
    "v"  'evilnc-toggle-invert-comment-line-by-line
    "."  'evilnc-copy-and-comment-operator
    "/"  'evilnc-comment-operator)
  (vmap-leader :infix "c" :keymaps 'prog-mode-map
    "r" 'comment-or-uncomment-region))
  (nmap-leader :keymaps 'prog-mode-map
    "c i"  'evilnc-comment-or-uncomment-lines
    "c l"  'evilnc-quick-comment-or-uncomment-to-the-line
    "c c"  'evilnc-copy-and-comment-lines
    "c p"  'evilnc-comment-or-uncomment-paragraphs
    "c v"  'evilnc-toggle-invert-comment-line-by-line
    "c ."  'evilnc-copy-and-comment-operator
    "c /"  'evilnc-comment-operator)
  (vmap-leader :keymaps 'prog-mode-map
    "c r" 'comment-or-uncomment-region))

M etc/nixos/modules/user/files/emacs.d/modules/files/dirvish/packages.el => etc/nixos/modules/user/files/emacs.d/modules/files/dirvish/packages.el +7 -4
@@ 24,13 24,16 @@
  (nmap-leader
    "d"   'dirvish-dwim
    "D d" 'dirvish
    "D D" 'dirvish-dired))
    "D D" 'dired-jump
    "D o" 'dired-jump-other-window))

(use-package dirvish-side :after dirvish
(use-package dirvish-side
  :ensure nil
  :after dirvish
  :general
  (nmap-leader
    "D t" 'dirvish-side))

(use-package dirvish-vc :after (magit dirvish))
(use-package dirvish-vc :ensure nil :after (magit dirvish))

(use-package dirvish-extras :after dirvish)
(use-package dirvish-extras :ensure nil :after dirvish)

M etc/nixos/modules/user/files/emacs.d/modules/files/project/packages.el => etc/nixos/modules/user/files/emacs.d/modules/files/project/packages.el +7 -11
@@ 4,18 4,14 @@
(use-package project
  :custom
  (project-list-file (expand-file-name "projects" vonfry-local-dir))
  :config
  (setq project-switch-commands
        (append project-switch-commands
                '((magit-status "Magit status" ?s)
                  (magit-dispatch "Magit dispatch" ?d))))
  :general
  (nmap-leader "P" project-prefix-map)
  (nmap-leader
    "P !" 'project-shell-command
    "P $" 'project-eshell
    "P f" 'project-find-file
    "P F" 'project-find-dir
    "P d" 'project-dired
    "P b" 'project-switch-to-buffer
    "P p" 'project-switch-project
    "P r" 'project-compile
    "P k" 'project-kill-buffers
    "P /" 'project-search
    "P *" 'project-query-replace-regexp
    "P a" 'project-remember-projects-under
    "P r" 'project-forget-project))
    "P A" 'project-forget-project))

M etc/nixos/modules/user/files/emacs.d/modules/interface/consult/packages.el => etc/nixos/modules/user/files/emacs.d/modules/interface/consult/packages.el +5 -1
@@ 25,7 25,6 @@
    "F p" 'consult-locate
    "F h "'consult-history
    "F ?" 'consult-man
    "q"   'consult-flycheck
    "a"   'consult-ripgrep
    "b"   'consult-buffer
    "<"   'consult-mark


@@ 39,3 38,8 @@
    ";" 'consult-outline)
  (nmap-mode :keymaps 'org-mode-map
    ";" 'consult-org-heading))

(use-package consult-flycheck
  :after (consult flycheck)
  :general
  (nmap-leader "q" 'consult-flycheck))

M etc/nixos/modules/user/files/emacs.d/modules/interface/dashboard/func.el => etc/nixos/modules/user/files/emacs.d/modules/interface/dashboard/func.el +12 -11
@@ 14,14 14,15 @@

(defun +dashboard/set-fortune ()
  (interactive)
  (setq dashboard-footer-messages
        (list
         (replace-regexp-in-string
          (rx (+ (| (| space blank) "\n")))
          " "
          (replace-regexp-in-string
           (rx 27 "[" (* (| digit ";")) alpha (? 29))
           ""
           (shell-command-to-string
            (format "fortune -s %s all"
                    (expand-file-name "fortunes" (xdg-data-home)))))))))
  (when (executable-find "fortune")
    (setq dashboard-footer-messages
          (list
           (replace-regexp-in-string
            (rx (+ (| (| space blank) "\n")))
            " "
            (replace-regexp-in-string
             (rx 27 "[" (* (| digit ";")) alpha (? 29))
             ""
             (shell-command-to-string
              (format "fortune -s %s all"
                      (expand-file-name "fortunes" (xdg-data-home))))))))))

M etc/nixos/modules/user/files/emacs.d/modules/interface/dashboard/packages.el => etc/nixos/modules/user/files/emacs.d/modules/interface/dashboard/packages.el +1 -1
@@ 25,7 25,7 @@
      (,(all-the-icons-material "folder" :height 1.0 :v-adjust 0.0)
       "Files"
       "Files Manager"
       (lambda (&rest _) (ranger)))
       (lambda (&rest _) (dirvish)))
      (,(all-the-icons-material "queue_music" :height 1.0 :v-adjust 0.0)
       "Music"
       "Music Player Daemon"

M etc/nixos/modules/user/files/emacs.d/modules/interface/vertico/packages.el => etc/nixos/modules/user/files/emacs.d/modules/interface/vertico/packages.el +1 -0
@@ 11,6 11,7 @@

(use-package vertico-quick
  :after vertico
  :ensure nil
  :custom
  (vertico-quick1 "aoeui")
  (vertico-quick2 "dhtns")

M etc/nixos/modules/user/files/emacs.d/modules/lang/lisp/packages.el => etc/nixos/modules/user/files/emacs.d/modules/lang/lisp/packages.el +2 -2
@@ 13,8 13,8 @@
    "RET"   'eval-last-sexp
    "' b"   'eval-buffer
    "' f"   'eval-defun)
  (nmap-leader :infix "e"
    "a"   'eval-expression)
  (nmap-leader
    "e a"   'eval-expression)
  (vmap-leader :keymaps 'emacs-lisp-mode-map
    "' r" 'eval-region))


M etc/nixos/modules/user/files/emacs.d/modules/lang/org/packages.el => etc/nixos/modules/user/files/emacs.d/modules/lang/org/packages.el +49 -45
@@ 54,14 54,14 @@
  :general
  ("C-c C" 'org-capture-goto-target)
  ("C-c a" 'org-agenda)
  (nmap-leader :infix "o"
    "t i" 'org-clock-in-last
    "t o" 'org-clock-out
    "t q" 'org-clock-cancel
    "t d" 'org-clock-display
    "t j" 'org-clock-goto)
  (nmap-leader
    "o t i" 'org-clock-in-last
    "o t o" 'org-clock-out
    "o t q" 'org-clock-cancel
    "o t d" 'org-clock-display
    "o t j" 'org-clock-goto)
  (nvmap-mode :keymaps 'org-mode-map
    "/"   'org-occur
    "?"   'org-occur
    "g"   'org-goto
    "L"   'org-store-link
    "@"   'org-set-tags-command


@@ 118,14 118,14 @@
  :ensure nil
  :after org
  :general
  (nmap-leader :infix "o"
    "a" 'org-agenda
    "A" '+org/find-agenda
    "N" '+org/find-notes
    "b" '+org/append-to-agenda-file
    "B" 'append-to-buffer
    "c" 'org-capture
    "k" '+org/open-capture))
  (nmap-leader
    "o a" 'org-agenda
    "o A" '+org/find-agenda
    "o N" '+org/find-notes
    "o b" '+org/append-to-agenda-file
    "o B" 'append-to-buffer
    "o c" 'org-capture
    "o k" '+org/open-capture))

(use-package org-archive
  :ensure nil


@@ 136,8 136,8 @@
(use-package org-web-tools
  :after org
  :general
  (nmap-leader :infix "o"
    "u" 'org-web-tools-read-url-as-org)
  (nmap-leader
    "o u" 'org-web-tools-read-url-as-org)
  (nmap-mode :keymaps 'org-mode-map
   "w o" 'org-web-tools-read-url-as-org
   "w l" 'org-web-tools-insert-link-for-url


@@ 156,19 156,22 @@
  :config
  (setq org-journal-cache-file (expand-file-name "org-journal.cache" vonfry-cache-dir))
  :general
  (nmap-leader :infix "o j"
    "n" 'org-journal-new-entry
    "j" 'org-journal-open-next-entry
    "k" 'org-journal-open-previous-entry
    "/" 'org-journal-search
    "s" 'org-journal-schedule-view))
  (nmap-leader
    "o j n" 'org-journal-new-entry
    "o j j" 'org-journal-open-next-entry
    "o j k" 'org-journal-open-previous-entry
    "o j /" 'org-journal-search
    "o j s" 'org-journal-schedule-view))

(use-package org-ql
  :general
  (nmap-leader
    "o /" 'org-ql-search
    "o T" 'org-ql-view-sidebar
    "o t" 'org-ql-view)
  (nmap-mode :keymaps 'org-mode-map
    "." 'org-ql-search
    "," 'org-ql-view
    ";" 'org-ql-sparse-tree))
    ";" 'org-ql-sparse-tree
    "/" 'org-ql-find))

(use-package org-roam
  :init


@@ 178,14 181,14 @@
  :config
  (org-roam-setup)
  :general
  (nmap-leader :infix "o"
    "n"   'org-roam-node-find
    "C"   'org-roam-capture
    "R m" 'org-roam-setup
    "R M" 'org-roam-teardown
    "R i" 'org-roam-node-insert
    "R b" 'org-roam-db-sync
    "R p" '+org/roam-switch)
  (nmap-leader
    "o n"   'org-roam-node-find
    "o C"   'org-roam-capture
    "o R m" 'org-roam-setup
    "o R M" 'org-roam-teardown
    "o R i" 'org-roam-node-insert
    "o R b" 'org-roam-db-sync
    "o R p" '+org/roam-switch)
  (nmap-mode :keymaps 'org-mode-map
    "r"   'org-roam-buffer-toggle
    "R g" 'org-roam-graph


@@ 194,22 197,23 @@

(use-package org-roam-ui
  :general
  (nmap-leader :infix "o"
    "s" 'org-roam-ui-open)
  (nmap-leader
    "o s" 'org-roam-ui-open)
  :custom
  (org-roam-ui-port 8800))

(use-package ob
  :ensure nil
  :init
  (use-package ob-emacs-lisp)
  (use-package ob-org)
  (use-package ob-emacs-lisp :ensure nil)
  (use-package ob-org :ensure nil)
  (use-package ob-http)
  (use-package ob-haskell)
  (use-package ob-R)
  (use-package ob-latex)
  (use-package ob-sql)
  (use-package ob-sqlite)
  (use-package ob-perl)
  (use-package ob-haskell :ensure nil)
  (use-package ob-R :ensure nil)
  (use-package ob-latex :ensure nil)
  (use-package ob-sql :ensure nil)
  (use-package ob-sqlite :ensure nil)
  (use-package ob-perl :ensure nil)
  :custom
  (org-babel-load-languages '((emacs-lisp . t)
                              (org        . t)


@@ 237,7 241,7 @@

(use-package toc-org
  :config
  (add-to-list 'org-tag-alist '("TOC" . ?T))
  (add-to-list 'org-tag-persistent-alist '("TOC" . ?T))
  :general
  (nmap-mode :keymaps 'org-mode-map
    "T" 'toc-org-mode))

M etc/nixos/modules/user/files/emacs.d/modules/misc/bib/packages.el => etc/nixos/modules/user/files/emacs.d/modules/misc/bib/packages.el +1 -1
@@ 34,4 34,4 @@
    :with nil
    "SPC" "S-SPC"))

(use-package org-ebib :after org)
(use-package org-ebib :ensure nil :after org)

M etc/nixos/modules/user/files/emacs.d/modules/visual/indent-guide/packages.el => etc/nixos/modules/user/files/emacs.d/modules/visual/indent-guide/packages.el +1 -1
@@ 4,5 4,5 @@
(use-package highlight-indent-guides
  :hook (prog-mode . highlight-indent-guides-mode)
  :custom
  (highlight-indent-guides-method 'character)
  (highlight-indent-guides-method 'bitmap)
  (highlight-indent-guides-responsive 'top))

M etc/nixos/modules/user/files/emacs.d/modules/visual/todo/packages.el => etc/nixos/modules/user/files/emacs.d/modules/visual/todo/packages.el +4 -4
@@ 4,7 4,7 @@
(use-package hl-todo
  :hook ((prog-mode TeX-mode) . hl-todo-mode)
  :general
  (nmap-leader :infix "k"
    "p" 'hl-todo-previous
    "n" 'hl-todo-next
    "o" 'hl-todo-occur))
  (nmap-leader
    "k p" 'hl-todo-previous
    "k n" 'hl-todo-next
    "k o" 'hl-todo-occur))

M etc/nixos/modules/x.nix => etc/nixos/modules/x.nix +7 -0
@@ 75,8 75,15 @@ in {
        lockerCommand = "${lockCommand} -n";
      };
      qt5ct.enable = true;
      weylus = {
        enable = true;
        openFirewall = true;
        users = [ "vonfry" ];
      };
    };

    hardware.uinput.enable = true;

    systemd = {
      # Make screen locker in system due to security consider.
      user.services = {