diff --git a/flake.nix b/flake.nix index 1e16d70a..f6b67adc 100644 --- a/flake.nix +++ b/flake.nix @@ -24,12 +24,11 @@ systemModules = [ ./system/hyprland.nix ]; homeModules = [ ./home/accounts/default.nix - ./home/emacs/default.nix ./home/hyprland/default.nix - ./home/nyxt/default.nix ./home/alacritty.nix ./home/btop.nix ./home/default.nix + ./home/emacs.nix ./home/firefox.nix ./home/media.nix ./home/pass.nix diff --git a/home/emacs/default.nix b/home/emacs.nix similarity index 95% rename from home/emacs/default.nix rename to home/emacs.nix index 40633d50..92836470 100644 --- a/home/emacs/default.nix +++ b/home/emacs.nix @@ -1,13 +1,9 @@ -{ config, pkgs, ... }: - -{ - xdg.configFile = { - "emacs/init.el".source = ./init.el; - "emacs/templates".source = ./templates; - }; +{ config, pkgs, ... }: { programs.emacs = { + # Clone emacs config from https://git.xenia.me.uk/xenia/emacs.git enable = true; package = pkgs.emacs29-pgtk; + extraConfig = ''(org-babel-load-file "~/Projects/emacs/README.org")''; extraPackages = epkgs: with epkgs; [ # theme diff --git a/home/emacs/init.el b/home/emacs/init.el deleted file mode 100644 index b8dc802b..00000000 --- a/home/emacs/init.el +++ /dev/null @@ -1,1191 +0,0 @@ -(setq custom-file (locate-user-emacs-file "custom.el")) -(when (and custom-file (file-exists-p custom-file)) - (load custom-file nil 'nomessage)) - -(setq user-full-name "Evie Litherland-Smith" - user-mail-address "evie@xenia.me.uk" - use-short-answers t - load-prefer-newer t - indent-tabs-mode nil - even-window-sizes nil - global-auto-revert-non-file-buffers t - dired-auto-revert-buffer t - dired-dwim-target t - tab-always-indent 'complete - completion-cycle-threshold 3 - completions-detailed t - xref-show-definitions-function #'xref-show-definitions-completing-read - kill-do-not-save-duplicates t - auto-window-vscroll nil - fast-but-imprecise-scrolling t - scroll-conservatively 101 - scroll-margin 0 - scroll-preserve-screen-position 1) - -(set-default-coding-systems 'utf-8) -(set-terminal-coding-system 'utf-8) -(set-keyboard-coding-system 'utf-8) - -(global-auto-revert-mode +1) -(delete-selection-mode) -(recentf-mode -1) - - -(keymap-global-set "M-#" #'dictionary-lookup-definition) - -;; turn on spell checking, if available. -(when (and (require 'ispell nil :noerror) (executable-find ispell-program-name)) - (add-hook 'text-mode-hook #'flyspell-mode) - (add-hook 'prog-mode-hook #'flyspell-prog-mode)) - -;; Make shebang (#!) file executable when saved -(add-hook 'after-save-hook #'executable-make-buffer-file-executable-if-script-p) - -(setq backup-directory-alist '(("." . "~/.local/state/emacs/backups")) - tramp-backup-directory-alist backup-directory-alist - tramp-auto-save-directory (cdr (assoc "." tramp-backup-directory-alist))) - -(when (require 'package nil :noerror) - (add-to-list 'package-archives '("stable" . "https://stable.melpa.org/packages/")) - (add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/")) - - (setq package-archive-priorities '(("gnu" . 99) - ("nongnu" . 80) - ("stable" . 70) - ("melpa" . 0)))) - -(when (require 'auth-source nil :noerror) - (setq auth-sources '("secrets:Login")) - (when (require 'auth-source-pass nil :noerror) - (auth-source-pass-enable))) - -;; Make `describe-*' screens more helpful -(use-package helpful - :ensure t - :bind ((" " . helpful-command) - (" " . helpful-callable) - (" " . helpful-key) - (" " . helpful-symbol) - (" " . helpful-variable) - ("C-h F" . helpful-function) - :map helpful-mode-map - (" " . helpful-update))) - -;; Bind extra `describe-*' commands -(keymap-global-set "C-h K" #'describe-keymap) - -(use-package ibuffer - :ensure t - :bind (("C-c b" . ibuffer))) - -(use-package ibuffer-project - :ensure t - :after ibuffer - :hook ((ibuffer . (lambda () - (setq ibuffer-filter-groups (ibuffer-project-generate-filter-groups)) - (unless (eq ibuffer-sorting-mode 'project-file-relative) - (ibuffer-do-sort-by-project-file-relative)))))) - -(use-package link-hint - :ensure t - :bind (("C-c l o" . link-hint-open-link) - ("C-c l c" . link-hint-copy-link) - ("C-c l C-o" . link-hint-open-all-link) - ("C-c l C-c" . link-hint-copy-all-link))) - -(use-package avy - :ensure t - :bind (("C-c j w" . avy-goto-word-0) - ("C-c j c" . avy-goto-char) - ("C-c j l" . avy-goto-line) - ("C-c j C-c" . avy-goto-char-2))) - -(use-package which-func - :ensure t - :init (which-function-mode)) - -(setq use-dialog-box nil - truncate-lines nil - truncate-partial-width-windows nil) - -(menu-bar-mode -1) -(tool-bar-mode -1) -(scroll-bar-mode -1) -(tab-bar-mode -1) -(global-display-line-numbers-mode -1) -(global-prettify-symbols-mode +1) -(global-visual-line-mode +1) - -(use-package which-key - :ensure t - :config (which-key-mode +1)) - -(use-package page-break-lines - :ensure t - :config (global-page-break-lines-mode +1)) - -;; add visual pulse when changing focus, like beacon but built-in -;; from from https://karthinks.com/software/batteries-included-with-emacs/ -(defun pulse-line (&rest _) - "Pulse the current line." - (pulse-momentary-highlight-one-line (point))) - -(dolist (command '(scroll-up-command - scroll-down-command - recenter-top-bottom - other-window)) - (advice-add command :after #'pulse-line)) - -(set-frame-parameter nil 'alpha-background 80) -(set-frame-font "Fira Code-12") - -;; Theme -(use-package modus-themes - :ensure t - :custom (modus-themes-disable-other-themes t) - :config (modus-themes-load-theme 'modus-vivendi-tinted)) - -;; Nerd-Icons modes -(use-package nerd-icons - :ensure t - :config (nerd-icons-set-font "Symbols Nerd Font Mono")) - -(use-package nerd-icons-dired - :ensure t - :hook (dired-mode)) - -(use-package nerd-icons-ibuffer - :ensure t - :hook (ibuffer-mode)) - -(use-package nerd-icons-completion - :ensure t - :config (nerd-icons-completion-mode +1)) - -(use-package nerd-icons-corfu - :ensure t - :after corfu - :config (add-to-list 'corfu-margin-formatters #'nerd-icons-corfu-formatter)) - -(keymap-global-set "C-c i n" #'nerd-icons-insert) - -(use-package winner - :ensure t - :demand - :bind (("C-c w u" . winner-undo) - ("C-c w r" . winner-redo)) - :config - (winner-mode)) - -(use-package ediff - :bind (("C-c d f" . ediff-files) - ("C-c d b" . ediff-buffers) - ("C-c d 3 f" . ediff-files3) - ("C-c d 3 b" . ediff-buffers3)) - :custom - (ediff-window-setup-function #'ediff-setup-windows-plain)) - -(use-package ligature - :ensure t - :config - ;; Enable the "www" ligature in every possible major mode - (ligature-set-ligatures 't '("www")) - ;; Enable traditional ligature support in eww-mode, if the - ;; `variable-pitch' face supports it - (ligature-set-ligatures 'eww-mode '("ff" "fi" "ffi")) - ;; Enable all Cascadia and Fira Code ligatures in programming modes - (ligature-set-ligatures '(prog-mode org-mode) - '(;; == === ==== => =| =>>=>=|=>==>> ==< =/=//=// =~ - ;; =:= =!= - ("=" (rx (+ (or ">" "<" "|" "/" "~" ":" "!" "=")))) - ;; ;; ;;; - (";" (rx (+ ";"))) - ;; && &&& - ("&" (rx (+ "&"))) - ;; !! !!! !. !: !!. != !== !~ - ("!" (rx (+ (or "=" "!" "\." ":" "~")))) - ;; ?? ??? ?: ?= ?. - ("?" (rx (or ":" "=" "\." (+ "?")))) - ;; %% %%% - ("%" (rx (+ "%"))) - ;; |> ||> |||> ||||> |] |} || ||| |-> ||-|| - ;; |->>-||-<<-| |- |== ||=|| - ;; |==>>==<<==<=>==//==/=!==:===> - ("|" (rx (+ (or ">" "<" "|" "/" ":" "!" "}" "\]" - "-" "=" )))) - ;; \\ \\\ \/ - ("\\" (rx (or "/" (+ "\\")))) - ;; ++ +++ ++++ +> - ("+" (rx (or ">" (+ "+")))) - ;; :: ::: :::: :> :< := :// ::= - (":" (rx (or ">" "<" "=" "//" ":=" (+ ":")))) - ;; // /// //// /\ /* /> /===:===!=//===>>==>==/ - ("/" (rx (+ (or ">" "<" "|" "/" "\\" "\*" ":" "!" - "=")))) - ;; .. ... .... .= .- .? ..= ..< - ;; ("\." (rx (or "=" "-" "\?" "\.=" "\.<" (+ "\.")))) - ;; -- --- ---- -~ -> ->> -| -|->-->>->--<<-| - ("-" (rx (+ (or ">" "<" "|" "~" "-")))) - ;; *> */ *) ** *** **** - ("*" (rx (or ">" "/" ")" (+ "*")))) - ;; www wwww - ("w" (rx (+ "w"))) - ;; <> >->--<<-| - ("-" (rx (+ (or ">" "<" "|" "~" "-")))) - ;; *> */ *) ** *** **** - ("*" (rx (or ">" "/" ")" (+ "*")))) - ;; www wwww - ("w" (rx (+ "w"))) - ;; <> 8---" n r n - "--8<---------------cut here---------------end--------------->8---" n) -(rot13 (p "plain text" text) n "----" n (rot13 text)) -(calc (p "taylor(sin(x),x=0,3)" formula) n "----" n (format "%s" (calc-eval formula))) - -rst-mode - -(title (make-string (length title) ?=) n (p "Title: " title) n (make-string (length title) ?=) n) - -java-mode - -(class "public class " (p (file-name-base (or (buffer-file-name) (buffer-name)))) " {" n> r> n "}") - -c-mode :when (re-search-backward "^\\S-*$" (line-beginning-position) 'noerror) - -(inc "#include <" (p (concat (file-name-base (or (buffer-file-name) (buffer-name))) ".h")) ">") -(incc "#include \"" (p (concat (file-name-base (or (buffer-file-name) (buffer-name))) ".h")) "\"") - -org-mode - -(caption "#+caption: ") -(drawer ":" p ":" n r ":end:") -(begin "#+begin_" (s name) n> r> n "#+end_" name) -(quote "#+begin_quote" n> r> n "#+end_quote") -(sidenote "#+begin_sidenote" n> r> n "#+end_sidenote") -(marginnote "#+begin_marginnote" n> r> n "#+end_marginnote") -(example "#+begin_example" n> r> n "#+end_example") -(center "#+begin_center" n> r> n "#+end_center") -(ascii "#+begin_export ascii" n> r> n "#+end_export") -(html "#+begin_export html" n> r> n "#+end_export") -(latex "#+begin_export latex" n> r> n "#+end_export") -(comment "#+begin_comment" n> r> n "#+end_comment") -(verse "#+begin_verse" n> r> n "#+end_verse") -(src "#+begin_src " q n r n "#+end_src") -(gnuplot "#+begin_src gnuplot :var data=" (p "table") " :file " (p "plot.png") n r n "#+end_src" :post (org-edit-src-code)) -(elisp "#+begin_src emacs-lisp" n r n "#+end_src" :post (org-edit-src-code)) -(inlsrc "src_" p "{" q "}") -(title "#+title: " p n "#+author: Daniel Mendler" n "#+language: en") - -;; Local Variables: -;; mode: lisp-data -;; outline-regexp: "[a-z]" -;; End: diff --git a/home/hyprland/config.nix b/home/hyprland/config.nix index 0f6690e5..a7170055 100644 --- a/home/hyprland/config.nix +++ b/home/hyprland/config.nix @@ -190,7 +190,6 @@ in '' bind = SUPER, W, moveworkspacetomonitor, name:web current bind = SUPER, W, workspace, name:web bind = SUPER SHIFT, W, movetoworkspace, name:web - bind = SUPER ALT, W, exec, [workspace name:web] nyxt windowrule = workspace name:web, (firefox|chromium-browser) bind = SUPER, T, moveworkspacetomonitor, name:top current