Adding nixvim

This commit is contained in:
2025-09-17 11:31:58 -04:00
parent e75178c276
commit 8c1552cdde
8 changed files with 484 additions and 227 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1,4 +1,4 @@
{ config, pkgs, lib, ... }:
{ config, pkgs, lib, inputs, ... }:
{
home.file.".local/usr/bin" = {
@@ -27,7 +27,10 @@
../modules/shells.nix
../modules/tmux.nix
../modules/ranger.nix
inputs.nixvim.homeModules.nixvim
../modules/nixvim/nixvim.nix
];
home.packages = with pkgs; [
autossh
elinks
@@ -85,7 +88,7 @@
)
)
pyenv
neovim
# neovim provided by nixvim
zig
syncthing
lazygit
@@ -103,78 +106,86 @@
httpie
];
programs.neovim.plugins = [
pkgs.vimPlugins.nvim-treesitter.withAllGrammars
pkgs.VimPlugins.coc-nvim
];
programs.taskwarrior = {
enable = true;
programs = {
neovim.plugins = [
pkgs.vimPlugins.nvim-treesitter.withAllGrammars
pkgs.VimPlugins.coc-nvim
];
taskwarrior = {
enable = true;
};
fzf = {
enable = true;
tmux.enableShellIntegration = true;
enableZshIntegration = true;
colors = {
fg = "#d0d0d0";
bg = "#24283b";
hl = "#5f87af";
"fg+" = "#d0d0d0";
"bg+" = "#414868";
"hl+" = "#5fd7ff";
info = "#afaf87";
prompt = "#d7005f";
pointer = "#af5fff";
marker = "#87ff00";
spinner = "#af5fff";
header = "#87afaf";
};
};
git = {
enable = true;
userName = "th3r00t";
userEmail = "tty303@proton.me";
extraConfig = {
commit.gpgSign = true;
gpg.format = "ssh";
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
user.signingkey = "~/.ssh/id_ed25519.pub";
};
};
direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
eza = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
ssh = {
enable = true;
extraConfig = ''
Host *
ServerAliveInterval 30
ServerAliveCountMax 3
AddKeysToAgent yes
'';
matchBlocks = {
samphone = {
host = "10.0.0.153";
user = "u0_a771";
port = 8022;
identityFile = "~/.ssh/id_ed25519";
};
git = {
host = "10.0.0.125";
user = "git";
identityFile = "~/.ssh/id_ed25519";
};
};
};
};
services.syncthing = {
enable = true;
guiAddress = "0.0.0.0:8384";
};
programs.fzf = {
enable = true;
tmux.enableShellIntegration = true;
enableZshIntegration = true;
colors = {
fg = "#d0d0d0";
bg = "#24283b";
hl = "#5f87af";
"fg+" = "#d0d0d0";
"bg+" = "#414868";
"hl+" = "#5fd7ff";
info = "#afaf87";
prompt = "#d7005f";
pointer = "#af5fff";
marker = "#87ff00";
spinner = "#af5fff";
header = "#87afaf";
};
};
programs.git = {
enable = true;
userName = "th3r00t";
userEmail = "tty303@proton.me";
extraConfig = {
commit.gpgSign = true;
gpg.format = "ssh";
gpg.ssh.allowedSignersFile = "~/.ssh/allowed_signers";
user.signingkey = "~/.ssh/id_ed25519.pub";
};
};
programs.direnv = {
enable = true;
enableZshIntegration = true;
nix-direnv.enable = true;
};
programs.eza = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
};
programs.ssh = {
enable = true;
extraConfig = ''
Host *
ServerAliveInterval 30
ServerAliveCountMax 3
AddKeysToAgent yes
'';
matchBlocks = {
samphone = {
host = "10.0.0.153";
user = "u0_a771";
port = 8022;
identityFile = "~/.ssh/id_ed25519";
};
git = {
host = "10.0.0.125";
user = "git";
identityFile = "~/.ssh/id_ed25519";
};
};
};
}

View File

@@ -1,27 +1,18 @@
* Emacs litterate config file
I am using straight as the backend for use package and have thusly set it in
[./early-init.el]
** Use-Package
Install use-package and enable ':ensure t' globally.
#+begin_src emacs-lisp
(straight-use-package 'use-package)
(setq use-package-always-ensure t)
(use-package straight
:custom
(straight-use-package-by-default t))
#+end_src
As a lifetime vim user I need to evil keys set up early
** Overrides
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq custom-file (locate-user-emacs-file "custom-vars.el"))
(load custom-file 'noerror 'nomessage)
(setq global-auto-revert-non-file-buffers 't)
(setq evil-want-keybinding nil)
#+end_src
** Evil Mode
*** Undo-Tree
evil mode requires undo-tree so I have it set to compress the undo files
and enable undo-tree mode globally
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package undo-tree :config
(global-undo-tree-mode)
(setq undo-tree-auto-save-history t)
@@ -32,12 +23,12 @@ and enable undo-tree mode globally
*** goto-chg
It also requires goto-chg
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package goto-chg)
#+end_src
*** Evil Mode
Now I hook in Evil mode
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package evil :config
(evil-mode 1)
(setq evil-search-module 'evil-search)
@@ -54,7 +45,7 @@ Now I hook in Evil mode
(kbd "<leader>e e") 'eval-buffer)
#+end_src
*** Evil Collection
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package evil-collection :after evil
:ensure t
:config
@@ -70,39 +61,41 @@ Now I hook in Evil mode
#+end_src
** UI
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package treemacs :config
(evil-define-key 'normal 'global (kbd "<leader> f e") 'treemacs))
#+end_src
Enable which key mode
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(which-key-mode)
#+end_src
** Theming
*** Fonts / icons
Icons must be installed 'all-the-icons-install
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package all-the-icons
:if (display-graphic-p))
(use-package nerd-icons
:if (display-graphic-p))
(use-package rainbow-delimiters :hook (prog-mode . rainbow-delimiters-mode))
#+end_src
*** UI System
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(require 'recentf)
(recentf-mode 1)
(setq history-length 50)
(savehist-mode 1)
(setq recentf-max-menu-items 25)
(save-place-mode 1)
(menu-bar-mode -1)
(tool-bar-mode -1)
(menu-bar-mode 1)
(tool-bar-mode 1)
(scroll-bar-mode -1)
(global-display-line-numbers-mode 1)
(hl-line-mode 1)
(blink-cursor-mode 1)
#+end_src
*** Color Scheme -> load-theme here
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package doom-themes
:ensure t
:config
@@ -118,9 +111,27 @@ Icons must be installed 'all-the-icons-install
(doom-themes-org-config))
#+end_src
** Utilities
*** Lsp's
#+begin_src emacs-lisp :tangle yes
(use-package lsp-mode
:init
(setq lsp-keymap-prefix "C-c l")
:hook(
(python-mode . lsp)
(js-mode . lsp)
(typescript . lsp)
(rust-mode . lsp)
(lsp-mode . lsp-enable-which-key-integration)
(zig-mode . lsp)
(nim-mode . lsp)
)
:commands lsp)
;; Tree-sitter grammars are provided by NixOS packages instead of runtime compilation
#+end_src
*** Completion
**** counsel
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package counsel :config (counsel-mode))
(use-package swiper)
(use-package ivy :config
@@ -152,7 +163,7 @@ Icons must be installed 'all-the-icons-install
:init (ivy-rich-mode 1))
#+end_src
**** helpful
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package helpful
:config
(global-set-key (kbd "C-h f") #'helpful-callable)
@@ -164,7 +175,7 @@ Icons must be installed 'all-the-icons-install
** Org Mode
*** Org Roam
Presents a good example of use-package's capabilities.
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(use-package org-roam :ensure t :after org :custom (org-roam-directory "~/org/roam") :bind
(("C-c n l" . org-roam-buffer-toggle)
("C-c n f" . org-roam-node-find)
@@ -178,13 +189,9 @@ Presents a good example of use-package's capabilities.
(concat "${title:*} "
(propertize "${tags:10}" 'face 'org-tag)))
(setq org-roam-database-connector 'sqlite-builtin)
(setq org-roam-capture-templates '(("d" "default" plain "%?"
:target (file+head "${slug}.org"
"#+title: ${title}\n")
:unnarrowed t)))
#+end_src
#+begin_src
(org-roam-capture-templates
#+begin_src emacs-lisp :tangle yes
(setq org-roam-capture-templates
'(("d" "default" plain
"%?"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n")
@@ -199,13 +206,13 @@ Presents a good example of use-package's capabilities.
:unnarrowed t)
("p" "project" plain "* Goals\n\n%?\n\n* Tasks\n\n** TODO Add initial tasks\n\n* Dates\n\n"
:if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org" "#+title: ${title}\n#+filetags: Project")
:unnarrowed t))
:unnarrowed t)))
#+end_src
**** Capture Templates
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
#+end_src
*** Org Agenda
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-columns-default-format "%50ITEM(Task) %10CLOCKSUM %16TIMESTAMP_IA")
#+end_src
*** Capture Templates
@@ -214,7 +221,7 @@ Presents a good example of use-package's capabilities.
:ID: e81c993e-995d-492f-af46-73928c0a4fbd
:END:
[https://d12frosted.io/posts/2020-06-23-task-management-with-roam-vol1.html]
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-capture-templates
'(("t" "todo" entry (file org-default-notes-file)
"* TODO %?\n%u\n%a\n" :clock-in t :clock-resume t)
@@ -227,7 +234,7 @@ Presents a good example of use-package's capabilities.
("n" "Next Task" entry (file+headline org-default-notes-file "Tasks")
"** NEXT %? \nDEADLINE: %t") ))
#+end_src
#+begin_src emacs-lisp
#+begin_src emacs-lisp :tangle yes
(setq org-agenda-prefix-format
'((agenda . " %i %-12(vulpea-agenda-category)%?-12t% s")
(todo . " %i %-12(vulpea-agenda-category) ")
@@ -385,49 +392,3 @@ Presents a good example of use-package's capabilities.
(add-hook 'vulpea-insert-handle-functions
#'my-vulpea-insert-handle)
#+end_src
* EXWM
#+begin_src emacs-lisp
(require 'exwm)
;; Set the initial workspace number.
(setq exwm-workspace-number 4)
;; Make class name the buffer name.
(add-hook 'exwm-update-class-hook
(lambda () (exwm-workspace-rename-buffer exwm-class-name)))
;; Global keybindings.
(setq exwm-input-global-keys
`(([?\s-r] . exwm-reset) ;; s-r: Reset (to line-mode).
([?\s-w] . exwm-workspace-switch) ;; s-w: Switch workspace.
([?\s-&] . (lambda (cmd) ;; s-&: Launch application.
(interactive (list (read-shell-command "$ ")))
(start-process-shell-command cmd nil cmd)))
;; s-N: Switch to certain workspace.
,@(mapcar (lambda (i)
`(,(kbd (format "s-%d" i)) .
(lambda ()
(interactive)
(exwm-workspace-switch-create ,i))))
(number-sequence 0 9))))
;; Enable EXWM
;; let's get encryption established
(setenv "GPG_AGENT_INFO" nil) ;; use emacs pinentry
(setq auth-source-debug t)
(setq epg-gpg-program "gpg2") ;; not necessary
(require 'epa-file)
(epa-file-enable)
(setq epa-pinentry-mode 'loopback)
(setq epg-pinentry-mode 'loopback)
(pinentry-start)
(require 'org-crypt)
(org-crypt-use-before-save-magic)
(require 'exwm-randr)
(require 'exwm-systemtray)
(setq exwm-randr-workspace-output-plist '(o "eDP-1"))
(add-hook 'exwm-randr-screen-change-hook
(lambda ()
(start-process-shell-command
"xrandr" nil "xrandr --output eDP-1 --scale .5 --filter nearest")))
(exwm-randr-enable)
(exwm-systemtray-enable)