From: Preston Pan Date: Fri, 17 Oct 2025 22:05:36 +0000 (-0700) Subject: assembling big monorepo update X-Git-Url: https://ret2pop.net/gitweb/?a=commitdiff_plain;h=HEAD;p=monorepo.git assembling big monorepo update --- diff --git a/.env b/.env index 2b9e0a9..b232917 100644 --- a/.env +++ b/.env @@ -1,4 +1,4 @@ OPENAI_API_KEY=nothing OPENAI_BASE_URL="http://localhost:11434/v1" -OPENAI_MODEL=bjoernb/qwen3-coder-30b-1m:latest +OPENAI_MODEL=qwen3-coder:latest TAVILY_API_KEY=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 diff --git a/QWEN.md b/QWEN.md index dbfd8e5..b689482 100644 --- a/QWEN.md +++ b/QWEN.md @@ -1,4 +1,22 @@ -* Git Branch +# Git Branch The main branch for this repo is `main`. -* Project +# Project This project mainly deals with nix files and elisp. Otherwise it is emacs org mode. +# Tool Calling +If you fail a tool call, please retry but FIRST read the attempted tool call and then write the correct one that does the same thing. +THE CORRECT TOOL CALL NAMES are: +- Edit +- ExitPlanMode +- FindFiles +- ReadFile +- ReadFolder +- ReadManyFiles +- SaveMemory +- SearchText +- Shell +- Task +- TodoWrite +- WebFetch +- WebSearch +- WriteFile +THERE ARE NO OTHER TOOLS. diff --git a/agenda.org b/agenda.org index 91c7a3a..bb13596 100644 --- a/agenda.org +++ b/agenda.org @@ -55,28 +55,23 @@ These are one-time tasks that are scheduled at a particular date, and that don't schedules. ** Appointments These are tasks related to my appointments which have to be at a specific time. -*** DONE Appointment Call -I have an appointment in a couple days. -SCHEDULED: <2025-09-16 Tue 15:45> -*** DONE Friends Stay a Night -SCHEDULED: <2025-09-23 Tue> -*** DONE Optometry appointment -SCHEDULED: <2025-09-29 Mon 16:45> -For eye health @ Mount Pleasant Optometry. -*** DONE Magbay Concert -SCHEDULED: <2025-09-30 Tue> -Exciting! -*** TODO Covet Concert -SCHEDULED: <2025-10-10 Fri> -Exciting! -*** TODO BCID -SCHEDULED: <2025-10-04 Fri 03:40> ** Friends These are tasks related to seeing my friends. There will be tasks listed here when I schedule something. * Habits These are some habits I want to track. They are repeated according to a calendar schedule in general. +** TODO Skincare +SCHEDULED: <2025-10-17 Fri .+1d> +:PROPERTIES: +:LAST_REPEAT: [2025-10-16 Thu 18:06] +:END: +- State "DONE" from "TODO" [2025-10-16 Thu 18:06] +Current stack: +- Retinol (2x/day) +- Salicylic acid Cleanser (2x/day) +- Hyaluronic acid (2x/day) +- Glycerin for hands ** TODO Supplements SCHEDULED: <2025-10-01 Wed .+1d> :PROPERTIES: @@ -109,12 +104,14 @@ Current stack: - Vitamin D3 - EPA/DHA - Creatine Monohydrate +- Coffee ** TODO Strength Training -SCHEDULED: <2025-09-29 Mon .+1d> +SCHEDULED: <2025-10-17 Fri .+2d> :PROPERTIES: -:LAST_REPEAT: [2025-09-28 Sun 20:52] +:LAST_REPEAT: [2025-10-16 Thu 18:08] :STYLE: habit :END: +- State "DONE" from "TODO" [2025-10-16 Thu 18:08] - State "DONE" from "TODO" [2025-09-28 Sun 20:52] - State "DONE" from "TODO" [2025-09-24 Wed 07:08] - State "DONE" from "TODO" [2025-09-21 Sun 06:57] @@ -153,6 +150,14 @@ SCHEDULED: <2025-09-25 Thu .+1d> - State "DONE" from "TODO" [2025-02-11 Tue 04:01] - State "DONE" from "TODO" [2025-01-11 Sat 02:26] I want to stretch every day so that I can become more flexible. +Stretches: +- Splits attempt +- Hands to floor +- Calves +- Butterfly +- Arms in general i guess +- Seal +- Cat ** TODO Journal SCHEDULED: <2025-09-29 Mon .+1d> :PROPERTIES: @@ -182,3 +187,9 @@ SCHEDULED: <2025-09-29 Mon .+1d> - State "DONE" from "TODO" [2025-01-16 Thu 19:19] - State "DONE" from "TODO" [2025-01-11 Sat 02:25] I want to journal every day, at least a little bit, about my life and track it with a git repo. +** TODO Update Agenda +If I didn't update the agenda today, take my agenda with a grain of salt. +SCHEDULED: <2025-10-16 Thu .+1d> +** TODO Start Vacuum Robot +Start the vacuum robot so that it can clean the floor, every day. +SCHEDULED: <2025-10-16 Thu .+1d> diff --git a/config/elfeed.org b/config/elfeed.org index 2f85143..4513359 100644 --- a/config/elfeed.org +++ b/config/elfeed.org @@ -34,6 +34,14 @@ This is a list of NASA feeds: These are YouTube channels that I find interesting enough to keep up with. Note that I keep up with a variety of thinkers that I may or may not disagree with, but they are nonetheless the most intellectual version of what their general cohort say: +*** [[https://youtube.com/feeds/videos.xml?channel_id=UCKGCof63C6pLCFT4R6YPEtQ][Jred]] +This youtube channel is about existential dread apparently. I don't have such a thing but it's fun to watch anyways. +*** [[https://youtube.com/feeds/videos.xml?channel_id=UCwVevVbti5Uuxj6Mkl5NHRA][Lemonade Stand]] +Podcast channel that talks about modern day economics. +*** [[https://youtube.com/feeds/videos.xml?channel_id=UCSHZKyawb77ixDdsGog4iWA][Lex Fridman]] +He has some good guests on sometimes. +*** [[https://youtube.com/feeds/videos.xml?channel_id=UCXl4i9dYBrFOabk0xGmbkRA][Dwarkesh Patel]] +Makes podcasts whose guests are usually AI researchers of some kind. *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC1yNl2E66ZzKApQdRuTQ4tw][Sabine Hossenfelder]] Youtube channel about mostly physics related content (I do not endorse her views on string theory). *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UC7_gcs09iThXybpVgjHZ_7g][PBS Space Time]] @@ -56,6 +64,8 @@ Makes good videos about basically anything. Makes good videos about Linux and life stuff. *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCSNBahoyPlMUz-3U2e_Czcw][Bridges]] :podcast: This podcast is run by Destiny, and it features good guests. +*** [[https://youtube.com/feeds/videos.xml?channel_id=UCgv4dPk_qZNAbUW9WkuLPSA][Atrioc]] +Features some good marketing and economics content. Big A is his secondary channel. *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCdBXOyqr8cDshsp7kcKDAkg][Big A]] Marketing Monday features good economics content. *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCTpmmkp1E4nmZqWPS-dl5bg][Quanta Magazine]] @@ -66,13 +76,23 @@ Videos about NRx. Linux videos. *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCU1oodg2ptN51N5rwevwnng][Unlearning Economics]] Videos about economics from a Marxist perspective. +*** [[https://youtube.com/feeds/videos.xml?channel_id=UCHnyfMqiRRG1u-2MsSQLbXA][Veritasium]] +Makes good educational videos. ** Blogs :blog: Here are some interesting blogs, many of which are from substack. *** [[https://terrytao.wordpress.com/feed/][Terence Tao]] I like math. -*** [[https://graymirror.substack.com/feed][Gray Mirror]] -Curtis Yarvin is quite the interesting person. -*** [[https://www.richardhanania.com/feed][Richard Hanania]] -Richard is a political commentator. *** [[https://lukesmith.xyz/index.xml][Luke Smith]] :lukesmith: Luke Smith is quite the interesting person. +*** Substack :substack: +These are a list of all the substack blogs that exist. +**** [[https://graymirror.substack.com/feed][Gray Mirror]] +Curtis Yarvin is quite the interesting person. +**** [[https://www.richardhanania.com/feed][Richard Hanania]] +Richard is a political commentator. +**** [[https://paulkrugman.substack.com/feed][Paul Krugman]] +He makes good economics blogs as he used to be a professional economist. +**** [[https://www.overcomingbias.com/feed][Overcoming Bias]] +Makes the case for the glorious reign of Futarchy!! (Not what you think it is). +**** [[https://betonit.ai/feed][Bryan Caplan]] +Anarcho Capitalist person. diff --git a/config/emacs.el b/config/emacs.el index 21bef16..794d021 100644 --- a/config/emacs.el +++ b/config/emacs.el @@ -9,6 +9,9 @@ (warning-minimum-level :emergency "Supress emacs warnings") (confirm-kill-processes nil "Don't ask to quit") (debug-ignored-errors (cons 'remote-file-error debug-ignored-errors) "Remove annoying error from debug errors") +(browse-url-generic-program "firefox") +(browse-url-secondary-browser-function 'browse-url-generic) +(browse-url-browser-function 'browse-url-generic) ;; Mouse wheel (mouse-wheel-scroll-amount '(1 ((shift) . 1)) "Nicer scrolling") @@ -278,6 +281,7 @@ (doom-themes-visual-bell-config) (doom-themes-treemacs-config) (doom-themes-org-config)) +;; (load-theme 'catppuccin :no-confirm) (use-package writegood-mode :hook (text-mode . writegood-mode)) @@ -562,7 +566,6 @@ (search-engine-default "google" "Use google as default") (eww-search-prefix "https://google.com/search?q=" "Google prefix") - (browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "firefox" "Use firefox as secondary browser") :hook ((eww-mode . (lambda () (local-set-key (kbd "y Y") #'eww-copy-page-url))))) (use-package org-roam diff --git a/config/emacs.org b/config/emacs.org index da749e0..72bf26c 100644 --- a/config/emacs.org +++ b/config/emacs.org @@ -14,7 +14,7 @@ is some imperative programming that must be done. Hooks are also largely declara configuration as they are also defined using the use-package macros. Some of these options will have documentation strings attached, so it is easy to follow what the individual options do. Emacs is self documenting, after all! -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package emacs :custom ;; global defaults @@ -26,6 +26,9 @@ Emacs is self documenting, after all! (warning-minimum-level :emergency "Supress emacs warnings") (confirm-kill-processes nil "Don't ask to quit") (debug-ignored-errors (cons 'remote-file-error debug-ignored-errors) "Remove annoying error from debug errors") + (browse-url-generic-program "firefox") + (browse-url-secondary-browser-function 'browse-url-generic) + (browse-url-browser-function 'browse-url-generic) ;; Mouse wheel (mouse-wheel-scroll-amount '(1 ((shift) . 1)) "Nicer scrolling") @@ -128,7 +131,7 @@ little in config as possible. I hardly consider most of this configuration to be of course Emacs was not designed to be fully imperative. ** Org Mode This is my org mode configuration, which also configures latex. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package org :hook ((org-mode-hook . (lambda () (remove-hook 'post-self-insert-hook #'yaml-electric-bar-and-angle t)))) @@ -144,7 +147,7 @@ This is my org mode configuration, which also configures latex. (TeX-engine 'xetex "set xelatex as default engine") (preview-default-option-list '("displaymath" "textmath" "graphics") "preview latex") (preview-image-type 'png "Use PNGs") - (org-format-latex-options (plist-put org-format-latex-options :scale 1.5) "space latex better") +;; (org-format-latex-options (plist-put org-format-latex-options :scale 1.5) "space latex better") (org-return-follows-link t "be able to follow links without mouse") (org-habit-preceding-days 7 "See org habit entries") (org-habit-following-days 35 "See org habit entries") @@ -191,27 +194,27 @@ As you can see, I only have one real entry in config here (I don't count require they have to be on the top) * Unicode I want emacs to have unicode fonts. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package unicode-fonts :init (unicode-fonts-setup)) #+end_src * Autopair Use electric-pair to automatically complete pairs of things. We need to change what electric-pair does based on the mode. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package electric-pair :hook ((prog-mode . electric-pair-mode) (org-mode . (lambda () (setq-local electric-pair-inhibit-predicate (lambda (c) (if (eq c ?<) t (electric-pair-default-inhibit c)))))))) #+end_src * Search and Replace wgrep is a program that allows you to do more intelligent search and replace. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package wgrep :after grep) #+end_src * Passwords This is a function that inserts a random password into the buffer. I use this to manage sops-nix. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (defun insert-urandom-password (&optional length) (interactive "P") (let ((length (or length 32)) @@ -227,12 +230,12 @@ This is a function that inserts a random password into the buffer. I use this to * Fragtog This package is used to generate previews automatically when your cursor hovers over a latex snippet. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package org-fragtog :hook (org-mode . org-fragtog-mode)) #+end_src * Snippets Yasnippets are useful for macros that automatically complete to an arbitrary form. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package yasnippet :config (add-to-list 'yas-snippet-dirs "~/monorepo/yasnippet/") @@ -241,7 +244,7 @@ Yasnippets are useful for macros that automatically complete to an arbitrary for #+end_src * Completion Company-mode! We need this to do autocomplete stuff. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package company :config '(add-to-list 'company-backends '(company-ispell company-capf company-yasnippet company-files)) @@ -250,7 +253,7 @@ Company-mode! We need this to do autocomplete stuff. * Spelling This loads a dictionary so that I can save certain words to be not misspelled and also have this spellcheck during org mode. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package ispell :custom (ispell-program-name "aspell" "use aspell") @@ -263,7 +266,7 @@ this spellcheck during org mode. #+end_src * Packages First, some small configurations and some evil-mode initilaization because I like vim keybindings: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package evil :custom (evil-want-keybinding nil "Don't load a whole bunch of default keybindings") @@ -308,7 +311,7 @@ First, some small configurations and some evil-mode initilaization because I lik #+end_src ** Journal I use org-journal to journal about my life, and it's a part of my website: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package org-journal :after (org) :custom @@ -329,7 +332,7 @@ I use org-journal to journal about my life, and it's a part of my website: #+end_src ** Doom Modeline The default modeline is ugly. I replace it with the doom modeline because it's better. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package doom-modeline :config (doom-modeline-mode 1)) @@ -337,7 +340,7 @@ The default modeline is ugly. I replace it with the doom modeline because it's b *** Doom Theme I used to use catppuccin, but the doom themes are so good that I am willing to break some theme consistency with my desktop in order to use doom themes. I mean it looks better anyways if emacs is a distinct theme. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package doom-themes :ensure t :custom @@ -350,23 +353,24 @@ to use doom themes. I mean it looks better anyways if emacs is a distinct theme. (doom-themes-visual-bell-config) (doom-themes-treemacs-config) (doom-themes-org-config)) + ;; (load-theme 'catppuccin :no-confirm) #+end_src ** Grammar I want to write good! I grammar good too. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package writegood-mode :hook (text-mode . writegood-mode)) #+end_src ** Make Org Look Better Org superstar adds those nice looking utf-8 bullets: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package org-superstar :after (org) :hook (org-mode . (lambda () (org-superstar-mode 1)))) #+end_src ** LSP We set up eglot, the LSP manager for emacs, now built in: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el ;; (use-package eglot ;; :hook ;; (prog-mode . eglot-ensure) @@ -396,7 +400,7 @@ We set up eglot, the LSP manager for emacs, now built in: #+end_src *** C/C++ Specific configuration for C (I also use the clangd lsp): -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package irony-mode :hook ( (c++-mode . irony-mode) @@ -409,7 +413,7 @@ Specific configuration for C (I also use the clangd lsp): #+end_src *** Solidity For writing solidity: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package solidity-mode) (use-package company-solidity) (use-package solidity-flycheck @@ -418,7 +422,7 @@ For writing solidity: #+end_src ** Projectile Manages projects and shit. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package projectile :custom (projectile-project-search-path '("~/org" "~/src" "~/monorepo" "~/projects") "search path for projects") @@ -427,7 +431,7 @@ Manages projects and shit. #+end_src ** Dashboard We want our emacs initialization to be pretty and display useful things. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package dashboard :after (projectile) :custom @@ -446,7 +450,7 @@ We want our emacs initialization to be pretty and display useful things. #+end_src ** Ivy Ivy is a pretty cool general program for displaying stuff: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package counsel) (use-package ivy @@ -475,12 +479,12 @@ Ivy is a pretty cool general program for displaying stuff: I use it for an M-x replacement and a dired replacement, among other things. ** Magit I use magit in order to do all my git management in emacs. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package magit) #+end_src ** IRC Configure IRC to use my username. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package erc :custom (erc-nick system-username "sets erc username to the one set in nix config") @@ -490,7 +494,7 @@ Configure IRC to use my username. Global keybindings for everything that I care about globally. It's all here! I use general to manage my global keybindings in a declarative way. These are in part inspired by the doom emacs keybindings. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package general :init (defun prestonpan () @@ -588,7 +592,7 @@ emacs keybindings. ** LLM I use LLMs in order to help me come up with ideas. I use a local LLM so that I can have a competitive LLM that doesn't cost money. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package ellama :custom (ellama-sessions-directory "~/org/ellama/" "Set org directory for LLM sessions") @@ -601,7 +605,7 @@ competitive LLM that doesn't cost money. *** Minuet Minuet does my code completion, showing the potential code completion as a ghost and automatically completing the code when my cursor is still. It is kind of like copilot but it works with local LLMs, which is better. Though, it's obviously not always the most accurate. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package minuet :bind (("M-y" . #'minuet-complete-with-minibuffer) @@ -631,10 +635,14 @@ still. It is kind of like copilot but it works with local LLMs, which is better. ** RSS Feed I use really simple syndication (RSS) in order to read news. As a result, I use elfeed to fetch feeds found on my website: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package elfeed :custom (elfeed-search-filter "@1-month-ago +unread" "Only display unread articles from a month ago") + + :config + (run-with-timer 0 (* 60 60 4) 'elfeed-update) + :hook ((elfeed-search-mode . elfeed-update))) (use-package elfeed-org @@ -646,7 +654,7 @@ elfeed to fetch feeds found on my website: *** Youtube Then we set up elfeed-tube for Youtube video RSS feeds (so I don't ever have to use the web interface and can control it from emacs): -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package elfeed-tube :after elfeed :demand t @@ -670,7 +678,7 @@ interface and can control it from emacs): ** Project Drawer I use treemacs as my sidebar for projects, so that I can easily navigate to any file in the project directory. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package treemacs) (use-package treemacs-evil :after (treemacs evil)) @@ -682,7 +690,7 @@ project directory. ** Eww Used only for the purpose of viewing RSS feed items in emacs if I can, only resorting to Chromium if I have to: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package eww :custom (search-engines @@ -694,12 +702,11 @@ to Chromium if I have to: (search-engine-default "google" "Use google as default") (eww-search-prefix "https://google.com/search?q=" "Google prefix") - (browse-url-secondary-browser-function 'browse-url-generic browse-url-generic-program "firefox" "Use firefox as secondary browser") :hook ((eww-mode . (lambda () (local-set-key (kbd "y Y") #'eww-copy-page-url))))) #+end_src ** Org Roam For all my mathematics and programming notes: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package org-roam :after (org) :custom @@ -727,14 +734,14 @@ For all my mathematics and programming notes: ** Pinentry Set up pinentry so that I can use emacs as my pinentry frontend: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package pinentry :custom (epa-pinentry-mode `loopback "Set this option to match gpg-agent.conf") :config (pinentry-start)) #+end_src ** Email Email in emacs can be done with Mu4e. -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package smtpmail :custom (user-mail-address system-email "Use our email") @@ -768,7 +775,7 @@ Email in emacs can be done with Mu4e. #+end_src ** Music Set up emms in order to play music from my music directory: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package emms :custom (emms-source-file-default-directory (expand-file-name "~/music/") "Use directory specified in Nix") @@ -782,10 +789,25 @@ Set up emms in order to play music from my music directory: (add-to-list 'emms-player-list 'emms-player-mpd) :config (emms-player-mpd-connect)) #+end_src +** Tabs +I use tabs because sometimes I like using the mouse (it's actually more efficient to have the option for both, trust me. Keyboards aren't all it). +#+begin_src emacs-lisp :tangle ../nix/init.el + (use-package centaur-tabs + :custom + (centaur-tabs-set-icons t "use icons for centaur-tabs") + (centaur-tabs-set-modified-marker t "show when buffer modified") + (centaur-tabs-icon-type 'all-the-icons "use all-the-icons for icons") + :demand + :config + (centaur-tabs-mode t) + :bind + ("C-" . centaur-tabs-backward) + ("C-" . centaur-tabs-forward)) +#+end_src * Unpinned ** Lean4 For some reason, lean4-mode is not in MELPA currently so I have to do this ugly thing: -#+begin_src emacs-lisp +#+begin_src emacs-lisp :tangle ../nix/init.el (use-package lean4-mode :commands lean4-mode :vc (:url "https://github.com/leanprover-community/lean4-mode.git" diff --git a/config/nix.org b/config/nix.org index 90ae727..76dbf0b 100644 --- a/config/nix.org +++ b/config/nix.org @@ -601,12 +601,26 @@ I use IPFS for my website and also for my ISOs for truly declarative and determi configuration. NixOS might be moving to IPFS for binary cache distribution and package distribution soon, and I'm waiting on that. #+begin_src nix :tangle ../nix/modules/kubo.nix -{ config, pkgs, lib, ... }: -{ - services.kubo = { - enable = lib.mkDefault config.monorepo.profiles.workstation.enable; - }; -} + { config, pkgs, lib, ... }: + { + services.kubo = { + enable = lib.mkDefault config.monorepo.profiles.workstation.enable; + autoMount = false; + enableGC = true; + settings = { + Addresses.API = [ + "/ip4/127.0.0.1/tcp/5001" + ]; + Bootstrap = [ + "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu" + "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm" + ]; + Datastore = { + StorageMax = "20GB"; + }; + }; + }; + } #+end_src ** TODO Murmur #+begin_src nix :tangle ../nix/modules/murmur.nix @@ -1692,7 +1706,7 @@ because they enhance security. nix = { settings = { - experimental-features = "nix-command flakes"; + experimental-features = "nix-command flakes ca-derivations"; trusted-users = [ "@wheel" ]; }; }; @@ -2404,17 +2418,18 @@ as an org file which gets automatically tangled to an emacs-lisp file. (setq system-email "${config.monorepo.profiles.email.email}") (setq system-username "${config.monorepo.vars.internetName}") (setq system-fullname "${config.monorepo.vars.fullName}") - (org-babel-load-file - (expand-file-name "~/${config.monorepo.vars.repoName}/config/emacs.org"))''; + (load "${pkgs.writeText "init.el" (builtins.readFile ../../init.el)}") + ''; + extraPackages = epkgs: [ epkgs.agda2-mode epkgs.all-the-icons epkgs.auctex epkgs.catppuccin-theme - epkgs.chatgpt-shell epkgs.company epkgs.company-solidity epkgs.counsel + epkgs.centaur-tabs epkgs.dashboard epkgs.doom-themes epkgs.doom-modeline @@ -2631,7 +2646,10 @@ to use this component will come soon. "$mod SHIFT, L, movewindow, r" "$mod SHIFT, K, movewindow, u" "$mod SHIFT, J, movewindow, d" - "$mod, T, togglefloating" + + "$mod SHIFT, T, togglefloating" + "$mod SHIFT, F, fullscreen" + "$mod, H, movefocus, l" "$mod, L, movefocus, r" "$mod, K, movefocus, u" @@ -2933,9 +2951,26 @@ here: { gtk = { theme = { - package = pkgs.catppuccin-gtk; + name = "catppuccin-mocha-pink-standard"; + package = pkgs.catppuccin-gtk.override { + variant = "mocha"; + accents = [ "pink" ]; + }; }; }; + xdg.configFile = { + "gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets"; + "gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css"; + "gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css"; + + "gtk-3.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-3.0/gtk.css"; + "gtk-3.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-3.0/gtk-dark.css"; + "gtk-3.0/settings.ini".text = '' + [Settings] + gtk-theme-name=${config.gtk.theme.name} + gtk-application-prefer-dark-theme=1 + ''; + }; } #+end_src *** Secrets @@ -3605,13 +3640,13 @@ for these configurations. # Apps # octaveFull - vesktop grim swww vim telegram-desktop qwen-code fluffychat + vesktop grim swww vim telegram-desktop qwen-code fluffychat jami # Sound/media pavucontrol alsa-utils imagemagick ffmpeg helvum # Net - curl rsync git iamb + curl rsync git iamb ungoogled-chromium # Tor torsocks tor-browser @@ -3711,13 +3746,6 @@ for these configurations. }; programs.bash.enable = true; - - gtk = { - enable = lib.mkDefault config.monorepo.profiles.graphics.enable; - theme = null; - iconTheme = null; - }; - fonts.fontconfig.enable = true; } #+end_src diff --git a/models/qwen3/Modelfile b/models/qwen3/Modelfile index cbd310a..96d6912 100644 --- a/models/qwen3/Modelfile +++ b/models/qwen3/Modelfile @@ -1,8 +1,3 @@ -FROM renchris/qwen3-coder:30b-gguf-unsloth -# sets the temperature to 1 [higher is more creative, lower is more coherent] -PARAMETER temperature 0.7 -# sets the context window size to 4096, this controls how many tokens the LLM can use as context to generate the next token +FROM qwen3-coder:30b +PARAMETER temperature 0.5 PARAMETER num_ctx 8192 - -# sets a custom system message to specify the behavior of the chat assistant -SYSTEM You are Mario from super mario bros, acting as an assistant. \ No newline at end of file diff --git a/nix/flake.lock b/nix/flake.lock index e9b2a80..9f3aa76 100644 --- a/nix/flake.lock +++ b/nix/flake.lock @@ -157,11 +157,11 @@ ] }, "locked": { - "lastModified": 1756770412, - "narHash": "sha256-+uWLQZccFHwqpGqr2Yt5VsW/PbeJVTn9Dk6SHWhNRPw=", + "lastModified": 1759362264, + "narHash": "sha256-wfG0S7pltlYyZTM+qqlhJ7GMw2fTF4mLKCIVhLii/4M=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "4524271976b625a4a605beefd893f270620fd751", + "rev": "758cf7296bee11f1706a574c77d072b8a7baa881", "type": "github" }, "original": { @@ -414,11 +414,11 @@ ] }, "locked": { - "lastModified": 1758768328, - "narHash": "sha256-PSg4x8RopDaQ1fkAA9bkmNoSQny373LPwTb/VzlR4uY=", + "lastModified": 1759373157, + "narHash": "sha256-AdQmn5AASt6nUYxIAo+/+we312zqA0moB/Cuj7TsIC4=", "owner": "nixpak", "repo": "nixpak", - "rev": "d0a874ed12135081dfeed555eed8107ac55b01be", + "rev": "7cd8f919d173deeb1f6d01cfda22a84eeedba1ae", "type": "github" }, "original": { @@ -461,11 +461,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1758690382, - "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", + "lastModified": 1759381078, + "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e643668fd71b949c53f8626614b21ff71a07379d", + "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", "type": "github" }, "original": { @@ -477,11 +477,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1758690382, - "narHash": "sha256-NY3kSorgqE5LMm1LqNwGne3ZLMF2/ILgLpFr1fS4X3o=", + "lastModified": 1759381078, + "narHash": "sha256-gTrEEp5gEspIcCOx9PD8kMaF1iEmfBcTbO0Jag2QhQs=", "owner": "nixos", "repo": "nixpkgs", - "rev": "e643668fd71b949c53f8626614b21ff71a07379d", + "rev": "7df7ff7d8e00218376575f0acdcc5d66741351ee", "type": "github" }, "original": { @@ -493,11 +493,11 @@ }, "nixpkgs_4": { "locked": { - "lastModified": 1758976413, - "narHash": "sha256-hEIDTaIqvW1NMfaNgz6pjhZPZKTmACJmXxGr/H6isIg=", + "lastModified": 1759570798, + "narHash": "sha256-kbkzsUKYzKhuvMOuxt/aTwWU2mnrwoY964yN3Y4dE98=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "e3a3b32cc234f1683258d36c6232f150d57df015", + "rev": "0d4f673a88f8405ae14484e6a1ea870e0ba4ca26", "type": "github" }, "original": { @@ -513,11 +513,11 @@ "nixpkgs": "nixpkgs_3" }, "locked": { - "lastModified": 1759032479, - "narHash": "sha256-SHa7Pw3bQVZZ41FDf0b6SfSHHx4GzNQRAbHQmQWwSEA=", + "lastModified": 1759790712, + "narHash": "sha256-3KIfzcohPARwIc7nVtvioELW62+rXY7O3FhAIryqn4Y=", "owner": "nix-community", "repo": "NUR", - "rev": "eb0a72b223db0a0a9095ac53b375148e5f868775", + "rev": "9a6d13630a078d81d0a2d3500f3c00aa4b681c89", "type": "github" }, "original": { @@ -643,11 +643,11 @@ "nixpkgs": "nixpkgs_4" }, "locked": { - "lastModified": 1759030640, - "narHash": "sha256-53VP3BqMXJqD1He1WADTFyUnpta3mie56H7nC59tSic=", + "lastModified": 1759635238, + "narHash": "sha256-UvzKi02LMFP74csFfwLPAZ0mrE7k6EiYaKecplyX9Qk=", "owner": "Mic92", "repo": "sops-nix", - "rev": "9ac51832c70f2ff34fcc97b05fa74b4a78317f9e", + "rev": "6e5a38e08a2c31ae687504196a230ae00ea95133", "type": "github" }, "original": { diff --git a/nix/init.el b/nix/init.el new file mode 100644 index 0000000..7e88f49 --- /dev/null +++ b/nix/init.el @@ -0,0 +1,662 @@ +(use-package emacs +:custom +;; global defaults +(indent-tabs-mode nil "no real tabs, only spaces") +(tab-width 2 "tab show as 2 spaces") +(standard-indent 2 "base indentation") + +;; Startup errors +(warning-minimum-level :emergency "Supress emacs warnings") +(confirm-kill-processes nil "Don't ask to quit") +(debug-ignored-errors (cons 'remote-file-error debug-ignored-errors) "Remove annoying error from debug errors") +(browse-url-generic-program "firefox") +(browse-url-secondary-browser-function 'browse-url-generic) +(browse-url-browser-function 'browse-url-generic) + +;; Mouse wheel +(mouse-wheel-scroll-amount '(1 ((shift) . 1)) "Nicer scrolling") +(mouse-wheel-progressive-speed nil "Make scrolling non laggy") +(mouse-wheel-follow-mouse 't "Scroll correct window") +(scroll-conservatively 101 "Sort of smooth scrolling") +(scroll-step 1 "Scroll one line at a time") +(display-time-24hr-format t "Use 24 hour format to read the time") + (display-line-numbers-type 'relative "Relative line numbers for easy vim jumping") + (use-short-answers t "Use y instead of yes") + (make-backup-files nil "Don't make backups") + (display-fill-column-indicator-column 150 "Draw a line at 100 characters") + (fill-column 150) + (line-spacing 2 "Default line spacing") + (c-doc-comment-style '((c-mode . doxygen) + (c++-mode . doxygen))) + + :hook ((text-mode . visual-line-mode) + (prog-mode . display-line-numbers-mode) + (prog-mode . display-fill-column-indicator-mode) + (org-mode . auto-fill-mode) + (org-mode . display-fill-column-indicator-mode) + (org-mode . display-line-numbers-mode) + (org-mode . (lambda () + (setq prettify-symbols-alist + '(("#+begin_src" . ?) + ("#+BEGIN_SRC" . ?) + ("#+end_src" . ?) + ("#+END_SRC" . ?) + ("#+begin_example" . ?) + ("#+BEGIN_EXAMPLE" . ?) + ("#+end_example" . ?) + ("#+END_EXAMPLE" . ?) + ("#+header:" . ?) + ("#+HEADER:" . ?) + ("#+name:" . ?﮸) + ("#+NAME:" . ?﮸) + ("#+results:" . ?) + ("#+RESULTS:" . ?) + ("#+call:" . ?) + ("#+CALL:" . ?) + (":PROPERTIES:" . ?) + (":properties:" . ?) + ("lambda" . ?λ) + ("->" . ?→) + ("map" . ?↦) + ("/=" . ?≠) + ("!=" . ?≠) + ("==" . ?≡) + ("<=" . ?≤) + (">=" . ?≥) + ("&&" . ?∧) + ("||" . ?∨) + ("sqrt" . ?√) + ("..." . ?…))) + (prettify-symbols-mode))) + (prog-mode . + (lambda () + (setq prettify-symbols-alist + '(("lambda" . ?λ) + ("->" . ?→) + ("map" . ?↦) + ("/=" . ?≠) + ("!=" . ?≠) + ("==" . ?≡) + ("<=" . ?≤) + (">=" . ?≥) + ("&&" . ?∧) + ("||" . ?∨) + ("sqrt" . ?√) + ("..." . ?…))) + (prettify-symbols-mode)))) + :config + (require 'tex-site) + (server-start) + + ;; start wiith sane defaults + (pixel-scroll-precision-mode 1) + (display-battery-mode 1) + (display-time-mode 1) + (menu-bar-mode -1) + (scroll-bar-mode -1) + (tool-bar-mode -1) + + ;; load theme, fonts, and transparency. Prettify symbols. + (global-prettify-symbols-mode 1) + (set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 130) + (set-frame-parameter nil 'alpha-background 70) + (add-to-list 'default-frame-alist '(alpha-background . 70))) + +(use-package org + :hook + ((org-mode-hook . (lambda () (remove-hook 'post-self-insert-hook #'yaml-electric-bar-and-angle t)))) + :custom + (org-confirm-babel-evaluate nil "Don't ask to evaluate code block") + (org-export-with-broken-links t "publish website even with broken links") + (org-src-fontify-natively t "Colors!") + (org-latex-preview-image-directory (expand-file-name "~/.cache/ltximg/") "don't use weird cache location") + (org-preview-latex-image-directory (expand-file-name "~/.cache/ltximg/") "don't use weird cache location") + (TeX-PDF-mode t) + (org-latex-compiler "xelatex" "Use latex as default") + (org-latex-pdf-process '("xelatex -interaction=nonstopmode -output-directory=%o %f") "set xelatex as default") + (TeX-engine 'xetex "set xelatex as default engine") + (preview-default-option-list '("displaymath" "textmath" "graphics") "preview latex") + (preview-image-type 'png "Use PNGs") +;; (org-format-latex-options (plist-put org-format-latex-options :scale 1.5) "space latex better") + (org-return-follows-link t "be able to follow links without mouse") + (org-habit-preceding-days 7 "See org habit entries") + (org-habit-following-days 35 "See org habit entries") + (org-habit-show-habits t "See org habit entries") + (org-habit-show-habits-only-for-today nil "See org habit entries") + (org-habit-show-all-today t "Show org habit graph") + (org-startup-indented t "Indent the headings") + (org-image-actual-width '(300) "Cap width") + (org-startup-with-latex-preview t "see latex previews on opening file") + (org-startup-with-inline-images t "See images on opening file") + (org-hide-emphasis-markers t "prettify org mode") + (org-use-sub-superscripts "{}" "Only display superscripts and subscripts when enclosed in {}") + (org-pretty-entities t "prettify org mode") + (org-agenda-files (list "~/monorepo/agenda.org" "~/org/notes.org" "~/org/agenda.org") "set default org files") + (org-default-notes-file (concat org-directory "/notes.org") "Notes file") + (org-publish-project-alist + '(("website-org" + :base-directory "~/monorepo" + :base-extension "org" + :publishing-directory "~/website_html" + :recursive t + :publishing-function org-html-publish-to-html + :headline-levels 4 + :html-preamble t + :html-preamble-format (("en" "

home | section main page


"))) + ("website-static" + :base-directory "~/monorepo" + :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|ico\\|asc\\|pub\\|webmanifest\\|xml\\|svg" + :publishing-directory "~/website_html/" + :recursive t + :publishing-function org-publish-attachment) + ("website" :auto-sitemap t :components ("website-org" "website-static"))) "functions to publish website") + (org-html-postamble (concat "Copyright © 2024 " system-fullname) "set copyright notice on bottom of site") + :config + (require 'ox-publish) + (require 'org-tempo) + (require 'org-habit) + (org-babel-do-load-languages 'org-babel-load-languages + '((shell . t) + (python . t) + (latex . t)))) + +(use-package unicode-fonts + :init (unicode-fonts-setup)) + +(use-package electric-pair + :hook ((prog-mode . electric-pair-mode) + (org-mode . (lambda () (setq-local electric-pair-inhibit-predicate (lambda (c) (if (eq c ?<) t (electric-pair-default-inhibit c)))))))) + +(use-package wgrep + :after grep) + +(defun insert-urandom-password (&optional length) + (interactive "P") + (let ((length (or length 32)) + (chars "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_=+[]{};:,.<>?")) + (insert + (with-temp-buffer + (call-process "head" nil t nil "-c" (number-to-string length) "/dev/urandom") + (let ((bytes (buffer-string))) + (mapconcat (lambda (c) + (string (elt chars (mod (string-to-char (char-to-string c)) (length chars))))) + bytes "")))))) + +(use-package org-fragtog :hook (org-mode . org-fragtog-mode)) + +(use-package yasnippet + :config + (add-to-list 'yas-snippet-dirs "~/monorepo/yasnippet/") + (yas-global-mode 1) + :hook (org-mode . (lambda () (yas-minor-mode) (yas-activate-extra-mode 'latex-mode)))) + +(use-package company + :config + '(add-to-list 'company-backends '(company-ispell company-capf company-yasnippet company-files)) + :hook ((after-init . global-company-mode))) + +(use-package ispell + :custom + (ispell-program-name "aspell" "use aspell") + (ispell-silently-savep t "Save changes to dict without confirmation") + (ispell-dictionary "en" "Use english dictionary") + (ispell-alternate-dictionary "~/.local/share/dict" "dict location")) + +(use-package flyspell + :hook (text-mode . flyspell-mode)) + +(use-package evil + :custom + (evil-want-keybinding nil "Don't load a whole bunch of default keybindings") + :config + (evil-mode 1) + (evil-set-undo-system 'undo-redo) + (evil-set-initial-state 'pdf-view-mode 'normal) + ;; bind / and ? safely after evil is loaded + (define-key evil-normal-state-map (kbd "/") 'swiper) + (define-key evil-normal-state-map (kbd "?") + (lambda () (interactive) (swiper "--reverse")))) + +(use-package evil-collection + :after (evil) + :config + (with-eval-after-load 'evil-maps + (define-key evil-motion-state-map (kbd "SPC") nil) + (define-key evil-motion-state-map (kbd "RET") nil) + (define-key evil-motion-state-map (kbd "TAB") nil)) + (evil-collection-init)) + + +(use-package evil-commentary + :after (evil) + :config + (evil-commentary-mode)) + +(use-package evil-org + :after (evil org) + :hook (org-mode . (lambda () evil-org-mode)) + :config + (require 'evil-org-agenda) + (evil-org-agenda-set-keys)) + +(use-package which-key + :config + (which-key-mode)) + +(use-package page-break-lines + :init + (page-break-lines-mode)) + +(use-package org-journal + :after (org) + :custom + (org-journal-dir "~/monorepo/journal/" "Set journal directory") + (org-journal-date-format "%A, %d %B %Y" "Date format") + (org-journal-file-format "%Y%m%d.org" "Automatic file creation format based on date") + (org-journal-enable-agenda-integration t "All org-journal entries are org-agenda entries") + :init + (defun org-journal-file-header-func (time) + "Custom function to create journal header." + (concat + (pcase org-journal-file-type + (`daily "#+TITLE: Daily Journal\n#+STARTUP: showeverything\n#+DESCRIPTION: My daily journal entry\n#+AUTHOR: Preston Pan\n#+HTML_HEAD: \n#+html_head: \n#+html_head: \n#+options: broken-links:t") + (`weekly "#+TITLE: Weekly Journal\n#+STARTUP: folded") + (`monthly "#+TITLE: Monthly Journal\n#+STARTUP: folded") + (`yearly "#+TITLE: Yearly Journal\n#+STARTUP: folded")))) + (setq org-journal-file-header 'org-journal-file-header-func)) + +(use-package doom-modeline + :config + (doom-modeline-mode 1)) + +(use-package doom-themes + :ensure t + :custom + (doom-themes-enable-bold t) + (doom-themes-enable-italic t) + (doom-themes-treemacs-theme "doom-rouge") + :config + (load-theme 'doom-rouge t) + + (doom-themes-visual-bell-config) + (doom-themes-treemacs-config) + (doom-themes-org-config)) +;; (load-theme 'catppuccin :no-confirm) + +(use-package writegood-mode + :hook (text-mode . writegood-mode)) + +(use-package org-superstar + :after (org) + :hook (org-mode . (lambda () (org-superstar-mode 1)))) + +;; (use-package eglot + ;; :hook + ;; (prog-mode . eglot-ensure) + ;; (nix-mode . eglot-ensure) + ;; :config + ;; (add-to-list 'eglot-server-programs '(nix-mode . ("nil")))) + + (use-package lsp + :hook + (prog-mode . lsp)) + +(with-eval-after-load 'lsp-mode + (setq lsp-typescript-format-enable t + lsp-typescript-indent-size 4 + lsp-typescript-tab-size 4 + lsp-typescript-indent-style "spaces")) + +(use-package editorconfig + :config + (editorconfig-mode 1)) + + (use-package flycheck + :config (global-flycheck-mode)) + + (use-package platformio-mode +:hook (prog-mode . platformio-conditionally-enable)) + +(use-package irony-mode + :hook ( + (c++-mode . irony-mode) + (c-mode . irony-mode) + (objc-mode . irony-mode) + (irony-mode . irony-cdb-autosetup-compile-options))) + +(use-package irony-eldoc + :hook ((irony-mode . irony-eldoc))) + +(use-package solidity-mode) +(use-package company-solidity) +(use-package solidity-flycheck + :custom + (solidity-flycheck-solc-checker-active t)) + +(use-package projectile + :custom + (projectile-project-search-path '("~/org" "~/src" "~/monorepo" "~/projects") "search path for projects") + :config + (projectile-mode +1)) + +(use-package dashboard + :after (projectile) + :custom + (dashboard-banner-logo-title "Welcome, Commander!" "Set title for dashboard") + (dashboard-icon-type 'nerd-icons "Use nerd icons") + (dashboard-vertically-center-content t "Center content") + (dashboard-set-init-info t) + (dashboard-week-agenda t "Agenda in dashboard") + (dashboard-items '((recents . 5) + (bookmarks . 5) + (projects . 5) + (agenda . 5) + (registers . 5)) "Look at some items") + :config + (dashboard-setup-startup-hook)) + +(use-package counsel) + +(use-package ivy + :custom + (ivy-use-virtual-buffers t "Make searching more efficient") + (enable-recursive-minibuffers t "Don't get soft locked when in a minibuffer") + :bind + ("C-s" . swiper) + ("C-c C-r" . ivy-resume) + ("M-x" . counsel-M-x) + ("C-x C-f" . counsel-find-file) + (" f" . counsel-describe-function) + (" v" . counsel-describe-variable) + (" o" . counsel-describe-symbol) + (" l" . counsel-find-library) + (" i" . counsel-info-lookup-symbol) + (" u" . counsel-unicode-char) + ("C-c g" . counsel-git) + ("C-c j" . counsel-git-grep) + ("C-c k" . counsel-ag) + ("C-x l" . counsel-locate) + :config + (ivy-mode)) +(define-key ivy-minibuffer-map (kbd "C-j") 'ivy-immediate-done) + +(use-package magit) + +(use-package erc + :custom + (erc-nick system-username "sets erc username to the one set in nix config") + (erc-user-full-name system-fullname "sets erc fullname to the one set in nix config")) + +(use-package general + :init + (defun prestonpan () + (interactive) + (erc-tls :server "nullring.xyz" + :port "6697")) + (defun liberachat () + (interactive) + (erc-tls :server "irc.libera.chat" + :port "6697")) + (defun efnet () + (interactive) + (erc-tls :server "irc.prison.net" + :port "6697")) + (defun matrix-org () + (interactive) + (ement-connect)) + (defun gimp-org () + (interactive) + (erc-tls :server "irc.gimp.org" + :port "6697")) + :config + (general-create-definer leader-key :prefix "SPC") + (leader-key 'normal + "o c" '(org-capture :wk "Capture") + + ;; Org Mode + "n" '(:ignore t :wk "Org mode plugins") + "n j j" '(org-journal-new-entry :wk "Make new journal entry") + "n r f" '(org-roam-node-find :wk "Find roam node") + "n r i" '(org-roam-node-insert :wk "Insert roam node") + "n r a" '(org-roam-alias-add :wk "Add alias to org roam node") + "n r g" '(org-roam-graph :wk "Graph roam database") + "m I" '(org-id-get-create :wk "Make org id") + + ;; Programming Projects + "." '(counsel-find-file :wk "find file") + "p a" '(projectile-add-known-project :wk "Add to project list") + + "N f" '(nix-flake :wk "nix flake menu") + "f" '(:ignore t :wk "file operations") + "f p" '(projectile-switch-project :wk "find project to switch to") + "f f" '(counsel-fzf :wk "find file in project") + "f s" '(counsel-rg :wk "find string in project") + + "y n s" '(yas-new-snippet :wk "Create new snippet") + + "g" '(:ignore t :wk "Magit") + "g /" '(magit-dispatch :wk "git commands") + "g P" '(magit-push :wk "git push") + "g c" '(magit-commit :wk "git commit") + "g p" '(magit-pull :wk "Pull from git") + "g s" '(magit-status :wk "Change status of files") + "g i" '(magit-init :wk "init new git project") + + "o p" '(treemacs :wk "Project Drawer") + "o P" '(treemacs-projectile :wk "Import Projectile project to treemacs") + + "w r" '(writeroom-mode :wk "focus mode for writing") + + ;; Applications + "o" '(:ignore t :wk "Open application") + "o t" '(vterm :wk "Terminal") + "o e" '(eshell :wk "Elisp Interpreter") + "o m" '(mu4e :wk "Email") + "o M" '(matrix-org :wk "Connect to matrix") + "o r s" '(elfeed :wk "rss feed") + "o a" '(org-agenda :wk "Open agenda") + "o w" '(eww :wk "web browser") + "m m" '(emms :wk "Music player") + "s m" '(proced :wk "System Manager") + "l p" '(list-processes :wk "List Emacs Processes") + + "m P p" '(org-publish :wk "Publish website components") + "s e" '(sudo-edit :wk "Edit file with sudo") + + ;; "f f" '(eglot-format :wk "Format code buffer") + "i p c" '(prestonpan :wk "Connect to my IRC server") + "i l c" '(liberachat :wk "Connect to libera chat server") + "i e c" '(efnet :wk "Connect to efnet chat server") + "i g c" '(gimp-org :wk "Connect to gimp chat server") + + ;; Documentation + "h" '(:ignore t :wk "Documentation") + "h v" '(counsel-describe-variable :wk "Describe variable") + "h f" '(counsel-describe-function :wk "Describe function") + "h h" '(help :wk "Help") + "h m" '(woman :wk "Manual") + "h i" '(info :wk "Info") + + "s i p" '(insert-urandom-password :wk "insert random password to buffer (for sops)") + + "h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/monorepo/config/emacs.org"))))) + +(use-package ellama + :custom + (ellama-sessions-directory "~/org/ellama/" "Set org directory for LLM sessions") + :init + (require 'llm-ollama) + (setopt ellama-provider (make-llm-ollama + :host "localhost" + :chat-model "qwen2.5:14b"))) + +(use-package minuet + :bind + (("M-y" . #'minuet-complete-with-minibuffer) + ("C-c m" . #'minuet-show-suggestion) + :map minuet-active-mode-map + ("C-c r" . #'minuet-dismiss-suggestion) + ("TAB" . #'minuet-accept-suggestion)) + + :init + (add-hook 'prog-mode-hook #'minuet-auto-suggestion-mode) + + :custom + (minuet-request-timeout 40 "Max timeout in seconds") + (minuet-provider 'openai-fim-compatible "FIM compatible OpenAI-like API (Ollama)") + (minuet-n-completions 1 "I am using ghost text so I only need one possible completion") + (minuet-context-window 1024 "how much context do I want?") + + :config + (plist-put minuet-openai-fim-compatible-options :end-point "http://localhost:11434/v1/completions") + + (plist-put minuet-openai-fim-compatible-options :name "Ollama") + (plist-put minuet-openai-fim-compatible-options :api-key "TERM") + (plist-put minuet-openai-fim-compatible-options :model "qwen2.5-coder:14b") + + (minuet-set-optional-options minuet-openai-fim-compatible-options :max_tokens 50)) + +(use-package elfeed + :custom + (elfeed-search-filter "@1-month-ago +unread" "Only display unread articles from a month ago") + + :config + (run-with-timer 0 (* 60 60 4) 'elfeed-update) + + :hook ((elfeed-search-mode . elfeed-update))) + +(use-package elfeed-org + :custom + (rmh-elfeed-org-files '("~/monorepo/config/elfeed.org") "Use elfeed config in repo as default") + :config + (elfeed-org)) + +(use-package elfeed-tube + :after elfeed + :demand t + :config + (elfeed-tube-setup) + :bind (:map elfeed-show-mode-map + ("F" . elfeed-tube-fetch) + ([remap save-buffer] . elfeed-tube-save) + :map elfeed-search-mode-map + ("F" . elfeed-tube-fetch) + ([remap save-buffer] . elfeed-tube-save))) + +(use-package elfeed-tube-mpv + :bind (:map elfeed-show-mode-map + ("C-c C-f" . elfeed-tube-mpv-follow-mode) + ("C-c C-c" . elfeed-tube-mpv) + ("C-c C-w" . elfeed-tube-mpv-where) + :map elfeed-search-mode-map + ("M" . elfeed-tube-mpv))) + +(use-package treemacs) +(use-package treemacs-evil + :after (treemacs evil)) +(use-package treemacs-projectile + :after (treemacs projectile)) +(use-package treemacs-magit + :after (treemacs magit)) + +(use-package eww + :custom + (search-engines + '((("google" "g") "https://google.com/search?q=%s") + (("duckduckgo" "d" "ddg") "https://duckduckgo.com/?q=%s") + (("rfc" "r") "https://www.rfc-editor.org/rfc/rfc%s.txt") + (("rfc-kw" "rk") "https://www.rfc-editor.org/search/rfc_search_detail.php?title=%s")) + "use this set of search engines") + + (search-engine-default "google" "Use google as default") + (eww-search-prefix "https://google.com/search?q=" "Google prefix") + :hook ((eww-mode . (lambda () (local-set-key (kbd "y Y") #'eww-copy-page-url))))) + +(use-package org-roam + :after (org) + :custom + (org-roam-db-update-on-save t "Update org-roam db") + (org-roam-graph-viewer "firefox" "Use firefox to view org-roam graph") + (org-roam-directory (file-truename "~/monorepo/mindmap") "Set org-roam directory inside monorepo") + (org-roam-capture-templates '(("d" "default" plain "%?" + :target (file+head "${title}.org" + "#+title: ${title}\n#+author: Preston Pan\n#+html_head: \n#+html_head: \n#+html_head: \n#+options: broken-links:t") + :unnarrowed t)) "org-roam files start with this snippet by default") + :config + (org-roam-db-autosync-mode) + ;; Otherwise links are broken when publishing + (org-roam-update-org-id-locations)) + +(use-package org-roam-ui + :after org-roam + :hook (after-init . org-roam-ui-mode) + :custom + (org-roam-ui-sync-theme t "Use emacs theme for org-roam-ui") + (org-roam-ui-follow t "Have cool visual while editing org-roam") + (org-roam-ui-update-on-save t "This option is obvious") + (org-roam-ui-open-on-start t "Have cool visual open in firefox when emacs loads")) + +(use-package pinentry + :custom (epa-pinentry-mode `loopback "Set this option to match gpg-agent.conf") + :config (pinentry-start)) + +(use-package smtpmail + :custom + (user-mail-address system-email "Use our email") + (user-full-name system-fullname "Use our full name") + (sendmail-program "msmtp" "Use msmtp in order to send emails") + (send-mail-function 'smtpmail-send-it "This is required for this to work") + (message-sendmail-f-is-evil t "Use evil-mode for sendmail") + (message-sendmail-extra-arguments '("--read-envelope-from") "idk what this does") + (message-send-mail-function 'message-send-mail-with-sendmail "Use sendmail")) + +(use-package mu4e + :after smtpmail + :custom + (mu4e-drafts-folder "/Drafts" "Set drafts folder mu db") + (mu4e-sent-folder "/Sent" "Set sent folder in mu db") + (mu4e-trash-folder "/Trash" "Set trash folder in mu db") + (mu4e-attachment-dir "~/Downloads" "Set downloads folder for attachments") + (mu4e-view-show-addresses 't "Show email addresses in main view") + (mu4e-confirm-quit nil "Don't ask to quit") + (message-kill-buffer-on-exit t "Kill buffer when I exit mu4e") + (mu4e-compose-dont-reply-to-self t "Don't include self in replies") + (mu4e-change-filenames-when-moving t) + (mu4e-get-mail-command (concat "mbsync " system-username) "Use mbsync for imap") + (mu4e-compose-reply-ignore-address (list "no-?reply" system-email) "ignore my own address and noreply") + (mu4e-html2text-command "w3m -T text/html" "Use w3m to convert html to text") + (mu4e-update-interval 300 "Update duration") + (mu4e-headers-auto-update t "Auto-updates feed") + (mu4e-view-show-images t "Shows images") + (mu4e-compose-signature-auto-include nil) + (mu4e-use-fancy-chars t "Random option to make mu4e look nicer")) + +(use-package emms + :custom + (emms-source-file-default-directory (expand-file-name "~/music/") "Use directory specified in Nix") + (emms-player-mpd-music-directory (expand-file-name "~/music/") "Use directory specified in Nix") + (emms-player-mpd-server-name "localhost" "Connect to localhost") + (emms-player-mpd-server-port "6600" "Connect to port 6600") + (emms-player-list '(emms-player-mpd) "Use mpd") + :init + (emms-all) + (add-to-list 'emms-info-functions 'emms-info-mpd) + (add-to-list 'emms-player-list 'emms-player-mpd) + :config (emms-player-mpd-connect)) + +(use-package centaur-tabs + :custom + (centaur-tabs-set-icons t "use icons for centaur-tabs") + (centaur-tabs-set-modified-marker t "show when buffer modified") + (centaur-tabs-icon-type 'all-the-icons "use all-the-icons for icons") + :demand + :config + (centaur-tabs-mode t) + :bind + ("C-" . centaur-tabs-backward) + ("C-" . centaur-tabs-forward)) + +(use-package lean4-mode + :commands lean4-mode + :vc (:url "https://github.com/leanprover-community/lean4-mode.git" + :rev "76895d8939111654a472cfc617cfd43fbf5f1eb6")) diff --git a/nix/modules/configuration.nix b/nix/modules/configuration.nix index 749d725..7b862f9 100644 --- a/nix/modules/configuration.nix +++ b/nix/modules/configuration.nix @@ -426,7 +426,7 @@ nix = { settings = { - experimental-features = "nix-command flakes"; + experimental-features = "nix-command flakes ca-derivations"; trusted-users = [ "@wheel" ]; }; }; diff --git a/nix/modules/home/emacs.nix b/nix/modules/home/emacs.nix index c5bd383..6e36837 100644 --- a/nix/modules/home/emacs.nix +++ b/nix/modules/home/emacs.nix @@ -9,17 +9,18 @@ (setq system-email "${config.monorepo.profiles.email.email}") (setq system-username "${config.monorepo.vars.internetName}") (setq system-fullname "${config.monorepo.vars.fullName}") -(org-babel-load-file - (expand-file-name "~/${config.monorepo.vars.repoName}/config/emacs.org"))''; +(load "${pkgs.writeText "init.el" (builtins.readFile ../../init.el)}") +''; + extraPackages = epkgs: [ epkgs.agda2-mode epkgs.all-the-icons epkgs.auctex epkgs.catppuccin-theme - epkgs.chatgpt-shell epkgs.company epkgs.company-solidity epkgs.counsel + epkgs.centaur-tabs epkgs.dashboard epkgs.doom-themes epkgs.doom-modeline diff --git a/nix/modules/home/gtk.nix b/nix/modules/home/gtk.nix index 4e85b9d..902f993 100644 --- a/nix/modules/home/gtk.nix +++ b/nix/modules/home/gtk.nix @@ -2,7 +2,24 @@ { gtk = { theme = { - package = pkgs.catppuccin-gtk; + name = "catppuccin-mocha-pink-standard"; + package = pkgs.catppuccin-gtk.override { + variant = "mocha"; + accents = [ "pink" ]; + }; }; }; + xdg.configFile = { + "gtk-4.0/assets".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/assets"; + "gtk-4.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk.css"; + "gtk-4.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-4.0/gtk-dark.css"; + + "gtk-3.0/gtk.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-3.0/gtk.css"; + "gtk-3.0/gtk-dark.css".source = "${config.gtk.theme.package}/share/themes/${config.gtk.theme.name}/gtk-3.0/gtk-dark.css"; + "gtk-3.0/settings.ini".text = '' + [Settings] + gtk-theme-name=${config.gtk.theme.name} + gtk-application-prefer-dark-theme=1 + ''; + }; } diff --git a/nix/modules/home/hyprland.nix b/nix/modules/home/hyprland.nix index 6561211..1d29b74 100644 --- a/nix/modules/home/hyprland.nix +++ b/nix/modules/home/hyprland.nix @@ -73,7 +73,10 @@ "$mod SHIFT, L, movewindow, r" "$mod SHIFT, K, movewindow, u" "$mod SHIFT, J, movewindow, d" - "$mod, T, togglefloating" + + "$mod SHIFT, T, togglefloating" + "$mod SHIFT, F, fullscreen" + "$mod, H, movefocus, l" "$mod, L, movefocus, r" "$mod, K, movefocus, u" diff --git a/nix/modules/home/user.nix b/nix/modules/home/user.nix index 680acd8..3cd4190 100644 --- a/nix/modules/home/user.nix +++ b/nix/modules/home/user.nix @@ -45,13 +45,13 @@ # Apps # octaveFull - vesktop grim swww vim telegram-desktop qwen-code fluffychat + vesktop grim swww vim telegram-desktop qwen-code fluffychat jami # Sound/media pavucontrol alsa-utils imagemagick ffmpeg helvum # Net - curl rsync git iamb + curl rsync git iamb ungoogled-chromium # Tor torsocks tor-browser @@ -151,12 +151,5 @@ cd "$HOME" }; programs.bash.enable = true; - - gtk = { - enable = lib.mkDefault config.monorepo.profiles.graphics.enable; - theme = null; - iconTheme = null; - }; - fonts.fontconfig.enable = true; } diff --git a/nix/modules/kubo.nix b/nix/modules/kubo.nix index 79aa9aa..c64295d 100644 --- a/nix/modules/kubo.nix +++ b/nix/modules/kubo.nix @@ -2,5 +2,19 @@ { services.kubo = { enable = lib.mkDefault config.monorepo.profiles.workstation.enable; + autoMount = false; + enableGC = true; + settings = { + Addresses.API = [ + "/ip4/127.0.0.1/tcp/5001" + ]; + Bootstrap = [ + "/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu" + "/ip4/162.243.248.213/tcp/4001/ipfs/QmSoLueR4xBeUbY9WZ9xGUUxunbKWcrNFTDAadQJmocnWm" + ]; + Datastore = { + StorageMax = "20GB"; + }; + }; }; } diff --git a/yasnippet/org-mode/substack b/yasnippet/org-mode/substack new file mode 100644 index 0000000..b7e3e81 --- /dev/null +++ b/yasnippet/org-mode/substack @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: substack +# key: substack +# -- +[[https://$1.substack.com/feed][$0]] \ No newline at end of file diff --git a/yasnippet/org-mode/yt-feed b/yasnippet/org-mode/yt-feed new file mode 100644 index 0000000..e26a408 --- /dev/null +++ b/yasnippet/org-mode/yt-feed @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: yt-feed +# key: yt-feed +# -- +[[https://youtube.com/feeds/videos.xml?channel_id=$1][$0]] \ No newline at end of file