diff options
| -rw-r--r-- | .gitignore | 2 | ||||
| -rw-r--r-- | home-manager/general/programs/emacs/config.org | 161 | ||||
| -rw-r--r-- | home-manager/general/programs/emacs/early-init.el | 1 | ||||
| -rw-r--r-- | home-manager/general/programs/emacs/init.el | 679 | ||||
| -rw-r--r-- | home-manager/laptop/hyprland/hyprland.conf | 285 | ||||
| -rw-r--r-- | nixos/general.nix | 4 | ||||
| -rw-r--r-- | nixos/laptop/configuration.nix | 7 |
7 files changed, 287 insertions, 852 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f82b9fc --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +#*# +*~
\ No newline at end of file diff --git a/home-manager/general/programs/emacs/config.org b/home-manager/general/programs/emacs/config.org index 5650bb1..8e1fc69 100644 --- a/home-manager/general/programs/emacs/config.org +++ b/home-manager/general/programs/emacs/config.org @@ -1,14 +1,13 @@ #+Title: spl3g's Emacs config #+AUTHOR: spl3g #+STARTUP: showeverything -#+PROPERTY: header-args :tangle init.el #+OPTIONS: toc:2 -#+auto_tangle: t * Table Of Contents :toc: - [[#progs-to-load-first][Progs to load first]] - [[#optimise-gc][Optimise gc]] - - [[#use-package][use-package]] + - [[#elpaca][elpaca]] + - [[#emacs][Emacs]] - [[#save-history][Save history]] - [[#meow-mode][Meow mode]] - [[#general-keybindings][General keybindings]] @@ -67,16 +66,62 @@ #+begin_src emacs-lisp (setq gc-cons-threshold (* 50 1000 1000)) #+end_src -** use-package -#+begin_src emacs-lisp - (require 'use-package) - (eval-and-compile - (setq use-package-always-ensure t - use-package-expand-minimally t)) +** elpaca +#+begin_src emacs-lisp +(defvar elpaca-installer-version 0.6) +(defvar elpaca-directory (expand-file-name "elpaca/" user-emacs-directory)) +(defvar elpaca-builds-directory (expand-file-name "builds/" elpaca-directory)) +(defvar elpaca-repos-directory (expand-file-name "repos/" elpaca-directory)) +(defvar elpaca-order '(elpaca :repo "https://github.com/progfolio/elpaca.git" + :ref nil + :files (:defaults "elpaca-test.el" (:exclude "extensions")) + :build (:not elpaca--activate-package))) +(let* ((repo (expand-file-name "elpaca/" elpaca-repos-directory)) + (build (expand-file-name "elpaca/" elpaca-builds-directory)) + (order (cdr elpaca-order)) + (default-directory repo)) + (add-to-list 'load-path (if (file-exists-p build) build repo)) + (unless (file-exists-p repo) + (make-directory repo t) + (when (< emacs-major-version 28) (require 'subr-x)) + (condition-case-unless-debug err + (if-let ((buffer (pop-to-buffer-same-window "*elpaca-bootstrap*")) + ((zerop (call-process "git" nil buffer t "clone" + (plist-get order :repo) repo))) + ((zerop (call-process "git" nil buffer t "checkout" + (or (plist-get order :ref) "--")))) + (emacs (concat invocation-directory invocation-name)) + ((zerop (call-process emacs nil buffer nil "-Q" "-L" "." "--batch" + "--eval" "(byte-recompile-directory \".\" 0 'force)"))) + ((require 'elpaca)) + ((elpaca-generate-autoloads "elpaca" repo))) + (progn (message "%s" (buffer-string)) (kill-buffer buffer)) + (error "%s" (with-current-buffer buffer (buffer-string)))) + ((error) (warn "%s" err) (delete-directory repo 'recursive)))) + (unless (require 'elpaca-autoloads nil t) + (require 'elpaca) + (elpaca-generate-autoloads "elpaca" repo) + (load "./elpaca-autoloads"))) +(add-hook 'after-init-hook #'elpaca-process-queues) +(elpaca `(,@elpaca-order)) + +(elpaca elpaca-use-package + ;; Enable :elpaca use-package keyword. + (elpaca-use-package-mode) + ;; Assume :elpaca t unless otherwise specified. + (setq elpaca-use-package-by-default t)) + +(elpaca-wait) +#+end_src +** Emacs +#+begin_src emacs-lisp + (use-package emacs :elpaca nil + :custom + (native-comp-async-report-warnings-errors . nil)) #+end_src ** Save history #+begin_src emacs-lisp - (use-package savehist + (use-package savehist :elpaca nil :init (setq savehist-file "~/.config/emacs/var/savehist.el") :config @@ -209,7 +254,7 @@ "wo" '(delete-other-windows :wk "") ;; Files "f" '(:ignore t :wk "Files") - "fc" '((lambda () (interactive) (find-file "~/nixfiles/home-manager/programs/emacs/config.org")) :wk "Edit emacs config") + "fc" '((lambda () (interactive) (find-file "~/.config/emacs/config.org")) :wk "Edit emacs config") "fu" '(crux-sudo-edit :wk "Sudo edit file") ;; Compilation "c" '(:ignore t :wk "Compilation") @@ -332,8 +377,6 @@ #+end_src * Org mode #+begin_src emacs-lisp - (use-package org - :defer t) (add-hook 'org-mode-hook 'org-indent-mode) (require 'org-tempo) #+end_src @@ -379,7 +422,7 @@ ("DEL" . vertico-directory-delete-char) ("M-DEL" . vertico-directory-delete-word))) - (use-package emacs + (use-package emacs :elpaca nil :init ;; Add prompt indicator to `completing-read-multiple'. ;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma. @@ -451,7 +494,7 @@ ("M-g o" . consult-outline) ;; Alternative: consult-org-heading ;; M-s bindings in `search-map' ("M-s d" . consult-fd) - ("M-s g" . consult-grep) + ("M-s g" . consult-ripgrep) ("M-s G" . consult-git-grep) ("M-s l" . consult-line) ("M-s L" . consult-line-multi) @@ -531,6 +574,9 @@ ;; (setq consult-project-function nil) ) #+end_src + +#+RESULTS: + ** Pairs #+begin_src emacs-lisp (use-package smartparens @@ -680,18 +726,30 @@ #+end_src * LSP #+begin_src emacs-lisp - (use-package eglot - :bind (("C-c s e e" . eglot) - ("C-c s e d" . eldoc) - ("C-c s e r" . eglot-rename) - ("C-c s e s" . eglot-shutdown) - ("C-c s e f" . eglot-find-declaration) - ("C-c s e i" . eglot-find-implementation)) - :hook - (nix-mode . eglot-ensure) - (python-ts-mode . eglot-ensure) - :config - (add-to-list 'eglot-server-programs '(python-ts-mode . ("pylsp")))) + (use-package eglot :elpaca nil + :bind (("C-c s e e" . eglot) + ("C-c s e d" . eldoc) + ("C-c s e r" . eglot-rename) + ("C-c s e s" . eglot-shutdown) + ("C-c s e f" . eglot-find-declaration) + ("C-c s e i" . eglot-find-implementation)) + :hook + (python-ts-mode . eglot-ensure) + (rust-ts-mode . eglot-ensure) + :config + (add-to-list 'eglot-server-programs '(python-ts-mode . ("pylsp"))) + + (advice-add 'eglot-completion-at-point :around #'cape-wrap-buster) + + (setq completion-category-overrides '((eglot (styles orderless)) + (eglot-capf (styles orderless)))) + (defun my/eglot-capf () + (setq-local completion-at-point-functions + (list (cape-capf-super + #'eglot-completion-at-point + #'cape-dabbrev)))) + + (add-hook 'eglot-managed-mode-hook #'my/eglot-capf)) #+end_src ** Languages *** Python @@ -718,15 +776,15 @@ #+begin_src emacs-lisp (use-package nix-mode :mode ("\\.nix\\'" "\\.nix.in\\'")) - (use-package nix-drv-mode - :ensure nix-mode - :mode "\\.drv\\'") - (use-package nix-shell - :ensure nix-mode - :commands (nix-shell-unpack nix-shell-configure nix-shell-build)) - (use-package nix-repl - :ensure nix-mode - :commands (nix-repl)) + ;; (use-package nix-drv-mode :elpaca nil + ;; :ensure nix-mode + ;; :mode "\\.drv\\'") + ;; (use-package nix-shell :elpaca nil + ;; :ensure nix-mode + ;; :commands (nix-shell-unpack nix-shell-configure nix-shell-build)) + ;; (use-package nix-repl :elpaca nil + ;; :ensure nix-mode +#+end_src #+end_src *** Web #+begin_src emacs-lisp @@ -742,7 +800,7 @@ #+end_src *** JavaScript #+begin_src emacs-lisp - (use-package js2-mode) + ;; (use-package js2-mode) #+end_src ** Corfu #+begin_src emacs-lisp @@ -764,8 +822,11 @@ (corfu-history-mode) (corfu-popupinfo-mode) :config + (unbind-key "next-line" corfu-map) + (unbind-key "previous-line" corfu-map) (add-to-list 'savehist-additional-variables 'corfu-history)) - (use-package emacs + + (use-package emacs :elpaca nil :init (setq completion-cycle-threshold 3) @@ -810,18 +871,24 @@ #+end_src ** Flymake #+begin_src emacs-lisp - (use-package flymake - :after eglot - :bind (("C-c s f f" . flymake-start) - ("C-c s f l" . flymake-show-buffer-diagnostics) - ("C-c s f p" . flymake-show-project-diagnostics))) + (use-package flymake :elpaca nil + :after eglot + :bind (("C-c s f f" . flymake-start) + ("C-c s f l" . flymake-show-buffer-diagnostics) + ("C-c s f p" . flymake-show-project-diagnostics)) + :custom-face + (flymake-error ((t (:underline "Red1")))) + (flymake-note ((t (:underline "yellow green"))))) #+end_src * Dired ** Bindings #+begin_src emacs-lisp - (use-package dired + (use-package dired :elpaca nil :ensure nil :commands (dired dired-jump) + :bind (:map dired-mode-map + ("h" . dired-up-directory) + ("l" . dired-find-file)) :custom (dired-listing-switches "-al --group-directories-first")) #+end_src @@ -867,9 +934,9 @@ #+end_src ** Copilot #+begin_src emacs-lisp - (use-package copilot - :hook (python-ts-mode . copilot-mode) - :bind ("M-RET" . copilot-accept-completion)) + ;; (use-package copilot + ;; :hook (python-ts-mode . copilot-mode) + ;; :bind ("M-RET" . copilot-accept-completion)) #+end_src * Runtime Performance #+begin_src emacs-lisp diff --git a/home-manager/general/programs/emacs/early-init.el b/home-manager/general/programs/emacs/early-init.el index 6e306a1..46ead1f 100644 --- a/home-manager/general/programs/emacs/early-init.el +++ b/home-manager/general/programs/emacs/early-init.el @@ -1,3 +1,4 @@ +(setq package-enable-at-startup nil) (menu-bar-mode -1) (tool-bar-mode -1) (scroll-bar-mode -1) diff --git a/home-manager/general/programs/emacs/init.el b/home-manager/general/programs/emacs/init.el index 1b67775..ff20d92 100644 --- a/home-manager/general/programs/emacs/init.el +++ b/home-manager/general/programs/emacs/init.el @@ -1,675 +1,4 @@ -(setq gc-cons-threshold (* 50 1000 1000)) - -(require 'use-package) -(eval-and-compile - (setq use-package-always-ensure t - use-package-expand-minimally t)) - -(use-package savehist - :init - (setq savehist-file "~/.config/emacs/var/savehist.el") - :config - (setq history-length 500) - (setq savehist-additional-variables '(kill-ring search-ring)) - (savehist-mode t)) - -(use-package meow - :config - (defun meow-setup () - (setq meow-cheatsheet-layout meow-cheatsheet-layout-qwerty) - (meow-motion-overwrite-define-key - '("j" . meow-next) - '("k" . meow-prev) - '("<escape>" . ignore)) - (meow-leader-define-key - ;; SPC j/k will run the original command in MOTION state. - '("j" . "H-j") - '("k" . "H-k") - ;; Use SPC (0-9) for digit arguments. - '("1" . meow-digit-argument) - '("2" . meow-digit-argument) - '("3" . meow-digit-argument) - '("4" . meow-digit-argument) - '("5" . meow-digit-argument) - '("6" . meow-digit-argument) - '("7" . meow-digit-argument) - '("8" . meow-digit-argument) - '("9" . meow-digit-argument) - '("0" . meow-digit-argument) - '("/" . meow-keypad-describe-key) - '("?" . meow-cheatsheet) - '("bk" . kill-this-buffer)) - (meow-normal-define-key - '("0" . meow-expand-0) - '("9" . meow-expand-9) - '("8" . meow-expand-8) - '("7" . meow-expand-7) - '("6" . meow-expand-6) - '("5" . meow-expand-5) - '("4" . meow-expand-4) - '("3" . meow-expand-3) - '("2" . meow-expand-2) - '("1" . meow-expand-1) - '("-" . negative-argument) - '(";" . meow-reverse) - '("," . meow-inner-of-thing) - '("." . meow-bounds-of-thing) - '("[" . meow-beginning-of-thing) - '("]" . meow-end-of-thing) - '("a" . meow-append) - '("A" . meow-open-below) - '("b" . meow-back-word) - '("B" . meow-back-symbol) - '("c" . meow-change) - '("d" . meow-delete) - '("D" . meow-backward-delete) - '("e" . meow-next-word) - '("E" . meow-next-symbol) - '("f" . meow-find) - '("g" . meow-cancel-selection) - '("G" . meow-grab) - '("h" . meow-left) - '("H" . meow-left-expand) - '("i" . meow-insert) - '("I" . meow-open-above) - '("j" . meow-next) - '("J" . meow-next-expand) - '("k" . meow-prev) - '("K" . meow-prev-expand) - '("l" . meow-right) - '("L" . meow-right-expand) - '("m" . meow-join) - '("n" . meow-search) - '("o" . meow-block) - '("O" . meow-to-block) - '("p" . meow-yank) - '("q" . meow-quit) - '("Q" . meow-goto-line) - '("r" . meow-replace) - '("R" . meow-swap-grab) - '("s" . meow-kill) - '("t" . meow-till) - '("u" . meow-undo) - '("U" . meow-undo-in-selection) - '("v" . meow-visit) - '("w" . meow-mark-word) - '("W" . meow-mark-symbol) - '("x" . meow-line) - '("X" . meow-goto-line) - '("y" . meow-save) - '("Y" . meow-sync-grab) - '("z" . meow-pop-selection) - '("'" . repeat) - '("<escape>" . ignore))) - (setq meow-use-enhanced-selection-effect t) - (meow-setup) - (meow-global-mode 1)) - -(use-package general - :config - ;; SPC as the global leader key - (general-create-definer spl3g/leader-keys - :prefix "C-c") - - (spl3g/leader-keys - ;; Buffers - "b" '(:ignore t :wk "Buffer") - "bi" '(ibuffer :wk "ibuffer") - "bk" '(kill-this-buffer :wk "Kill this buffer") - "bn" '(next-buffer :wk "Next buffer") - "bp" '(previous-buffer :wk "Previous buffer") - "br" '(revert-buffer :wk "Reload buffer") - "." '(find-file :wk "Find file") - ;; Splits - "w" '(:ignore t :wk "Splits") - "wv" '(split-window-right :wk "Split vertical") - "ws" '(split-window-below :wk "Split") - "ww" '(other-window :wk "Cycle throug windows") - "wc" '(delete-window :wk "Close window") - "wd" '(delete-window :wk "Close window") - "wl" '(evil-window-right :wk "") - "wj" '(evil-window-down :wk "") - "wk" '(evil-window-up :wk "") - "wh" '(evil-window-left :wk "") - "wo" '(delete-other-windows :wk "") - ;; Files - "f" '(:ignore t :wk "Files") - "fc" '((lambda () (interactive) (find-file "~/nixfiles/home-manager/programs/emacs/config.org")) :wk "Edit emacs config") - "fu" '(crux-sudo-edit :wk "Sudo edit file") - ;; Compilation - "c" '(:ignore t :wk "Compilation") - "cc" '(compile :wk "Compile") - "cr" '(recompile :wk "Recompile") - )) - -(defun spl3g/disable-scroll-bars (frame) - (modify-frame-parameters frame - '((vertical-scroll-bars . nil) - (horizontal-scroll-bars . nil)))) -(add-hook 'after-make-frame-functions 'spl3g/disable-scroll-bars) - -(setq default-frame-alist '((font . "Source Code Pro"))) -(set-face-attribute 'default nil - :font "Source Code Pro" - :height 110 - :weight 'medium) -(set-face-attribute 'fixed-pitch nil - :font "Source Code Pro" - :height 110 - :weight 'medium) -(set-face-attribute 'variable-pitch nil - :font "Rubik" - :height 110 - :weight 'medium) -(set-face-attribute 'font-lock-comment-face nil - :slant 'italic) -(set-face-attribute 'font-lock-keyword-face nil - :weight 'bold) - -(add-hook 'prog-mode-hook 'display-line-numbers-mode) -(visual-line-mode 1) - -(use-package catppuccin-theme - :ensure t - :config - (load-theme 'catppuccin t) - (setq catppuccin-flavor 'macchiato) - (catppuccin-reload)) - -(use-package all-the-icons - :ensure t - :if (display-graphic-p)) - -(use-package mood-line - - ;; Enable mood-line - :config - (mood-line-mode) - :custom - (mood-line-segment-modal-meow-state-alist - '((normal "N" . mood-line-meow-normal) - (insert "I" . mood-line-meow-insert) - (keypad "K" . mood-line-meow-keypad) - (beacon "B" . mood-line-meow-beacon) - (motion "M" . mood-line-meow-motion))) - (mood-line-glyph-alist mood-line-glyphs-fira-code) - :custom-face - (mood-line-meow-beacon ((t (:foreground "#f9e2af" :weight bold)))) - (mood-line-meow-insert ((t (:foreground "#a6e3a1" :weight bold)))) - (mood-line-meow-keypad ((t (:foreground "#cba6f7" :weight bold)))) - (mood-line-meow-motion ((t (:foreground "#fab387" :weight bold)))) - (mood-line-meow-normal ((t (:weight bold)))) - (mode-line-inactive ((t (:box (:line-width (2 . 6) :color "#11111b") :inverse-video nil :foreground "#6c7086" :background "#11111b")))) - (mode-line ((t (:box (:line-width (2 . 6) :color "#181825") :background "#181825"))))) - -(use-package good-scroll - :init (good-scroll-mode)) - -(use-package dashboard - :init - (dashboard-setup-startup-hook) - :config - (setq initial-buffer-choice (lambda () (get-buffer-create "*dashboard*"))) - (setq dashboard-banner-logo-title "Yep, it's emacs, not vim") - (setq dashboard-startup-banner 'logo) - (setq dashboard-center-content t) - (add-to-list 'dashboard-item-generators '(config . dashboard-open-config)) - (setq dashboard-items '((recents . 5) - (agenda . 5)))) - -(setq ring-bell-function 'ignore) - -(use-package indent-guide - :hook (prog-mode . indent-guide-mode)) - -(setq window-resize-pixelwise t) -(setq frame-resize-pixelwise t) -(save-place-mode t) -(defalias 'yes-or-no #'y-or-n-p) - -(use-package org - :defer t) -(add-hook 'org-mode-hook 'org-indent-mode) -(require 'org-tempo) - -(use-package toc-org - :hook (org-mode . toc-org-mode)) - -(use-package org-bullets - :hook (org-mode . org-bullets-mode)) - -(use-package org-auto-tangle - :hook (org-mode . org-auto-tangle-mode)) - -(use-package org-download - :hook - (dired-mode . org-download-enable)) - -(use-package direnv - :config - (direnv-mode)) - -(use-package vertico - :init - (vertico-mode) - :bind (:map vertico-map - ("M-j" . vertico-next) - ("M-k" . vertico-previous) - ("RET" . vertico-directory-enter) - ("DEL" . vertico-directory-delete-char) - ("M-DEL" . vertico-directory-delete-word))) - -(use-package emacs - :init - ;; Add prompt indicator to `completing-read-multiple'. - ;; We display [CRM<separator>], e.g., [CRM,] if the separator is a comma. - (defun crm-indicator (args) - (cons (format "[CRM%s] %s" - (replace-regexp-in-string - "\\`\\[.*?]\\*\\|\\[.*?]\\*\\'" "" - crm-separator) - (car args)) - (cdr args))) - (advice-add #'completing-read-multiple :filter-args #'crm-indicator) - - ;; Do not allow the cursor in the minibuffer prompt - (setq minibuffer-prompt-properties - '(read-only t cursor-intangible t face minibuffer-prompt)) - (add-hook 'minibuffer-setup-hook #'cursor-intangible-mode) - - ;; Emacs 28: Hide commands in M-x which do not work in the current mode. - ;; Vertico commands are hidden in normal buffers. - ;; (setq read-extended-command-predicate - ;; #'command-completion-default-include-p) - - ;; Enable recursive minibuffers - (setq enable-recursive-minibuffers t)) - -(use-package orderless - :init - (setq completion-styles '(orderless basic) - completion-category-defaults nil - completion-category-overrides '((file (styles partial-completion))))) - -(use-package marginalia - :bind (:map minibuffer-local-map - ("M-A" . marginalia-cycle)) - :init - (marginalia-mode)) - -(use-package consult - ;; Replace bindings. Lazily loaded due by `use-package'. - :bind (;; C-c bindings in `mode-specific-map' - ("C-c k" . consult-kmacro) - ("C-c m" . consult-man) - ("C-c i" . consult-info) - ([remap Info-search] . consult-info) - ("C-c f r" . consult-recent-file) - ("C-c ," . consult-buffer) - ;; C-x bindings in `ctl-x-map' - ("C-x M-:" . consult-complex-command) ;; orig. repeat-complex-command - ("C-x 4 b" . consult-buffer-other-window) ;; orig. switch-to-buffer-other-window - ("C-x 5 b" . consult-buffer-other-frame) ;; orig. switch-to-buffer-other-frame - ("C-x p b" . consult-project-buffer) ;; orig. project-switch-to-buffer - ;; Custom M-# bindings for fast register access - ("M-#" . consult-register-load) - ("M-'" . consult-register-store) ;; orig. abbrev-prefix-mark (unrelated) - ("C-M-#" . consult-register) - ;; Other custom bindings - ("M-y" . consult-yank-pop) ;; orig. yank-pop - ;; M-g bindings in `goto-map' - ("C-c c e" . consult-compile-error) - ("M-g f" . consult-flymake) ;; Alternative: consult-flycheck - ("M-g g" . consult-goto-line) ;; orig. goto-line - ("M-g M-g" . consult-goto-line) ;; orig. goto-line - ("M-g o" . consult-outline) ;; Alternative: consult-org-heading - ;; M-s bindings in `search-map' - ("M-s d" . consult-fd) - ("M-s g" . consult-grep) - ("M-s G" . consult-git-grep) - ("M-s l" . consult-line) - ("M-s L" . consult-line-multi) - ("M-s k" . consult-keep-lines) - ("M-s u" . consult-focus-lines) - ;; Isearch integration - ("M-s e" . consult-isearch-history) - :map isearch-mode-map - ("M-e" . consult-isearch-history) ;; orig. isearch-edit-string - ("M-s e" . consult-isearch-history) ;; orig. isearch-edit-string - ("M-s l" . consult-line) ;; needed by consult-line to detect isearch - ("M-s L" . consult-line-multi) ;; needed by consult-line to detect isearch - ("M-r" . consult-history) - ;; Minibuffer history - :map minibuffer-local-map - ("M-s" . consult-history) ;; orig. next-matching-history-element - ("M-r" . consult-history)) ;; orig. previous-matching-history-element) - - ;; Enable automatic preview at point in the *Completions* buffer. This is - ;; relevant when you use the default completion UI. - :hook - (completion-list-mode . consult-preview-at-point-mode) - (eshell-mode . (lambda () - (keymap-set eshell-mode-map "M-h" 'consult-history))) - - ;; The :init configuration is always executed (Not lazy) - :init - - ;; Optionally configure the register formatting. This improves the register - ;; preview for `consult-register', `consult-register-load', - ;; `consult-register-store' and the Emacs built-ins. - (setq register-preview-delay 0.5 - register-preview-function #'consult-register-format) - - ;; Optionally tweak the register preview window. - ;; This adds thin lines, sorting and hides the mode line of the window. - (advice-add #'register-preview :override #'consult-register-window) - - ;; Configure other variables and modes in the :config section, - ;; after lazily loading the package. - :config - - ;; Optionally configure preview. The default value - ;; is 'any, such that any key triggers the preview. - ;; (setq consult-preview-key 'any) - ;; (setq consult-preview-key "M-.") - ;; (setq consult-preview-key '("S-<down>" "S-<up>")) - ;; For some commands and buffer sources it is useful to configure the - ;; :preview-key on a per-command basis using the `consult-customize' macro. - (consult-customize - consult-ripgrep consult-git-grep consult-grep - consult-bookmark consult-recent-file consult-xref - consult--source-bookmark consult--source-file-register - consult--source-recent-file consult--source-project-recent-file) - ;; :preview-key "M-." - - ;; Optionally configure the narrowing key. - ;; Both < and C-+ work reasonably well. - (setq consult-narrow-key "<") ;; "C-+" - - ;; Optionally make narrowing help available in the minibuffer. - ;; You may want to use `embark-prefix-help-command' or which-key instead. - ;; (define-key consult-narrow-map (vconcat consult-narrow-key "?") #'consult-narrow-help) - - ;; By default `consult-project-function' uses `project-root' from project.el. - ;; Optionally configure a different project root function. -;;;; 1. project.el (the default) - ;; (setq consult-project-function #'consult--default-project--function) -;;;; 2. vc.el (vc-root-dir) - ;; (setq consult-project-function (lambda (_) (vc-root-dir))) -;;;; 3. locate-dominating-file - ;; (setq consult-project-function (lambda (_) (locate-dominating-file "." ".git"))) -;;;; 4. projectile.el (projectile-project-root) - ;; (autoload 'projectile-project-root "projectile") - ;; (setq consult-project-function (lambda (_) (projectile-project-root))) -;;;; 5. No project support - ;; (setq consult-project-function nil) - ) - -(use-package smartparens - :init (smartparens-global-mode) - :config - ;; Snitched from doom - (let ((unless-list '(sp-point-before-word-p - sp-point-after-word-p - sp-point-before-same-p))) - (sp-pair "'" nil :unless unless-list) - (sp-pair "\"" nil :unless unless-list)) - (dolist (brace '("(" "{" "[")) - (sp-pair brace nil - :post-handlers '(("||\n[i]" "RET") ("| " "SPC")) - :unless '(sp-point-before-word-p sp-point-before-same-p))) - (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p)) - (sp-local-pair sp-lisp-modes "(" ")" :unless '(:rem sp-point-before-same-p)) - - (sp-local-pair '(python-mode python-ts-mode) "f'" "'") - - ;; Major-mode specific fixes - (sp-local-pair 'ruby-mode "{" "}" - :pre-handlers '(:rem sp-ruby-pre-handler) - :post-handlers '(:rem sp-ruby-post-handler)) - - ;; Don't do square-bracket space-expansion where it doesn't make sense to - (sp-local-pair '(emacs-lisp-mode org-mode markdown-mode gfm-mode) - "[" nil :post-handlers '(:rem ("| " "SPC"))) - - (sp-local-pair '(emacs-lisp-mode org-mode) - "'" nil) - - ;; Reasonable default pairs for HTML-style comments - (sp-local-pair (append sp--html-modes '(markdown-mode gfm-mode)) - "<!--" "-->" - :unless '(sp-point-before-word-p sp-point-before-same-p) - :actions '(insert) :post-handlers '(("| " "SPC"))) - ;; Expand C-style comment blocks. - (defun +default-open-doc-comments-block (&rest _ignored) - (save-excursion - (newline) - (indent-according-to-mode))) - (sp-local-pair - '(js2-mode typescript-mode rjsx-mode rust-mode c-mode c++-mode objc-mode - csharp-mode java-mode php-mode css-mode scss-mode less-css-mode - stylus-mode scala-mode) - "/*" "*/" - :actions '(insert) - :post-handlers '(("| " "SPC") - (" | " "*") - ("|[i]\n[i]" "RET")))) - -;; (use-package dap-mode -;; :defer t -;; :config -;; (require 'dap-python) -;; (setq dap-python-debugger 'debugpy)) - -(use-package move-text - :bind (("C-M-k" . move-text-up) - ("C-M-j" . move-text-down))) - -(global-visual-line-mode t) - -(use-package no-littering) - -(use-package rainbow-delimiters - :hook (prog-mode . rainbow-delimiters-mode)) - -(use-package crux - :bind (("C-c o t" . crux-visit-shell-buffer))) - -(use-package helpful - :bind (("C-h f" . 'helpful-callable) - ("C-h v" . 'helpful-variable) - ("C-h k" . 'helpful-key) - ("C-h x" . 'helpful-command) - ("C-c C-d" . 'helpful-at-point) - ("C-h F" . 'helpful-function))) - -(add-hook 'eshell-mode-hook - (lambda () - (keymap-set eshell-mode-map "M-<tab>" 'consult-fish-completions))) - -(use-package fish-completion - :hook (eshell-mode . fish-completion-mode)) - -;; (use-package consult-fish-completions -;; :load-path "~/prog/elisp/fish-completions/consult-fish-completions.el" -;; :hook (eshell-mode . (lambda () -;; (keymap-set eshell-mode-map "M-<tab>" 'consult-fish-completions)))) - -(use-package eat - :hook (eshell-mode . eat-eshell-mode) - :custom - (eat-enable-auto-line-mode t)) - -;; (defun eat-toggle () -;; "Open eat terminal as a popup." -;; (interactive) -;; (if (eq major-mode 'eat-mode) -;; (delete-window) -;; (let ((buff (get-buffer-create eat-buffer-name))) -;; (cl-assert (and buff (buffer-live-p buff))) -;; (funcall #'pop-to-buffer buff) -;; (with-current-buffer buff -;; (setq-local split-width-threshold nil) -;; (setq-local window-min-height 2) -;; (unless (derived-mode-p 'eat-mode) -;; (eat)))))) - -;; (defun eat-modes() -;; (cond -;; ((and (eq major-mode 'eat-mode) (member 'meow-normal-mode local-minor-modes)) -;; (eat-emacs-mode)) -;; ((and (eq major-mode 'eat-mode) (member 'meow-insert-mode local-minor-modes)) -;; (eat-semi-char-mode)))) -;; (add-hook 'meow-normal-mode-hook #'eat-modes) -;; (add-hook 'meow-insert-mode-hook #'eat-modes) - -(use-package eglot - :bind (("C-c s e e" . eglot) - ("C-c s e d" . eldoc) - ("C-c s e r" . eglot-rename) - ("C-c s e s" . eglot-shutdown) - ("C-c s e f" . eglot-find-declaration) - ("C-c s e i" . eglot-find-implementation)) - :hook - (nix-mode . eglot-ensure) - (python-ts-mode . eglot-ensure) - :config - (add-to-list 'eglot-server-programs '(python-ts-mode . ("pylsp")))) - -(use-package lsp-pyright) -(use-package py-autopep8 - :hook (python-mode . py-autopep8-mode)) - -(use-package rust-mode - :mode "\\.rs\\'") -(use-package flycheck-rust - :config - (with-eval-after-load 'rust-mode - (add-hook 'flycheck-mode-hook #'flycheck-rust-setup))) - -(use-package fish-mode - :mode "\\.fish\\'") - -(use-package nix-mode - :mode ("\\.nix\\'" "\\.nix.in\\'")) -(use-package nix-drv-mode - :ensure nix-mode - :mode "\\.drv\\'") -(use-package nix-shell - :ensure nix-mode - :commands (nix-shell-unpack nix-shell-configure nix-shell-build)) -(use-package nix-repl - :ensure nix-mode - :commands (nix-repl)) - -(use-package web-mode - :mode - ("\\.phtml\\'" - "\\.tpl\\.php\\'" - "\\.[agj]sp\\'" - "\\.as[cp]x\\'" - "\\.erb\\'" - "\\.mustache\\'" - "\\.djhtml\\'")) - -(use-package js2-mode) - -(use-package corfu - :custom - (corfu-cycle t) - (corfu-preselect 'prompt) - (corfu-auto t) - (corfu-popupinfo-delay 0.0) - :bind - (:map corfu-map - ("TAB" . corfu-next) - ([tab] . corfu-next) - ("S-TAB" . corfu-previous) - ([backtab] . corfu-previous)) - - :init - (global-corfu-mode) - (corfu-history-mode) - (corfu-popupinfo-mode) - :config - (add-to-list 'savehist-additional-variables 'corfu-history)) -(use-package emacs - :init - (setq completion-cycle-threshold 3) - - (setq read-extended-command-predicate - #'command-completion-default-include-p) - - (setq tab-always-indent 'complete)) - -(use-package cape - :demand t - :config - (add-to-list 'completion-at-point-functions #'cape-dabbrev) - (add-to-list 'completion-at-point-functions #'cape-file) - (add-to-list 'completion-at-point-functions #'cape-elisp-block) - ) - -(use-package tree-sitter - :init - (global-tree-sitter-mode) - :config - (add-hook 'tree-sitter-mode-hook 'tree-sitter-hl-mode)) -(use-package treesit-auto - :custom - (treesit-auto-install 'prompt) - :config - (treesit-auto-add-to-auto-mode-alist 'all) - (global-treesit-auto-mode)) - -(use-package tree-sitter-langs) - -;; (use-package yasnippet -;; :init (yas-global-mode)) -;; (use-package yasnippet-snippets) - -(use-package flymake - :after eglot - :bind (("C-c s f f" . flymake-start) - ("C-c s f l" . flymake-show-buffer-diagnostics) - ("C-c s f p" . flymake-show-project-diagnostics))) - -(use-package dired - :ensure nil - :commands (dired dired-jump) - :custom - (dired-listing-switches "-al --group-directories-first")) - -(use-package dired-ranger - :bind (:map dired-mode-map - ("r c" . dired-ranger-copy) - ("r m" . dired-ranger-move) - ("r p" . dired-ranger-paste) - ("\\" . dired-ranger-bookmark) - ("`" . dired-ranger-bookmark-visit))) -(use-package dired-narrow - :bind (:map dired-mode-map - ("n" . dired-narrow))) - -;; (add-to-list 'load-path "~/telega.el") -;; (require 'telega) - -(use-package magit - :bind (("C-c o g" . magit))) - -;; (use-package exwm) -;; (require 'exwm) -;; (require 'exwm-config) -;; (exwm-config-example) - -;; (use-package code-cells) - -;; (use-package orgnote -;; :defer t) - -(use-package copilot - :hook (python-ts-mode . copilot-mode) - :bind ("M-RET" . copilot-accept-completion)) - -(setq gc-cons-threshold (* 2 1000 1000)) -(setq read-process-output-max (* 1024 1024)) +(org-babel-load-file + (expand-file-name + "config.org" + user-emacs-directory)) diff --git a/home-manager/laptop/hyprland/hyprland.conf b/home-manager/laptop/hyprland/hyprland.conf index 376dd52..81ef9eb 100644 --- a/home-manager/laptop/hyprland/hyprland.conf +++ b/home-manager/laptop/hyprland/hyprland.conf @@ -1,41 +1,71 @@ -monitor = eDP-1,preferred,auto,1 -monitor = ,highres,auto,1,mirror,eDP-1 +monitor=,preferred,auto,1 +# Execute your favorite apps at launch +exec-once = waybar & swww init + +# Set programs that you use +$terminal = alacritty +$fileManager = emacs +$menu = rofi --show drun +$scripts=~/.config/hypr/scripts + +# Some default env vars. +env = XCURSOR_SIZE,18 +env = QT_QPA_PLATFORMTHEME, gtk3 +env = QT_STYLE_OVERRIDE, gtk2 +env = QT_QPA_PLATFORM, wayland +env = TERMINAL, "alacritty" +env = BROWSER, "firefox" + + +# For all categories, see https://wiki.hyprland.org/Configuring/Variables/ input { - kb_file= kb_layout = us,ru - kb_variant= - kb_model= + kb_variant = + kb_model = kb_options = grp:win_space_toggle - kb_rules= + kb_rules = follow_mouse = 1 touchpad { - natural_scroll = yes - clickfinger_behavior = yes - scroll_factor = 0.8 - # disable_while_typing = no + natural_scroll = yes + # disable_while_typing = no } - sensitivity = 0 # -1.0 - 1.0, 0 means no modification. + sensitivity = 0.1 # -1.0 - 1.0, 0 means no modification. } general { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + gaps_in = 5 gaps_out = 20 border_size = 3 col.active_border = 0xFF6e6a86 col.inactive_border = 0xFF363a4f - apply_sens_to_raw = 0 # whether to apply the sensitivity to raw input (e.g. used by games where you aim using your mouse) + layout = dwindle + + # Please see https://wiki.hyprland.org/Configuring/Tearing/ before you turn this on + allow_tearing = false } decoration { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + rounding = 7 - drop_shadow = false - shadow_range = 5 - shadow_offset = [100, 100] + + blur { + enabled = true + size = 3 + passes = 1 + } + + drop_shadow = yes + shadow_range = 4 + shadow_render_power = 3 + col.shadow = rgba(1a1a1aee) } animations { @@ -47,85 +77,85 @@ animations { } dwindle { - pseudotile = 0 # enable pseudotiling on dwindle + # See https://wiki.hyprland.org/Configuring/Dwindle-Layout/ for more + pseudotile = yes # master switch for pseudotiling. Enabling is bound to mainMod + P in the keybinds section below + preserve_split = yes # you probably want this +} + +master { + # See https://wiki.hyprland.org/Configuring/Master-Layout/ for more + new_is_master = true } gestures { - workspace_swipe = yes + # See https://wiki.hyprland.org/Configuring/Variables/ for more + workspace_swipe = on } +misc { + # See https://wiki.hyprland.org/Configuring/Variables/ for more + force_default_wallpaper = 1 # Set to 0 to disable the anime mascot wallpapers +} + +# Example windowrule v1 +# windowrule = float, ^(kitty)$ +# Example windowrule v2 +# windowrulev2 = float,class:^(kitty)$,title:^(kitty)$ +# See https://wiki.hyprland.org/Configuring/Window-Rules/ for more +windowrulev2 = nomaximizerequest, class:.* # You'll probably like this. windowrulev2 = float, title:^(Firrfox — Sharing Indicator)$ windowrulev2 = nofullscreenrequest, title:^(Firefox — Sharing Indicator)$ windowrulev2 = noborder, title:^(Firefox — Sharing Indicator)$ windowrulev2 = rounding 0, title:^(Firefox — Sharing Indicator)$ windowrulev2 = float, title:^(firefox)$, title:^(Picture-in-Picture)$ windowrulev2 = pin, title:^(firefox)$, title:^(Picture-in-Picture)$ -windowrulev2 = rounding 7, title:^(rofi)$ layerrule = blur, waybar -# some nice mouse binds -bindm = SUPER,mouse:272,movewindow -bindm = SUPER,mouse:273,resizewindow - -# Binds -bind = SUPER_SHIFT,Q,exec,$scripts/kill -bind = SUPER_SHIFT,E,exit, -bind = ,0x1008FF2A,exec,nwg-bar -bind = SUPER,V,togglefloating, -bind = SUPER_SHIFT,V,centerwindow -bind = SUPER,P,pseudo, -bind = SUPER,F,fullscreen,0 -bind = SUPER_SHIFT,F,fakefullscreen -bind = SUPER,M,fullscreen,1 -bind = SUPER,N,exec,killall -SIGUSR1 waybar -bind = SUPER_SHIFT,N,exec,killall -SIGUSR2 waybar - -# Lockscreen -bind = SUPER_SHIFT,P,exec,bash -c ~/Games/swaylock-blur.sh - -# Change colume -bind = ,0x1008FF11,exec,wpctl status | grep '*' -m 1 | awk '{print $3 - 0}' | xargs -I _ wpctl set-volume _ 5%- -bind = ,0x1008FF13,exec,wpctl status | grep '*' -m 1 | awk '{print $3 - 0}' | xargs -I _ wpctl set-volume _ 5%+ -bind = ,0x1008FF12,exec,wpctl status | grep '*' -m 1 | awk '{print $3 - 0}' | xargs -I _ wpctl set-mute _ toggle - -# Change brightness -bind = ,0x1008FF02,exec,brightnessctl s +5% -bind = ,0x1008FF03,exec,brightnessctl s 5%- -# App binds -bind = SUPER,Q,exec,alacritty -bind = SUPER,B,exec,firefox -bind = SUPER_SHIFT,R,exec,nautilus -bind = SUPER,T,exec,telegram-desktop -bind = SUPER,E,exec,emacsclient -c -a "emacs" -bind = SUPER_CONTROL,E,exec,emacs - -# Rofi -bind = SUPER,D,exec,killall rofi || rofi -show-icons -show drun -bind = SUPER,C,exec,$scripts/rofi-modes - -# Screenshots -bind = ,Print,exec,$scripts/hshot -m -bind = CONTROL,Print,exec,$scripts/hshot -m -c -bind = SHIFT,Print,exec,$scripts/hshot -s -bind = CONTROL_SHIFT,Print,exec,$scripts/hshot -s -c -bind = ALT,Print,exec,$scripts/hshot -w -bind = ALT_CONTROL,Print,exec,$scripts/hshot -w -c - -# Cycle through windows -bind = SUPER,J,movefocus,d -bind = SUPER,K,movefocus,u -bind = SUPER,H,movefocus,l -bind = SUPER,L,movefocus,r - -# Resize windows -# bind = SUPER_CONTROL,K,resizeactive,0 -50 -# bind = SUPER_CONTROL,J,resizeactive,0 50 -# bind = SUPER_CONTROL,H,resizeactive,-50 0 -# bind = SUPER_CONTROL,L,resizeactive,50 0 -bind = SUPER_CONTROL,K,splitratio,0.5 -bind = SUPER_CONTROL,J,splitratio,-0.5 +# See https://wiki.hyprland.org/Configuring/Keywords/ for more +$mainMod = SUPER + +# Example binds, see https://wiki.hyprland.org/Configuring/Binds/ for more +bind = $mainMod, Q, exec, $terminal +bind = $mainMod, V, togglefloating, +bind = SUPER, D, exec, killall rofi || rofi -show-icons -show drun +bind = $mainMod, P, pseudo, # dwindle +bind = $mainMod, I, togglesplit, # dwindle +bind = $mainMod, F, fullscreen, 0 +bind = $mainMod, M, fullscreen, 1 +bind = $mainMod SHIFT,F,fakefullscreen +bind = $mainMod SHIFT, Q, killactive, +bind = $mainMod SHIFT, E, exit, + +# Apps +bind = $mainMod, B, exec, firefox +bind = $mainMod, T, exec, telegram-desktop +bind = $mainMod, E, exec, emacsclient -c -a "emacs" +bind = $mainMod CONTROL, E, exec, emacs + +# Screenshooting +bind = , Print, exec, $scripts/hshot -m +bind = ALT, Print, exec, $scripts/hshot -w +bind = SHIFT, Print, exec, $scripts/hshot -s +bind = CONTROL, Print, exec, $scripts/hshot -m -c +bind = ALT_CONTROL, Print, exec, $scripts/hshot -w -c +bind = CONTROL_SHIFT, Print, exec, $scripts/hshot -s -c + +# Volume +$volDev = wpctl status | grep '*' -m 1 | awk '{print $3 - 0}' | xargs -I _ +bind = ,0x1008FF11,exec,$volDev wpctl set-volume _ 5%- +bind = ,0x1008FF13,exec,$volDev wpctl set-volume _ 5%+ +bind = ,0x1008FF12,exec,$volDev wpctl set-mute _ toggle + +# Brightness +bind = ,XF86MonBrightnessUp,exec,brightnessctl s +5% +bind = ,0x1008FF03,exec,brightnessctl s 5%- +# Move focus with mainMod + arrow keys +bind = $mainMod, J, movefocus, d +bind = $mainMod, K, movefocus, u +bind = $mainMod, H, movefocus, l +bind = $mainMod, L, movefocus, r # Move windows bind = SUPER_SHIFT,J,movewindow,d @@ -133,53 +163,50 @@ bind = SUPER_SHIFT,K,movewindow,u bind = SUPER_SHIFT,H,movewindow,l bind = SUPER_SHIFT,L,movewindow,r -# Move through workspaces -bind = SUPER,1,workspace,1 -bind = SUPER,2,workspace,2 -bind = SUPER,3,workspace,3 -bind = SUPER,4,workspace,4 -bind = SUPER,5,workspace,5 -bind = SUPER,6,workspace,6 -bind = SUPER,7,workspace,7 -bind = SUPER,8,workspace,8 -bind = SUPER,9,workspace,9 -bind = SUPER,0,workspace,10 - -# Move app to workspace -bind = ALT,1,movetoworkspace,1 -bind = ALT,2,movetoworkspace,2 -bind = ALT,3,movetoworkspace,3 -bind = ALT,4,movetoworkspace,4 -bind = ALT,5,movetoworkspace,5 -bind = ALT,6,movetoworkspace,6 -bind = ALT,7,movetoworkspace,7 -bind = ALT,8,movetoworkspace,8 -bind = ALT,9,movetoworkspace,9 -bind = ALT,0,movetoworkspace,10 - -# Move app to workspace silent -bind = SUPER_SHIFT,1,movetoworkspacesilent,1 -bind = SUPER_SHIFT,2,movetoworkspacesilent,2 -bind = SUPER_SHIFT,3,movetoworkspacesilent,3 -bind = SUPER_SHIFT,4,movetoworkspacesilent,4 -bind = SUPER_SHIFT,5,movetoworkspacesilent,5 -bind = SUPER_SHIFT,6,movetoworkspacesilent,6 -bind = SUPER_SHIFT,7,movetoworkspacesilent,7 -bind = SUPER_SHIFT,8,movetoworkspacesilent,8 -bind = SUPER_SHIFT,9,movetoworkspacesilent,9 -bind = SUPER_SHIFT,0,movetoworkspacesilent,10 - -# Mouse binds -bind = SUPER,mouse_down,workspace,e+1 -bind = SUPER,mouse_up,workspace,e-1 -bind = SUPER,up,workspace,e+1 - -# Startup apps -exec-once = mako -exec-once = dbus-update-activation-environment --systemd WAYLAND_DISPLAY XDG_CURRENT_DESKTOP -exec-once = /usr/lib/polkit-kde-authentication-agent-1 -exec-once = emacs --daemon -exec-once = wl-paste --type text --watch cliphist store -exec-once = wl-paste --type image --watch cliphist store -exec-once = hyprctl setcursor Bibata-Modern-Ice 13 -exec-once = swww init
\ No newline at end of file +# Switch workspaces with mainMod + [0-9] +bind = $mainMod, 1, workspace, 1 +bind = $mainMod, 2, workspace, 2 +bind = $mainMod, 3, workspace, 3 +bind = $mainMod, 4, workspace, 4 +bind = $mainMod, 5, workspace, 5 +bind = $mainMod, 6, workspace, 6 +bind = $mainMod, 7, workspace, 7 +bind = $mainMod, 8, workspace, 8 +bind = $mainMod, 9, workspace, 9 +bind = $mainMod, 0, workspace, 10 + +# Move active window to a workspace with mainMod + SHIFT + [0-9] +bind = $mainMod SHIFT, 1, movetoworkspacesilent, 1 +bind = $mainMod SHIFT, 2, movetoworkspacesilent, 2 +bind = $mainMod SHIFT, 3, movetoworkspacesilent, 3 +bind = $mainMod SHIFT, 4, movetoworkspacesilent, 4 +bind = $mainMod SHIFT, 5, movetoworkspacesilent, 5 +bind = $mainMod SHIFT, 6, movetoworkspacesilent, 6 +bind = $mainMod SHIFT, 7, movetoworkspacesilent, 7 +bind = $mainMod SHIFT, 8, movetoworkspacesilent, 8 +bind = $mainMod SHIFT, 9, movetoworkspacesilent, 9 +bind = $mainMod SHIFT, 0, movetoworkspacesilent, 10 + +bind = $mainMod ALT, 1, movetoworkspace, 1 +bind = $mainMod ALT, 2, movetoworkspace, 2 +bind = $mainMod ALT, 3, movetoworkspace, 3 +bind = $mainMod ALT, 4, movetoworkspace, 4 +bind = $mainMod ALT, 5, movetoworkspace, 5 +bind = $mainMod ALT, 6, movetoworkspace, 6 +bind = $mainMod ALT, 7, movetoworkspace, 7 +bind = $mainMod ALT, 8, movetoworkspace, 8 +bind = $mainMod ALT, 9, movetoworkspace, 9 +bind = $mainMod ALT, 0, movetoworkspace, 10 + + +# Example special workspace (scratchpad) +bind = $mainMod, S, togglespecialworkspace, magic +bind = $mainMod SHIFT, S, movetoworkspace, special:magic + +# Scroll through existing workspaces with mainMod + scroll +bind = $mainMod, mouse_down, workspace, e+1 +bind = $mainMod, mouse_up, workspace, e-1 + +# Move/resize windows with mainMod + LMB/RMB and dragging +bindm = $mainMod, mouse:272, movewindow +bindm = $mainMod, mouse:273, resizewindow diff --git a/nixos/general.nix b/nixos/general.nix index f02e889..6eb11ff 100644 --- a/nixos/general.nix +++ b/nixos/general.nix @@ -37,13 +37,15 @@ networking.networkmanager = { enable = true; }; - networking.firewall.enable = false; networking.nftables.enable = true; + boot.loader = { systemd-boot.enable = true; efi.canTouchEfiVariables = true; }; + security.rtkit.enable = true; + services.pipewire = { enable = true; audio.enable = true; diff --git a/nixos/laptop/configuration.nix b/nixos/laptop/configuration.nix index 948aed6..7d38479 100644 --- a/nixos/laptop/configuration.nix +++ b/nixos/laptop/configuration.nix @@ -42,6 +42,13 @@ users.jerpo = import ../../home-manager/laptop; }; + services.logind.extraConfig = '' + HandlePowerKey=ignore + HandleLidSwitch=suspend + HandleLidSwitchExternalPower=suspend + ''; + + # https://nixos.wiki/wiki/FAQ/When_do_I_update_stateVersion system.stateVersion = "23.05"; } |
