diff options
| author | Preston Pan <ret2pop@nullring.xyz> | 2026-04-11 14:09:26 -0700 |
|---|---|---|
| committer | Preston Pan <ret2pop@nullring.xyz> | 2026-04-11 14:09:26 -0700 |
| commit | 56580b952901242786da04d0cb3d8e1ea1698db7 (patch) | |
| tree | dffdd0d6a5edc3c8aebca74314745a53c1176512 /config | |
| parent | f17203b32bd1ecb0d908bbf03b9239e2efde59d6 (diff) | |
| parent | 75cfba0e2e705ed0a87abcd5b6822beed8fad555 (diff) | |
Merge branch 'mindmap'
Diffstat (limited to 'config')
| -rw-r--r-- | config/emacs.org | 70 | ||||
| -rw-r--r-- | config/nix.org | 126 |
2 files changed, 148 insertions, 48 deletions
diff --git a/config/emacs.org b/config/emacs.org index 6dc0719..375c31e 100644 --- a/config/emacs.org +++ b/config/emacs.org @@ -327,6 +327,25 @@ then append the typed input to the mu4e database query." (if (facep face) (funcall orig-fn face attribute frame inherit) 'unspecified)) + +(defun rp/vterm-cleanup-on-exit (buffer _event) + "Close windows showing BUFFER after vterm exits, then kill BUFFER." + (let ((buf buffer)) + (run-at-time + 0 nil + (lambda () + (when (buffer-live-p buf) + (let ((wins (get-buffer-window-list buf nil t))) + (dolist (win wins) + (when (window-live-p win) + (if (one-window-p t win) + ;; Can't delete the last window in a frame. + ;; Switch it away from the vterm buffer instead. + (with-selected-window win + (switch-to-prev-buffer win 'kill)) + (delete-window win))))) + (when (buffer-live-p buf) + (kill-buffer buf))))))) #+end_src ** Random Packages These are packages that I require in order to write some scripts in emacs-lisp. @@ -394,18 +413,13 @@ Emacs is self documenting, after all! (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))) + (fill-column 150) - - :hook ((text-mode . visual-line-mode) - (prog-mode . display-line-numbers-mode) - (prog-mode . display-fill-column-indicator-mode) + :hook ((prog-mode . display-line-numbers-mode) (org-mode . auto-fill-mode) - (org-mode . display-fill-column-indicator-mode) (org-mode . display-line-numbers-mode)) :config (emacs-config)) #+end_src @@ -443,6 +457,8 @@ This is my org mode configuration, which also configures latex. (org-edit-src-content-indentation 0) (org-src-tab-acts-natively t) (org-src-preserve-indentation t) + (org-hide-drawer-startup t) + (org-startup-folded 'showall) (TeX-PDF-mode t) (org-confirm-babel-evaluate nil "Don't ask to evaluate code block") @@ -469,6 +485,7 @@ This is my org mode configuration, which also configures latex. \\setlength{\\topmargin}{1.5cm} \ \\addtolength{\\topmargin}{-2.54cm} \ \\usepackage{amsmath} \ + \\usepackage{tikz-cd} \ ") (org-preview-latex-image-directory (expand-file-name "~/.cache/ltximg/") "don't use weird cache location") (org-latex-preview-ltxpng-directory (expand-file-name "~/.cache/ltximg/") "don't use weird cache location") @@ -478,7 +495,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-preview-latex-default-process 'dvipng) + ;; (org-preview-latex-default-process 'imagemagick) (org-format-latex-options '(:foreground default :background default @@ -490,7 +507,6 @@ This is my org mode configuration, which also configures latex. (org-return-follows-link t "be able to follow links without mouse") (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 {}") @@ -508,7 +524,6 @@ This is my org mode configuration, which also configures latex. (org-catch-invisible-edits 'show-and-error) (org-special-ctrl-a/e t) (org-insert-heading-respect-content t) - (org-hide-emphasis-markers t) (org-pretty-entities t) (org-agenda-tags-column 0) (org-ellipsis "…") @@ -518,7 +533,28 @@ This is my org mode configuration, which also configures latex. (python . t) (nix . t) (scheme . t) - (latex . t)))) + (latex . t))) + :config + (add-to-list 'org-preview-latex-process-alist + '(xetex-imagemagick + :programs ("xelatex" "convert") + :description "pdf > png" + :message "you need to install the programs: xelatex and imagemagick." + :image-input-type "pdf" + :image-output-type "png" + :image-size-adjust (1.0 . 1.0) + :latex-compiler ("xelatex -interaction nonstopmode -output-directory %o %f") + :image-converter ("convert -density %D -trim -antialias %f -quality 100 %O"))) + + ;; Set this new process as your default + (setq org-preview-latex-default-process 'xetex-imagemagick) + (set-face-attribute 'org-document-title nil :height 1.5 :weight 'bold) + (set-face-attribute 'org-level-1 nil :height 1.4 :weight 'bold) + (set-face-attribute 'org-level-2 nil :height 1.3 :weight 'bold) + (set-face-attribute 'org-level-3 nil :height 1.2 :weight 'semibold) + (set-face-attribute 'org-level-4 nil :height 1.1 :weight 'normal) + (set-face-attribute 'org-level-5 nil :height 1.0 :weight 'normal) + (set-face-attribute 'org-level-6 nil :height 1.0 :weight 'normal)) (use-package org-tempo :after org) @@ -923,6 +959,11 @@ First, some small configurations and some evil-mode initilaization because I lik (matrix-org "matrix.org" "8448") (gimp-org "irc.gimp.org" "6697")) + (general-define-key + "C-=" #'text-scale-increase + "C--" #'text-scale-decrease + "C-0" #'text-scale-set) + (leader-key 'normal "o c" '(org-capture :wk "Capture") ;; Org Mode @@ -1820,6 +1861,13 @@ I use tabs because sometimes I like using the mouse (it's actually more efficien :config (pulsar-global-mode 1)) #+end_src +** VTerm +#+begin_src emacs-lisp +(use-package vterm + :custom + (vterm-kill-buffer-on-exit nil) + :hook (vterm-exit-functions . rp/vterm-close-window-on-exit)) +#+end_src * Unpinned ** Lean4 For some reason, lean4-mode is not in MELPA currently so I have to do this ugly thing: diff --git a/config/nix.org b/config/nix.org index dca7f38..195a28f 100644 --- a/config/nix.org +++ b/config/nix.org @@ -37,7 +37,7 @@ in "continuity" "spontaneity" "installer" - "rpi-zero" + # "rpi-zero" ]; } #+end_src @@ -255,7 +255,11 @@ and now for the main flake: name = "services-test-${hostname}"; nodes = { "${hostname}" = { ... }: { - _module.args = attrs // { isIntegrationTest = true; }; + _module.args = attrs // { + isIntegrationTest = true; + system = getSystem hostname; + monorepoSelf = null; + }; imports = mkHostModules hostname ++ [ "${nixpkgs}/nixos/modules/misc/nixpkgs/read-only.nix" { @@ -902,32 +906,35 @@ underlying interface and it breaks significantly less often. pulse.enable = lib.mkDefault config.monorepo.profiles.pipewire.enable; jack.enable = lib.mkDefault config.monorepo.profiles.pipewire.enable; wireplumber.enable = lib.mkDefault config.monorepo.profiles.pipewire.enable; + extraConfig = { - pipewire."92-low-latency" = { + pipewire."92-clock" = { "context.properties" = { "default.clock.rate" = 48000; - "default.clock.quantum" = 512; - "default.clock.min-quantum" = 512; - "default.clock.max-quantum" = 1024; + "default.clock.allowed-rates" = [ 48000 ]; + + "default.clock.quantum" = 2048; + "default.clock.min-quantum" = 1024; + "default.clock.max-quantum" = 4096; + + "default.clock.quantum-limit" = 8192; }; - pipewire-pulse."92-low-latency" = { - "context.properties" = [ - { - name = "libpipewire-module-protocol-pulse"; - args = { }; - } - ]; - "pulse.properties" = { - "pulse.min.req" = "32/48000"; - "pulse.default.req" = "32/48000"; - "pulse.max.req" = "32/48000"; - "pulse.min.quantum" = "32/48000"; - "pulse.max.quantum" = "32/48000"; - }; - "stream.properties" = { - "node.latency" = "32/48000"; - "resample.quality" = 1; - }; + }; + + pipewire-pulse."92-obs-very-stable" = { + "pulse.properties" = { + "pulse.min.req" = "1024/48000"; + "pulse.default.req" = "2048/48000"; + "pulse.max.req" = "4096/48000"; + + "pulse.min.quantum" = "512/48000"; + "pulse.max.quantum" = "4096/48000"; + }; + + "stream.properties" = { + "node.latency" = "2048/48000"; + "node.max-latency" = "4096/48000"; + "resample.quality" = 10; }; }; }; @@ -1598,7 +1605,7 @@ Use ollama for serving large language models to my other computers. { config, lib, ... }: { services.bitcoind."${config.monorepo.vars.userName}" = { - enable = lib.mkDefault config.monorepo.profiles.workstation.enable; + enable = lib.mkDefault false; prune = 10000; }; } @@ -2575,6 +2582,7 @@ in "gcm" "sha256" "sha384" + "uvcvideo" ]; kernelParams = [ @@ -2820,23 +2828,39 @@ in tctiEnvironment.enable = true; }; - auditd.enable = true; - audit.enable = true; chromiumSuidSandbox.enable = (! config.monorepo.profiles.ttyonly.enable); sudo.enable = true; }; xdg.portal = { enable = (! config.monorepo.profiles.ttyonly.enable); - wlr.enable = (! config.monorepo.profiles.ttyonly.enable); + wlr = { + enable = (! config.monorepo.profiles.ttyonly.enable); + settings = { + screencast = { + chooser_type = "none"; + output_name = "DP-1"; + }; + }; + }; extraPortals = with pkgs; if (! config.monorepo.profiles.ttyonly.enable) then [ xdg-desktop-portal-gtk xdg-desktop-portal - xdg-desktop-portal-hyprland + xdg-desktop-portal-wlr ] else []; config.common.default = "*"; }; + systemd.user.services.xdg-desktop-portal-wlr = { + serviceConfig = { + Restart = lib.mkForce "on-failure"; + }; + environment = { + XDG_CURRENT_DESKTOP = "qtile"; + XDG_SESSION_TYPE = "wayland"; + }; + }; + environment.etc."gitconfig".text = '' [init] defaultBranch = main @@ -3292,7 +3316,7 @@ in supercollider inkscape kdePackages.kdenlive - kicad + # kicad ]) else []); monorepo.profiles = { @@ -3371,6 +3395,19 @@ These are some secrets that I use regularly for my programs in home. }; } #+end_src +*** OBS +#+begin_src nix :tangle ../nix/modules/home/obs.nix +{ pkgs, config, ... }: +{ + programs.obs-studio = { + enable = config.monorepo.profiles.workstation.enable; + plugins = with pkgs.obs-studio-plugins; [ + wlrobs + ]; + }; +} +#+end_src + *** Firefox I conditionally enable metamask based on the cryptocurrency option. Everything else here should be straightforward. @@ -3378,7 +3415,8 @@ be straightforward. { lib, config, pkgs, ... }: { programs.librewolf = { - enable = lib.mkDefault config.monorepo.profiles.graphics.enable; + # enable = lib.mkDefault config.monorepo.profiles.graphics.enable; + enable = false; package = pkgs.librewolf; profiles = { default = { @@ -3401,6 +3439,10 @@ be straightforward. }; } #+end_src + +#+RESULTS: +: <LAMBDA> + *** QuteBrowser #+begin_src nix :tangle ../nix/modules/home/qutebrowser.nix { lib, config, catppuccin-qutebrowser, ... }: @@ -3432,9 +3474,12 @@ be straightforward. # Hints fonts.hints = "bold 12pt Lora"; + + # Rendering + qt.force_software_rendering = "chromium"; }; extraConfig = (builtins.readFile "${catppuccin-qutebrowser}/setup.py") + -'' + '' config.load_autoconfig() setup(c, "mocha", True) ''; @@ -3641,10 +3686,11 @@ the timezone. My iamb profile. Note that iamb does not support calling (obviously, as it is a terminal app), but the nice thing about it is that I can set it up declaratively, so in case element-desktop stops working because of lack of declarative setup, I can still use this. #+begin_src nix :tangle ../nix/modules/home/iamb.nix -{ super, lib, config, ... }: +{ super, ... }: { programs.iamb = { - enable = lib.mkDefault config.monorepo.profiles.graphics.enable; + # enable = lib.mkDefault config.monorepo.profiles.graphics.enable; + enable = false; settings = { default_profile = "personal"; profiles.personal = { @@ -4089,6 +4135,12 @@ for these configurations. username = super.monorepo.vars.userName; homeDirectory = "/home/${super.monorepo.vars.userName}"; stateVersion = "24.11"; + sessionVariables = { + QTWEBENGINE_FORCE_USE_GBM = 0; + NIXOS_OZONE_WL = 1; + XDG_SESSION_TYPE = "wayland"; + XDG_CURRENT_DESKTOP = "qtile"; + }; packages = with pkgs; (if config.monorepo.profiles.graphics.enable then [ # wikipedia @@ -4109,11 +4161,11 @@ for these configurations. graphviz jq # Apps - octaveFull - grim swww vim element-desktop signal-desktop signal-cli thunderbird jami imv slurp + # octaveFull + grim swww vim element-desktop signal-desktop signal-cli thunderbird jami imv slurp wl-clipboard # Sound/media - pavucontrol alsa-utils imagemagick ffmpeg helvum pulseaudio + pavucontrol alsa-utils imagemagick ffmpeg pulseaudio # Net curl rsync gitFull ungoogled-chromium devd |
