]> Untitled Git - monorepo.git/commitdiff
big refactor
authorPreston Pan <ret2pop@gmail.com>
Fri, 19 Sep 2025 05:33:36 +0000 (22:33 -0700)
committerPreston Pan <ret2pop@gmail.com>
Fri, 19 Sep 2025 05:33:36 +0000 (22:33 -0700)
47 files changed:
README.org
agenda.org
config/elfeed.org
config/emacs.el
config/emacs.org
config/nix.org
journal/20250912.org [new file with mode: 0644]
journal/20250914.org [new file with mode: 0644]
journal/20250915.org [new file with mode: 0644]
journal/20250916.org [new file with mode: 0644]
journal/20250917.org [new file with mode: 0644]
nix/add-system.sh [deleted file]
nix/disko/btrfs-simple.nix
nix/flake.lock
nix/flake.nix
nix/flakevars.nix [new file with mode: 0644]
nix/modules/conduit.nix
nix/modules/configuration.nix
nix/modules/default.nix
nix/modules/heisenbridge.nix [new file with mode: 0644]
nix/modules/home/default.nix
nix/modules/home/emacs.nix
nix/modules/home/hyprland.nix
nix/modules/home/mbsync.nix
nix/modules/home/pantalaimon.nix
nix/modules/home/user.nix
nix/modules/home/zsh.nix
nix/modules/honk.nix [new file with mode: 0644]
nix/modules/impermanence.nix [new file with mode: 0644]
nix/modules/maddy.nix
nix/modules/mautrix.nix [new file with mode: 0644]
nix/modules/murmur.nix
nix/modules/nginx.nix
nix/modules/ngircd.nix
nix/modules/ollama.nix
nix/modules/vars.nix
nix/systems/affinity/default.nix
nix/systems/affinity/home.nix
nix/systems/common.nix [new file with mode: 0644]
nix/systems/continuity/default.nix
nix/systems/continuity/home.nix
nix/systems/home-common.nix [new file with mode: 0644]
nix/systems/home.nix
nix/systems/includes.nix [deleted file]
nix/systems/installer/default.nix
nix/systems/spontaneity/default.nix
nix/systems/spontaneity/home.nix

index b71c14094e58194a95308e4ebf7264cde103d859..433b5d751cadcb6e5be786549203f30e0e3f9142 100644 (file)
@@ -14,18 +14,25 @@ By using the ~org-publish~ function, ~org-roam~, and ~org-journal~,
 as well as writing a lot of things with a literate config. To see more, see my
 [[file:config/emacs.org][emacs configuration]] and my [[file:config/nix.org][NixOS configuration]].
 ** So, where is this website of yours located?
-https://ret2pop.nullring.xyz, it is the road to enlightenment.
+https://ret2pop.net, it is the road to enlightenment.
 * Wait, so where are your dotfiles?
 To use my dotfiles, download the ISO image for the installer, log in, and run:
 #+begin_src bash
-  SYSTEM=continuity DRIVE=sda-simple nix_installer
+  nix_installer
 #+end_src
 then reboot, and run:
 #+begin_src bash
   cd $HOME/monorepo && git pull
 #+end_src
+That's all! Note that if you install with an encrypted disk, you will have to run:
+#+begin_src bash
+  echo "password123" > /tmp/secret.key
+#+end_src
+first.
 ** Post-setup
 In emacs, run ~M-x all-the-icons-install-fonts, ~~M-x nerd-icons-install-fonts~, and ~M-x org-roam-db-sync~. Install your music to ~$HOME/music~ for
-emms.
+emms. In firefox, go to the three-bar menu and enable all the add-ons that were automatically installed. Set up the ~mu~ program in order to
+send and receive email, along with modifying the corresponding mbsync and msmtp commands. Change ~nix/flakevars.nix~ to your liking, and add
+new systems if you want.
 * License
-See the [[file:LICENSE.org][license]]. The style.css has its own license.
+See the [[file:LICENSE][license]] The style.css has its own license.
index fbf3eb6c66641f9190422616d76a44648b8b2605..cf46700a80971e49e67649213bfe89ced22410a9 100644 (file)
@@ -53,6 +53,22 @@ I want to make an analogue computer.
 * Scheduled tasks
 These are one-time tasks that are scheduled at a particular date, and that don't require regular
 schedules.
+** Appointments
+These are tasks related to my appointments which have to be at a specific time.
+*** TODO Appointment Call
+I have an appointment in a couple days.
+SCHEDULED: <2025-09-16 Tue 15:45>
+*** TODO Friends Stay a Night
+SCHEDULED: <2025-09-23 Tue>
+*** TODO Covet Concert
+SCHEDULED: <2025-10-10 Fri>
+Exciting!
+*** TODO Optometry appointment
+SCHEDULED: <2025-09-29 Mon 16:45>
+For eye health @ Mount Pleasant Optometry.
+*** TODO Magbay Concert
+SCHEDULED: <2025-09-30 Tue>
+Exciting!
 ** Friends
 These are tasks related to seeing my friends. There will be tasks listed here when I schedule
 something.
@@ -60,11 +76,17 @@ something.
 These are some habits I want to track. They are repeated according to a calendar schedule in
 general.
 ** TODO Supplements
-SCHEDULED: <2025-09-11 Thu .+1d>
+SCHEDULED: <2025-09-18 Thu .+1d>
 :PROPERTIES:
-:LAST_REPEAT: [2025-09-10 Wed 03:23]
+:LAST_REPEAT: [2025-09-17 Wed 03:40]
 :STYLE: habit
 :END:
+- State "DONE"       from "TODO"       [2025-09-17 Wed 03:40]
+- State "DONE"       from "TODO"       [2025-09-16 Tue 03:13]
+- State "DONE"       from "TODO"       [2025-09-14 Sun 18:33]
+- State "DONE"       from "TODO"       [2025-09-14 Sun 02:17]
+- State "DONE"       from "TODO"       [2025-09-12 Fri 23:48]
+- State "DONE"       from "TODO"       [2025-09-12 Fri 23:47]
 - State "DONE"       from "TODO"       [2025-09-10 Wed 03:23]
 - State "DONE"       from "TODO"       [2025-09-09 Tue 02:39]
 - State "DONE"       from "TODO"       [2025-09-08 Mon 15:39]
@@ -80,12 +102,15 @@ Current stack:
 - Iron
 - Vitamin D3
 - EPA/DHA
-** TODO Pushups
-SCHEDULED: <2025-09-11 Thu .+1d>
+- Creatine Monohydrate
+** TODO Strength Training
+SCHEDULED: <2025-09-18 Thu .+1d>
 :PROPERTIES:
-:LAST_REPEAT: [2025-09-10 Wed 03:23]
+:LAST_REPEAT: [2025-09-17 Wed 03:40]
 :STYLE: habit
 :END:
+- State "DONE"       from "TODO"       [2025-09-17 Wed 03:40]
+- State "DONE"       from "TODO"       [2025-09-14 Sun 02:26]
 - State "DONE"       from "TODO"       [2025-09-10 Wed 03:23]
 - State "DONE"       from "TODO"       [2025-09-09 Tue 02:42]
 - State "DONE"       from "TODO"       [2025-09-08 Mon 04:35]
@@ -103,22 +128,29 @@ SCHEDULED: <2025-08-26 Tue .+1d>
 - State "DONE"       from "TODO"       [2025-06-26 Thu 23:22]
 I want to be able to run or bike every day so that I get my exercise in.
 ** TODO Stretch
-SCHEDULED: <2025-09-10 Wed .+1d>
+SCHEDULED: <2025-09-18 Thu .+1d>
 :PROPERTIES:
-:LAST_REPEAT: [2025-09-09 Tue 02:42]
+:LAST_REPEAT: [2025-09-17 Wed 03:40]
 :STYLE: habit
 :END:
+- State "DONE"       from "TODO"       [2025-09-17 Wed 03:40]
+- State "DONE"       from "TODO"       [2025-09-16 Tue 03:14]
+- State "DONE"       from "TODO"       [2025-09-14 Sun 02:20]
 - State "DONE"       from "TODO"       [2025-09-09 Tue 02:42]
 - State "DONE"       from "TODO"       [2025-09-08 Mon 04:47]
 - 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.
 ** TODO Journal
-SCHEDULED: <2025-09-10 Wed .+1d>
+SCHEDULED: <2025-09-18 Thu .+1d>
 :PROPERTIES:
-:LAST_REPEAT: [2025-09-09 Tue 02:40]
+:LAST_REPEAT: [2025-09-17 Wed 03:40]
 :STYLE: habit
 :END:
+- State "DONE"       from "TODO"       [2025-09-17 Wed 03:40]
+- State "DONE"       from "TODO"       [2025-09-16 Tue 03:14]
+- State "DONE"       from "TODO"       [2025-09-14 Sun 02:18]
+- State "DONE"       from "TODO"       [2025-09-12 Fri 23:47]
 - State "DONE"       from "TODO"       [2025-09-09 Tue 02:40]
 - State "DONE"       from "TODO"       [2025-09-08 Mon 04:35]
 - State "DONE"       from "TODO"       [2025-07-20 Sun 21:28]
index 5f5db9c8e5633ea31755caf45e44c86c64a90ffa..2f85143dfcc42c98e5e06e6e9ae1ee4e59463ce6 100644 (file)
@@ -2,31 +2,18 @@
 #+author: Preston Pan
 #+date: <2023-06-09 Fri>
 #+description: My list of blogs, news sites, and channels.
-
 #+html_head: <link rel="stylesheet" type="text/css" href="../style.css" />
 
 * Feed :elfeed:
 This is the feed I use for Elfeed, and the elfeed-org package allows me to publish
 them here in an automated fashion. This is why Emacs is so great!
-** Blogs :blog:
-Here are some interesting blogs, many of which are from substack.
-*** [[https://graymirror.substack.com/feed][Gray Mirror]]
-Curtis Yarvin is quite the interesting person.
-*** [[https://lukesmith.xyz/index.xml][Luke Smith]] :lukesmith:
-Luke Smith is quite the interesting person.
-*** [[https://terrytao.wordpress.com/feed/][Terence Tao]]
-I like math.
 ** News :news:
 These are the news articles that I subscribe to. Some of these are politics related
 but I mostly just want to inform myself about technology subjects.
-*** [[https://www.wired.com/feed/tag/ai/latest/rss][Wired AI News]]
-Wired isn't too bad at covering science and technology.
-*** [[https://www.wired.com/feed/category/science/latest/rss][Wired Science]]
-Look above.
-*** [[https://feeds.washingtonpost.com/rss/politics?itid=lk_inline_manual_2][Washington Post Politics]]
-Politics is almost useless, but it helps with understanding what people are saying around me.
 *** [[https://news.ycombinator.com/rss][Hacker News]]
 Hacker News!
+*** [[https://www.propublica.org/feeds/propublica/main][Propublica]]
+Free news! 
 *** [[https://api.quantamagazine.org/feed/][Quanta Magazine]]
 Credibility: misreported on ER EPR correspondence
 ** Podcasts :podcast:
@@ -37,10 +24,18 @@ This is a podcast by Luke Smith that talks about anything that he wants to.
 I like to get new information about recent studies related to technology.
 *** [[http://www.nature.com/nmat/current_issue/rss/][Nature]]
 Nature is a prestigious journal with a good bit of good content.
+*** NASA :nasa:
+This is a list of NASA feeds:
+**** [[https://www.nasa.gov/technology/feed/][NASA Tech]]
+**** [[https://www.nasa.gov/aeronautics/feed/][NASA Aeronautics]]
+**** [[https://www.nasa.gov/missions/station/feed/][NASA Station]]
+**** [[https://www.nasa.gov/missions/artemis/feed/][NASA Artemis]]
 ** YouTube :youtube:
 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://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]]
 PBS space time is a channel that discusses various (sometimes cutting edge) topics in Physics in an expert manner.
 I find that they are highly accurate, and the host is highly educated in Physics.
@@ -71,6 +66,13 @@ Videos about NRx.
 Linux videos.
 *** [[https://www.youtube.com/feeds/videos.xml?channel_id=UCU1oodg2ptN51N5rwevwnng][Unlearning Economics]]
 Videos about economics from a Marxist perspective.
-** Misc.
-This is a section dedicated to everything that does not fit the above categories
-or is newly added from [[file:qutebrowser.org][Qutebrowser]] with the xr keybinding.
+** 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.
index 7aa45174b0f0a0447676791006a7971f29234641..8cffb3d8dc3a1635a58aa58d99cb1411e156cf00 100644 (file)
@@ -1,7 +1,3 @@
-(setq system-email "ret2pop@gmail.com")
-(setq system-username "ret2pop")
-(setq system-fullname "Preston Pan")
-
 (use-package emacs
 :custom
 ;; global defaults
@@ -99,7 +95,6 @@
 
     ;; load theme, fonts, and transparency. Prettify symbols.
     (global-prettify-symbols-mode 1)
-    (load-theme 'catppuccin :no-confirm)
     (set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 130)
     (set-frame-parameter nil 'alpha-background 90)
     (add-to-list 'default-frame-alist '(alpha-background . 90)))
   (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" "<p class=\"preamble\"><a href=\"/index.html\">home</a> | <a href=\"./index.html\">section main page</a></p><hr>")))
-         ("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 "Copyright Â© 2024 Preston Pan" "set copyright notice on bottom of site")
+   '(("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" "<p class=\"preamble\"><a href=\"/index.html\">home</a> | <a href=\"./index.html\">section main page</a></p><hr>")))
+     ("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))))
-
-;; (with-eval-after-load 'org
-;;   ;; stop electric-pair from pairing < in org-mode
-;;   (add-hook 'org-mode-hook
-;;             (lambda ()
-;;               (setq-local electric-pair-inhibit-predicate
-;;                           (lambda (c)
-;;                             (if (eq c ?<) t (electric-pair-default-inhibit c)))))))
+                               '((shell . t)
+                                 (python . t)
+                                 (latex . t))))
 
 (use-package unicode-fonts
   :init (unicode-fonts-setup))
 (use-package wgrep
   :after grep)
 
-(use-package lyrics-fetcher
-  :after (emms)
-  :custom
-  (lyrics-fetcher-genius-access-token (password-store-get "genius_api") "Use genius for backend")
-  :config
-  (lyrics-fetcher-use-backend 'genius))
-
 (defun insert-urandom-password (&optional length)
   (interactive "P")
   (let ((length (or length 32))
   :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))
+
 (use-package writegood-mode
   :hook (text-mode . writegood-mode))
 
 
 (use-package erc
   :custom
-  (erc-nick system-username "Set erc nick to username")
-  (erc-user-full-name system-fullname "Use real name for full name"))
+  (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
     "h i" '(info :wk "Info")
 
     "s i p" '(insert-urandom-password :wk "insert random password to buffer (for sops)")
-    "u w" '((lambda () (interactive) (shell-command "rsync -azvP ~/website_html/ root@nullring.xyz:/usr/share/nginx/ret2pop/")) :wk "rsync website update")
 
     "h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/monorepo/config/emacs.org")))))
 
   (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 "mbsync ret2pop" "Use mbsync for imap")
+  (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")
index c4bb4d9fe4fb04d5ade3f15a0edb184240a7eaf1..7cb2abd9cbc63b62109d53b77d4f3952038662c9 100644 (file)
@@ -7,13 +7,6 @@ This is my Vanilla Emacs configuration, made to work with my NixOS configuration
 reason, you will not see :ensure t inside any use-package declaration, for emacs packages
 are all compiled natively and reproducibly on the NixOS side. This configuration uses the
 emacs-lisp language only to configure variables for said packages, for the most part.
-** User
-Change these variables:
-#+begin_src emacs-lisp
-(setq system-email "ret2pop@gmail.com")
-(setq system-username "ret2pop")
-(setq system-fullname "Preston Pan")
-#+end_src
 ** Emacs
 These are all the options that need to be set at the start of the program. Because use-package
 is largely declarative, the order of many of these options should not matter. However, there
@@ -119,7 +112,6 @@ Emacs is self documenting, after all!
 
       ;; load theme, fonts, and transparency. Prettify symbols.
       (global-prettify-symbols-mode 1)
-      (load-theme 'catppuccin :no-confirm)
       (set-face-attribute 'default nil :font "Iosevka Nerd Font" :height 130)
       (set-frame-parameter nil 'alpha-background 90)
       (add-to-list 'default-frame-alist '(alpha-background . 90)))
@@ -169,39 +161,31 @@ This is my org mode configuration, which also configures latex.
     (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" "<p class=\"preamble\"><a href=\"/index.html\">home</a> | <a href=\"./index.html\">section main page</a></p><hr>")))
-         ("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 "Copyright Â© 2024 Preston Pan" "set copyright notice on bottom of site")
+     '(("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" "<p class=\"preamble\"><a href=\"/index.html\">home</a> | <a href=\"./index.html\">section main page</a></p><hr>")))
+       ("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))))
-
-  ;; (with-eval-after-load 'org
-  ;;   ;; stop electric-pair from pairing < in org-mode
-  ;;   (add-hook 'org-mode-hook
-  ;;             (lambda ()
-  ;;               (setq-local electric-pair-inhibit-predicate
-  ;;                           (lambda (c)
-  ;;                             (if (eq c ?<) t (electric-pair-default-inhibit c)))))))
+                                 '((shell . t)
+                                   (python . t)
+                                   (latex . t))))
 #+end_src
 As you can see, I only have one real entry in config here (I don't count requires even though
 they have to be on the top)
@@ -220,20 +204,11 @@ what electric-pair does based on the 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
   (use-package wgrep
     :after grep)
 #+end_src
-* Lyrics
-This currently doesn't work I'm pretty sure, but it's supposed to fetch lyrics from mpd.
-#+begin_src emacs-lisp
-  (use-package lyrics-fetcher
-    :after (emms)
-    :custom
-    (lyrics-fetcher-genius-access-token (password-store-get "genius_api") "Use genius for backend")
-    :config
-    (lyrics-fetcher-use-backend 'genius))
-#+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
@@ -359,6 +334,23 @@ The default modeline is ugly. I replace it with the doom modeline because it's b
     :config
     (doom-modeline-mode 1))
 #+end_src
+*** 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
+  (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))
+#+end_src
 ** Grammar
 I want to write good! I grammar good too.
 #+begin_src emacs-lisp
@@ -491,8 +483,8 @@ Configure IRC to use my username.
 #+begin_src emacs-lisp
   (use-package erc
     :custom
-    (erc-nick system-username "Set erc nick to username")
-    (erc-user-full-name system-fullname "Use real name for full name"))
+    (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"))
 #+end_src
 ** Keybindings
 Global keybindings for everything that I care about globally. It's all here! I use general
@@ -590,7 +582,6 @@ emacs keybindings.
       "h i" '(info :wk "Info")
 
       "s i p" '(insert-urandom-password :wk "insert random password to buffer (for sops)")
-      "u w" '((lambda () (interactive) (shell-command "rsync -azvP ~/website_html/ root@nullring.xyz:/usr/share/nginx/ret2pop/")) :wk "rsync website update")
 
       "h r r" '(lambda () (interactive) (org-babel-load-file (expand-file-name "~/monorepo/config/emacs.org")))))
 #+end_src
@@ -766,7 +757,7 @@ Email in emacs can be done with Mu4e.
     (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 "mbsync ret2pop" "Use mbsync for imap")
+    (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")
@@ -801,4 +792,4 @@ For some reason, lean4-mode is not in MELPA currently so I have to do this ugly
          :rev "76895d8939111654a472cfc617cfd43fbf5f1eb6"))
 #+end_src
 and actually pull something from the internet instead of pinning. Thankfully this reproduction issue is probably localized to lean files. Also,
-we're pulling a specific commit so it is still pinned.
+we're pulling a specific commit so it is still pinned. If it fails to fetch, lean4 is broken I guess.
index 117ad204449ab83f26daf0ed92d31493d68cab02..a0bf8b8fa528e513fb37ff2dde5c3dd9af06d59b 100644 (file)
@@ -13,10 +13,40 @@ emacs configuration is pinned to my flake.
 Hence, my monorepo serves a dual purpose, as do many of the files within my monorepo. They are
 often data files used in my configuration (i.e. emacs, elfeed, org-roam, agenda, journal, etc...)
 and they are webpages as well. This page is one such example of this concept.
+
+* Configurables
+We start with some configurable variables (you can change these if you want to use this configuration yourself):
+#+begin_src nix :tangle ../nix/flakevars.nix
+  let
+    # I'm ret2pop! What's your name?
+    internetName = "ret2pop";
+  in
+  {
+    # Name of spontaneity box
+    remoteHost = "${internetName}.net";
+
+    # Your internet name
+    internetName = internetName;
+
+    # Name of your organization
+    orgHost = "nullring.xyz";
+
+    # Hostnames of my systems
+    hostnames = [
+      "affinity"
+      "continuity"
+      "spontaneity"
+      "installer"
+    ];
+  }
+#+end_src
+
 * Flake.nix
 The flake is the entry point of the NixOS configuration. Here, I have a list of all the systems
 that I use with all the modules that they use. My NixOS configuration is heavily modularized,
 so that adding new configurations that add modifications is made simple.
+
+and now for the main flake:
 #+begin_src nix :tangle ../nix/flake.nix
   {
     description = "Emacs centric configurations for a complete networked system";
@@ -25,48 +55,58 @@ so that adding new configurations that add modifications is made simple.
       nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
       nur.url = "github:nix-community/NUR";
       sops-nix.url = "github:Mic92/sops-nix";
+
       scripts.url = "github:ret2pop/scripts";
       wallpapers.url = "github:ret2pop/wallpapers";
       sounds.url = "github:ret2pop/sounds";
+      deep-research.url = "github:ret2pop/ollama-deep-researcher";
+      impermanence.url = "github:nix-community/impermanence";
+
       nix-topology = {
         url = "github:oddlama/nix-topology";
         inputs.nixpkgs.follows = "nixpkgs";
       };
-      deep-research = {
-        url = "github:ret2pop/ollama-deep-researcher";
-      };
+
       home-manager = {
            url = "github:nix-community/home-manager/release-25.05";
            inputs.nixpkgs.follows = "nixpkgs";
       };
+
       disko = {
            url = "github:nix-community/disko";
            inputs.nixpkgs.follows = "nixpkgs";
       };
+
       lanzaboote = {
            url = "github:nix-community/lanzaboote/v0.4.1";
            inputs.nixpkgs.follows = "nixpkgs";
       };
+
       nixos-dns = {
         url = "github:Janik-Haag/nixos-dns";
         inputs.nixpkgs.follows = "nixpkgs";
       };
     };
 
-    outputs = { self, nixpkgs, home-manager, nur, disko, lanzaboote, sops-nix, nix-topology, nixos-dns, deep-research, ... }@attrs:
+    outputs = {
+      self,
+        nixpkgs,
+        home-manager,
+        nur,
+        disko,
+        lanzaboote,
+        sops-nix,
+        nix-topology,
+        nixos-dns,
+        deep-research,
+        impermanence,
+        ...
+    }
+      @attrs:
       let
-        hostnames = [
-          "affinity"
-          "continuity"
-          "installer"
-          "spontaneity"
-          # add hostnames here
-        ];
-
+        vars = import ./flakevars.nix;
         system = "x86_64-linux";
-
         pkgs = import nixpkgs { inherit system; };
-
         generate = nixos-dns.utils.generate nixpkgs.legacyPackages."${system}";
 
         dnsConfig = {
@@ -76,93 +116,94 @@ so that adding new configurations that add modifications is made simple.
 
         # function that generates all systems from hostnames
         mkConfigs = map (hostname: {name = "${hostname}";
-          value = nixpkgs.lib.nixosSystem {
-            inherit system;
-            specialArgs = attrs;
-            modules = if (hostname == "installer") then [
-              (./. + "/systems/${hostname}/default.nix")
-              { networking.hostName = "${hostname}"; }
-              nix-topology.nixosModules.default
-            ] else [
-              {
-                environment.systemPackages = with nixpkgs.lib; [
-                  deep-research.packages."${system}".deep-research
-                ];
-              }
-              nix-topology.nixosModules.default
-              lanzaboote.nixosModules.lanzaboote
-              disko.nixosModules.disko
-              home-manager.nixosModules.home-manager
-              sops-nix.nixosModules.sops
-              nixos-dns.nixosModules.dns
-              {
-                nixpkgs.overlays = [ nur.overlays.default ];
-                home-manager.extraSpecialArgs = attrs // { systemHostName = "${hostname}"; };
-                networking.hostName = "${hostname}";
-              }
-              (./. + "/systems/${hostname}/default.nix")
-            ];
-          };
-        });
+                                  value = nixpkgs.lib.nixosSystem {
+                                    inherit system;
+                                    specialArgs = attrs;
+                                    modules = if (hostname == "installer") then [
+                                      (./. + "/systems/${hostname}/default.nix")
+                                      { networking.hostName = "${hostname}"; }
+                                      nix-topology.nixosModules.default
+                                    ] else [
+                                      {
+                                        environment.systemPackages = with nixpkgs.lib; [
+                                          deep-research.packages."${system}".deep-research
+                                        ];
+                                      }
+                                      impermanence.nixosModules.impermanence
+                                      nix-topology.nixosModules.default
+                                      lanzaboote.nixosModules.lanzaboote
+                                      disko.nixosModules.disko
+                                      home-manager.nixosModules.home-manager
+                                      sops-nix.nixosModules.sops
+                                      nixos-dns.nixosModules.dns
+                                      {
+                                        nixpkgs.overlays = [ nur.overlays.default ];
+                                        home-manager.extraSpecialArgs = attrs // { systemHostName = "${hostname}"; };
+                                        networking.hostName = "${hostname}";
+                                      }
+                                      (./. + "/systems/${hostname}/default.nix")
+                                    ];
+                                  };
+                                 });
 
         mkDiskoFiles = map (hostname: {
           name = "${hostname}";
           value = self.nixosConfigurations."${hostname}".config.monorepo.vars.diskoSpec;
         });
+      in
+        {
+          nixosConfigurations = builtins.listToAttrs (mkConfigs vars.hostnames);
 
-      in {
-        nixosConfigurations = builtins.listToAttrs (mkConfigs hostnames);
-
-        evalDisko = builtins.listToAttrs (mkDiskoFiles (builtins.filter (x: x != "installer") hostnames));
+          evalDisko = builtins.listToAttrs (mkDiskoFiles (builtins.filter (x: x != "installer") vars.hostnames));
 
-        topology."${system}" = import nix-topology {
-          pkgs = import nixpkgs {
-            inherit system;
-            overlays = [ nix-topology.overlays.default ];
+          topology."${system}" = import nix-topology {
+            pkgs = import nixpkgs {
+              inherit system;
+              overlays = [ nix-topology.overlays.default ];
+            };
+            modules = [
+              ./topology/default.nix
+              { nixosConfigurations = self.nixosConfigurations; }
+            ];
           };
-          modules = [
-            ./topology/default.nix
-            { nixosConfigurations = self.nixosConfigurations; }
-          ];
-        };
 
-        devShell."${system}" = with pkgs; mkShell {
-          buildInputs = [
-            fira-code
-            python3
-            poetry
-            statix
-            deadnix
-          ];
-        };
+          devShell."${system}" = with pkgs; mkShell {
+            buildInputs = [
+              fira-code
+              python3
+              poetry
+              statix
+              deadnix
+            ];
+          };
 
-        packages."${system}" = {
-          zoneFiles = generate.zoneFiles dnsConfig;
-          octodns = generate.octodnsConfig {
-            inherit dnsConfig;
-            
-            config = {
-              providers = {
-                cloudflare = {
-                  class = "octodns_cloudflare.CloudflareProvider";
-                  token = "env/CLOUDFLARE_TOKEN";
-                };
-                config = {
-                  check_origin = false;
+          packages."${system}" = {
+            zoneFiles = generate.zoneFiles dnsConfig;
+            octodns = generate.octodnsConfig {
+              inherit dnsConfig;
+              
+              config = {
+                providers = {
+                  cloudflare = {
+                    class = "octodns_cloudflare.CloudflareProvider";
+                    token = "env/CLOUDFLARE_TOKEN";
+                  };
+                  config = {
+                    check_origin = false;
+                  };
                 };
               };
-            };
-            zones = {
-              "ret2pop.net." = nixos-dns.utils.octodns.generateZoneAttrs [ "cloudflare" ];
-              "nullring.xyz." = nixos-dns.utils.octodns.generateZoneAttrs [ "cloudflare" ];
+              zones = {
+                "${vars.remoteHost}." = nixos-dns.utils.octodns.generateZoneAttrs [ "cloudflare" ];
+                "${vars.orgHost}." = nixos-dns.utils.octodns.generateZoneAttrs [ "cloudflare" ];
+              };
             };
           };
         };
-      };
   }
 #+end_src
-Note that the configurations are automatically generated with he
-mkConfigs function.
+Note that the configurations are automatically generated with he mkConfigs function, and the final disko output is automatically generated
+with mkDiskoFiles.
 * Sops Configuration
 In order to use the sops configuration, you must change the age public key to the one that
 you own:
@@ -249,6 +290,9 @@ Variables used for regular configuration in your system ~default.nix~ file. The
 largely self-documenting.
 #+begin_src nix :tangle ../nix/modules/vars.nix
   { lib, ... }:
+  let
+    vars = import ../flakevars.nix;
+  in
   {
     options.monorepo.vars = {
       device = lib.mkOption {
@@ -258,6 +302,20 @@ largely self-documenting.
         description = "device that NixOS is installed to";
       };
 
+      internetName = lib.mkOption {
+        type = lib.types.str;
+        default = "${vars.internetName}";
+        example = "myinternetname";
+        description = "Internet name to be used for internet usernames";
+      };
+
+      repoName = lib.mkOption {
+        type = lib.types.str;
+        default = "monorepo";
+        example = "myreponame";
+        description = "Name of this repository";
+      };
+
       fileSystem = lib.mkOption {
         type = lib.types.str;
         default = "ext4";
@@ -293,11 +351,18 @@ largely self-documenting.
 
       remoteHost = lib.mkOption {
         type = lib.types.str;
-        default = "ret2pop.net";
+        default = "${vars.remoteHost}";
         example = "example.com";
         description = "Address to push to and pull from for website and git repos";
       };
 
+      orgHost = lib.mkOption {
+        type = lib.types.str;
+        default = "${vars.orgHost}";
+        example = "orgname.org";
+        description = "Domain name of your organization";
+      };
+
       timeZone = lib.mkOption {
         type = lib.types.str;
         default = "America/Vancouver";
@@ -345,19 +410,27 @@ under ~default.nix~ in the ~systems~ folder.
           ttyonly.enable = lib.mkEnableOption "TTY only, no xserver";
           grub.enable = lib.mkEnableOption "Enables grub instead of systemd-boot";
           workstation.enable = lib.mkEnableOption "Enables workstation services";
+          impermanence.enable = lib.mkEnableOption "Enables imperamanence";
            };
       };
     };
 
     config = {
-      environment.systemPackages = lib.mkIf config.monorepo.profiles.documentation.enable (with pkgs; [
+      environment.systemPackages = lib.mkIf config.monorepo.profiles.documentation.enable ((with pkgs; [
            linux-manual
            man-pages
            man-pages-posix
         iproute2
         silver-searcher
         ripgrep
-      ]);
+      ]) ++
+      (if (config.monorepo.vars.fileSystem == "btrfs") then with pkgs; [
+        btrfs-progs
+        btrfs-snap
+        btrfs-list
+        btrfs-heatmap
+      ] else []));
+
       boot.loader.grub = lib.mkIf config.monorepo.profiles.grub.enable {
         enable = true;
       };
@@ -368,6 +441,7 @@ under ~default.nix~ in the ~systems~ folder.
                    pipewire.enable = lib.mkDefault true;
                    tor.enable = lib.mkDefault true;
                    home.enable = lib.mkDefault true;
+          impermanence.enable = lib.mkDefault false;
            };
       };
     };
@@ -528,9 +602,9 @@ distribution soon, and I'm waiting on that.
       hostName = "0.0.0.0";
       welcometext = "Wecome to the Null Murmur instance!";
       registerName = "nullring";
-      registerHostname = "nullring.xyz";
-      sslCert = "/var/lib/acme/nullring.xyz/fullchain.pem";
-      sslKey = "/var/lib/acme/nullring.xyz/sslKey.pem";
+      registerHostname = "${config.monorepo.vars.orgHost}";
+      sslCert = "/var/lib/acme/${config.monorepo.vars.orgHost}/fullchain.pem";
+      sslKey = "/var/lib/acme/${config.monorepo.vars.orgHost}/sslKey.pem";
     };
   }
 #+end_src
@@ -586,7 +660,7 @@ I run my own IRC server to bridge with my Matrix server and my discord guild.
       enable = lib.mkDefault config.monorepo.profiles.server.enable;
       config = ''
   [Global]
-       Name = nullring.xyz
+       Name = ${config.monorepo.vars.orgHost}
        Info = NullRing IRC Instance
     Listen = 0.0.0.0
     MotdFile = /etc/motd.txt
@@ -595,9 +669,9 @@ I run my own IRC server to bridge with my Matrix server and my discord guild.
   [Options]
        PAM = no
   [SSL]
-       CertFile = /var/lib/acme/nullring.xyz/fullchain.pem
+       CertFile = /var/lib/acme/${config.monorepo.vars.orgHost}/fullchain.pem
        CipherList = HIGH:!aNULL:@STRENGTH:!SSLv3
-       KeyFile = /var/lib/acme/nullring.xyz/key.pem
+       KeyFile = /var/lib/acme/${config.monorepo.vars.orgHost}/key.pem
        Ports = 6697
   '';
     };
@@ -669,10 +743,11 @@ still federating and hosting the same protocol.
     services.matrix-conduit = {
       enable = lib.mkDefault config.monorepo.profiles.server.enable;
       settings.global = {
-        server_name = "matrix.${config.monorepo.vars.remoteHost}";
+        server_name = "matrix.${config.monorepo.vars.orgHost}";
         trusted_servers = [
           "matrix.org"
           "nixos.org"
+          "conduit.rs"
         ];
         address = "0.0.0.0";
         port = 6167;
@@ -681,8 +756,20 @@ still federating and hosting the same protocol.
     };
   }
 #+end_src
+** Honk
+In order to connect to activitypub:
+#+begin_src nix :tangle ../nix/modules/honk.nix
+  { lib, config, ... }:
+  {
+    services.honk = {
+      enable = config.monorepo.vars.ttyonly;
+      servername = "ret2pop.net";
+      username = "ret2pop";
+    };
+  }
+#+end_src
 ** Matterbridge
-Then I want to connect all these servers together with Matterbridge:
+I want to connect IRC to discord with matterbridge.
 #+begin_src nix :tangle ../nix/modules/matterbridge.nix
   { lib, config, ... }:
   {
@@ -692,20 +779,178 @@ Then I want to connect all these servers together with Matterbridge:
     };
   }
 #+end_src
+*** Mautrix
+I use this bridge to bridge myself from Matrix to Discord and vise versa, because Matterbridge is not maintained very well and therefore
+does not support conduit at the moment. Note that this is not fully declarative and requires that you add
+~/var/lib/mautrix-discord/discord-registration.yaml~ as an appservice to conduit.
+#+begin_src nix :tangle ../nix/modules/mautrix.nix
+  { lib, config, ... }:
+  {
+    services.mautrix-discord = {
+      enable = lib.mkDefault config.monorepo.profiles.server.enable;
+      environmentFile = "/etc/mautrix";
+      settings = {
+        bridge = {
+          animated_sticker = {
+            args = {
+              fps = 25;
+              height = 320;
+              width = 320;
+            };
+            target = "webp";
+          };
+          autojoin_thread_on_open = true;
+          avatar_proxy_key = "generate";
+          backfill = {
+            forward_limits = {
+              initial = {
+                channel = 0;
+                dm = 0;
+                thread = 0;
+              };
+              max_guild_members = -1;
+              missed = {
+                channel = 0;
+                dm = 0;
+                thread = 0;
+              };
+            };
+          };
+          cache_media = "unencrypted";
+          channel_name_template = "{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}}{{else}}#{{.Name}}{{end}}";
+          command_prefix = "!discord";
+          custom_emoji_reactions = true;
+          delete_guild_on_leave = true;
+          delete_portal_on_channel_delete = false;
+          delivery_receipts = false;
+          direct_media = {
+            allow_proxy = true;
+            enabled = false;
+            server_key = "generate";
+          };
+          displayname_template = "{{if .Webhook}}Webhook{{else}}{{or .GlobalName .Username}}{{if .Bot}} (bot){{end}}{{end}}";
+          double_puppet_allow_discovery = true;
+          double_puppet_server_map = { };
+          embed_fields_as_tables = true;
+          enable_webhook_avatars = true;
+          encryption = {
+            allow = false;
+            allow_key_sharing = false;
+            appservice = false;
+            default = false;
+            delete_keys = {
+              delete_fully_used_on_decrypt = false;
+              delete_on_device_delete = false;
+              delete_outbound_on_ack = false;
+              delete_outdated_inbound = false;
+              delete_prev_on_new_session = false;
+              dont_store_outbound = false;
+              periodically_delete_expired = false;
+              ratchet_on_decrypt = false;
+            };
+            msc4190 = false;
+            plaintext_mentions = false;
+            require = false;
+            rotation = {
+              disable_device_change_key_rotation = false;
+              enable_custom = false;
+              messages = 100;
+              milliseconds = 604800000;
+            };
+            verification_levels = {
+              receive = "unverified";
+              send = "unverified";
+              share = "cross-signed-tofu";
+            };
+          };
+          federate_rooms = true;
+          guild_name_template = "{{.Name}}";
+          login_shared_secret_map = { };
+          management_room_text = {
+            additional_help = "";
+            welcome = "Hello, I'm a Discord bridge bot.";
+            welcome_connected = "Use `help` for help.";
+            welcome_unconnected = "Use `help` for help or `login` to log in.";
+          };
+          message_error_notices = true;
+          message_status_events = false;
+          mute_channels_on_create = false;
+          permissions = {
+            "@${config.monorepo.vars.internetName}:matrix.${config.monorepo.vars.orgHost}" = "admin";
+            "*" = "user";
+          };
+          portal_message_buffer = 128;
+          prefix_webhook_messages = true;
+          private_chat_portal_meta = "default";
+          provisioning = {
+            debug_endpoints = false;
+            prefix = "/_matrix/provision";
+            shared_secret = "generate";
+          };
+          public_address = null;
+          resend_bridge_info = false;
+          restricted_rooms = false;
+          startup_private_channel_create_limit = 5;
+          sync_direct_chat_list = false;
+          use_discord_cdn_upload = true;
+          username_template = "discord_{{.}}";
+        };
+
+        appservice = {
+          address = "http://localhost:29334";
+          hostname = "0.0.0.0";
+          port = 29334;
+          id = "discord";
+          bot = {
+            username = "discordbot";
+            displayname = "Discord bridge bot";
+            avatar = "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC";
+          };
+          ephemeral_events = true;
+          async_transactions = false;
+          database = {
+            type = "sqlite3";
+            uri = "file:${config.services.mautrix-discord.dataDir}/mautrix-discord.db?_txlock=immediate";
+            max_open_conns = 20;
+            max_idle_conns = 2;
+            max_conn_idle_time = null;
+            max_conn_lifetime = null;
+          };
+          as_token = "$MAUTRIX_DISCORD_APPSERVICE_AS_TOKEN";
+          hs_token = "$MAUTRIX_DISCORD_APPSERVICE_HS_TOKEN";
+        };
+
+        dataDir = "/var/lib/mautrix-discord";
+        homeserver = {
+          async_media = false;
+          message_send_checkpoint_endpoint = null;
+          ping_interval_seconds = 0;
+          software = "standard";
+          status_endpoint = null;
+          websocket = false;
+          domain = "matrix.${config.monorepo.vars.orgHost}";
+          address = "http://localhost:6167";
+        };
+      };
+    };
+  }
+#+end_src
 ** Ollama
 Use ollama for serving large language models to my other computers.
 #+begin_src nix :tangle ../nix/modules/ollama.nix
   { config, lib, ... }:
   {
     services.ollama = {
-      enable = lib.mkDefault (!config.monorepo.profiles.ttyonly.enable);
+      enable = lib.mkDefault (!config.monorepo.profiles.server.enable);
       acceleration = if (config.monorepo.profiles.workstation.enable) then "cuda" else null;
-      loadModels = [
+      loadModels = if (config.monorepo.profiles.workstation.enable) then [
         "qwen3:30b"
         "qwen3-coder:latest"
         "qwen2.5-coder:latest"
-        "qwen2.5-coder:3b"
         "gemma3:12b-it-qat"
+      ] else [
+        "qwen3:0.6b"
+        "qwen2.5-coder:0.5b"
       ];
       host = "0.0.0.0";
       openFirewall = true;
@@ -757,7 +1002,7 @@ to the outside world under a domain.
       };
 
       virtualHosts = {
-        "matrix.${config.monorepo.vars.remoteHost}" = {
+        "matrix.${config.monorepo.vars.orgHost}" = {
           enableACME = true;
           forceSSL = true;
           listen = [
@@ -796,14 +1041,14 @@ to the outside world under a domain.
         };
            "${config.monorepo.vars.remoteHost}" = {
           serverName = "${config.monorepo.vars.remoteHost}";
-          serverAliases = [ "ret2pop.nullring.xyz" ];
-             root = "/var/www/ret2pop-website/";
+          serverAliases = [ "${config.monorepo.vars.internetName}.${config.monorepo.vars.orgHost}" ];
+             root = "/var/www/${config.monorepo.vars.internetName}-website/";
              addSSL = true;
              enableACME = true;
            };
 
-        "nullring.xyz" = {
-          serverName = "nullring.xyz";
+        "${config.monorepo.vars.orgHost}" = {
+          serverName = "${config.monorepo.vars.orgHost}";
           root = "/var/www/nullring/";
           addSSL = true;
           enableACME = true;
@@ -832,6 +1077,7 @@ world. This was the easiest frontend to set up on NixOS.
   }
 #+end_src
 ** Nvidia
+I have an Nvidia GPU on my computer.
 #+begin_src nix :tangle ../nix/modules/nvidia.nix
   { config, lib, pkgs, ... }:
   {
@@ -857,6 +1103,7 @@ world. This was the easiest frontend to set up on NixOS.
   }
 #+end_src
 ** CUDA
+I need CUDA on some computers because I run local LLMs.
 #+begin_src nix :tangle ../nix/modules/cuda.nix
   { config, lib, pkgs, ... }:
   {
@@ -888,13 +1135,102 @@ world. This was the easiest frontend to set up on NixOS.
         "submission tls://0.0.0.0:465 tcp://0.0.0.0:587"
       ] options.services.maddy.config.default;
       ensureCredentials = {
-        "preston@localhost" = {
-          passwordFile = "/secrets/preston-localhost";
+        "${config.monorepo.vars.userName}@localhost" = {
+          passwordFile = "/secrets/${config.monorepo.vars.userName}-localhost";
         };
       };
     };
   }
 #+end_src
+** Impermanence
+This is my impermanence profile, which removes all files on reboot except for the ones listed below.
+#+begin_src nix :tangle ../nix/modules/impermanence.nix
+  { lib, config, ... }:
+  {
+    assertions = [
+      {
+        assertion = ! (config.monorepo.profiles.impermanence.enable && (! (config.monorepo.vars.filesystem == "btrfs")));
+        message = "Impermanence requires btrfs filesystem.";
+      }
+    ];
+
+    boot.initrd.postResumeCommands = (if config.monorepo.profiles.impermanence.enable then lib.mkAfter ''
+      mkdir /btrfs_tmp
+      mount /dev/root_vg/root /btrfs_tmp
+      if [[ -e /btrfs_tmp/root ]]; then
+          mkdir -p /btrfs_tmp/old_roots
+          timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
+          mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
+      fi
+
+      delete_subvolume_recursively() {
+          IFS=$'\n'
+          for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
+              delete_subvolume_recursively "/btrfs_tmp/$i"
+          done
+          btrfs subvolume delete "$1"
+      }
+
+      for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
+          delete_subvolume_recursively "$i"
+      done
+
+      btrfs subvolume create /btrfs_tmp/root
+      umount /btrfs_tmp
+    '' else "");
+    
+    environment.persistence."/persistent" = {
+      enable = config.monorepo.profiles.impermanence.enable;
+      hideMounts = true;
+      directories = [
+        "/var/log"
+        "/var/lib/bluetooth"
+        "/var/lib/nixos"
+        "/var/lib/systemd/coredump"
+        "/etc/NetworkManager/system-connections"
+      ];
+      files = [
+        "/etc/machine-id"
+        "/etc/matterbridge.toml"
+        { file = "/var/keys/secret_file"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
+      ];
+      users."${config.monorepo.vars.userName}" = {
+        directories = [
+          "Downloads"
+          "music"
+          "Pictures"
+          "Documents"
+          "Videos"
+          "Monero"
+          "org"
+          "monorepo"
+          "soundfont"
+          "website_html"
+          "ardour"
+          "audacity"
+          "img"
+          "email"
+          "projects"
+          "secrets"
+
+          ".emacs.d"
+          ".elfeed"
+          ".electrum"
+          ".mozilla"
+          ".bitmonero"
+          ".config"
+          { directory = ".gnupg"; mode = "0700"; }
+          { directory = ".ssh"; mode = "0700"; }
+          { directory = ".local/share/keyrings"; mode = "0700"; }
+          ".local/share/direnv"
+        ];
+        files = [
+          ".emacs"
+        ];
+      };
+    };
+  }
+#+end_src
 ** Main Configuration
 This is the backbone of the all the NixOS configurations, with all these options being shared
 because they enhance security.
@@ -903,6 +1239,7 @@ because they enhance security.
   {
     imports = [
       ./matterbridge.nix
+      ./mautrix.nix
       ./xserver.nix
       ./ssh.nix
       ./pipewire.nix
@@ -921,6 +1258,7 @@ because they enhance security.
       ./ngircd.nix
       ./znc.nix
       ./docker.nix
+      ./impermanence.nix
     ];
 
     documentation = {
@@ -1063,7 +1401,7 @@ because they enhance security.
          "kernel.kptr_restrict" = 2;
 
          # madaidan
-              "kernel.smtcontrol" = "on";
+        "kernel.smtcontrol" = "on";
          "vm.swappiness" = 1;
          "vm.unprivileged_userfaultfd" = 0;
          "dev.tty.ldisc_autoload" = 0;
@@ -1296,37 +1634,68 @@ with configurable disk.
   { lib, config, ... }:
   let
     spec = {
-    disko.devices = {
-      disk = {
-        main = {
-          type = "disk";
-          device = config.monorepo.vars.device;
-          content = {
-            type = "gpt";
-            partitions = {
-              ESP = {
-                priority = 1;
-                name = "ESP";
-                start = "1M";
-                end = "128M";
-                type = "EF00";
-                content = {
-                  type = "filesystem";
-                  format = "vfat";
-                  mountpoint = "/boot";
-                  mountOptions = [ "umask=0077" ];
+      disko.devices = {
+        disk = {
+          main = {
+            type = "disk";
+            device = config.monorepo.vars.device;
+            content = {
+              type = "gpt";
+              partitions = {
+                ESP = {
+                  size = "512M";
+                  type = "EF00";
+                  content = {
+                    type = "filesystem";
+                    format = "vfat";
+                    mountpoint = "/boot";
+                    mountOptions = [ "umask=0077" ];
+                  };
                 };
-              };
-              root = {
-                size = "100%";
-                content = {
-                  type = "btrfs";
-                  extraArgs = [ "-f" ]; # Override existing partition
-                  mountpoint = "/";
-                  mountOptions = [
-                    "compress=zstd"
-                    "noatime"
-                  ];
+                luks = {
+                  size = "100%";
+                  content = {
+                    type = "luks";
+                    name = "crypted";
+                    passwordFile = "/tmp/secret.key";
+                    content = {
+                      type = "btrfs";
+                      extraArgs = [ "-f" ];
+                      subvolumes = {
+                        "/root" = {
+                          mountpoint = "/";
+                          mountOptions = [
+                            "compress=zstd"
+                            "noatime"
+                          ];
+                        };
+
+                        "/home" = {
+                          mountpoint = "/home";
+                          mountOptions = [
+                            "compress=zstd"
+                            "noatime"
+                          ];
+                        };
+
+                        "/nix" = {
+                          mountpoint = "/nix";
+                          mountOptions = [
+                            "compress=zstd"
+                            "noatime"
+                          ];
+                        };
+
+                        "/persistent" = {
+                          mountpoint = "/persistent";
+                          mountOptions = [
+                            "compress=zstd"
+                            "noatime"
+                          ];
+                        };
+                      };
+                    };
+                  };
                 };
               };
             };
@@ -1334,7 +1703,6 @@ with configurable disk.
         };
       };
     };
-  };
   in
   {
     monorepo.vars.diskoSpec = spec;
@@ -1469,6 +1837,8 @@ I have many imports that we'll go through next.
            lang-openscad.enable = lib.mkEnableOption "Enables openscad language support";
            lang-js.enable = lib.mkEnableOption "Enables javascript language support";
            lang-nix.enable = lib.mkEnableOption "Enables nix language support";
+           lang-idris.enable = lib.mkEnableOption "Enables idris language support";
+           lang-agda.enable = lib.mkEnableOption "Enables agda language support";
            lang-coq.enable = lib.mkEnableOption "Enables coq language support";
         lang-lean.enable = lib.mkEnableOption "Enables lean language support";
            lang-haskell.enable = lib.mkEnableOption "Enables haskell language support";
@@ -1514,6 +1884,7 @@ I have many imports that we'll go through next.
                                                          gnumake
                                                          bear
                                                          clang-tools
+                        autotools-language-server
                                                  ]) else [])
                       ++
                       (if config.monorepo.profiles.workstation.enable then (with pkgs; [
@@ -1567,6 +1938,15 @@ I have many imports that we'll go through next.
                       (if config.monorepo.profiles.lang-lean.enable then (with pkgs; [
                         lean4
                       ]) else [])
+                                                 ++
+                                                 (if config.monorepo.profiles.lang-agda.enable then (with pkgs; [
+                        agda
+                                                 ]) else [])
+                                                 ++
+                                                 (if config.monorepo.profiles.lang-idris.enable then (with pkgs; [
+                        idris
+                        idris2Packages.idris2Lsp
+                                                 ]) else [])
                                                  ++
                                                  (if config.monorepo.profiles.lang-nix.enable then (with pkgs; [
                                                          nil
@@ -1630,6 +2010,8 @@ I have many imports that we'll go through next.
            lang-coq.enable = lib.mkDefault config.monorepo.profiles.enable;
            lang-lean.enable = lib.mkDefault config.monorepo.profiles.enable;
            lang-haskell.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-idris.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-agda.enable = lib.mkDefault config.monorepo.profiles.enable;
 
            crypto.enable = lib.mkDefault config.monorepo.profiles.enable;
            art.enable = lib.mkDefault config.monorepo.profiles.enable;
@@ -1942,10 +2324,14 @@ as an org file which gets automatically tangled to an emacs-lisp file.
         enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
         package = pkgs.emacs-pgtk;
         extraConfig = ''
-        (setq debug-on-error t)
-        (org-babel-load-file
-          (expand-file-name "~/monorepo/config/emacs.org"))'';
+  (setq debug-on-error t)
+  (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"))'';
         extraPackages = epkgs: [
+          epkgs.agda2-mode
           epkgs.all-the-icons
           epkgs.auctex
           epkgs.catppuccin-theme
@@ -1954,6 +2340,7 @@ as an org file which gets automatically tangled to an emacs-lisp file.
           epkgs.company-solidity
           epkgs.counsel
           epkgs.dashboard
+          epkgs.doom-themes
           epkgs.doom-modeline
           epkgs.elfeed
           epkgs.elfeed-org
@@ -1976,6 +2363,7 @@ as an org file which gets automatically tangled to an emacs-lisp file.
           epkgs.gruvbox-theme
           epkgs.haskell-mode
           epkgs.htmlize
+          epkgs.idris-mode
           epkgs.irony-eldoc
           epkgs.ivy
           epkgs.ivy-pass
@@ -1985,6 +2373,7 @@ as an org file which gets automatically tangled to an emacs-lisp file.
           epkgs.lsp-mode
           epkgs.lsp-haskell
           epkgs.lyrics-fetcher
+          epkgs.mastodon
           epkgs.magit
           epkgs.magit-delta
           epkgs.mu4e
@@ -2157,6 +2546,7 @@ to use this component will come soon.
           "$mod, B, exec, bitcoin-qt"
           "$mod, M, exec, monero-wallet-gui"
           "$mod, V, exec, vesktop"
+          "$mod, C, exec, fluffychat"
           "$mod, D, exec, wofi --show run"
           "$mod, P, exec, bash ${scripts}/powermenu.sh"
           "$mod, Q, killactive"
@@ -2322,7 +2712,7 @@ encrypted. This module uses the ~vars.nix~ as well as the home ~default.nix~ opt
   programs.mbsync = {
     enable = lib.mkDefault config.monorepo.profiles.email.enable;
     extraConfig = ''
-      IMAPAccount ret2pop
+      IMAPAccount ${config.monorepo.vars.internetName}
       Host ${config.monorepo.profiles.email.imapsServer}
       User ${config.monorepo.profiles.email.email}
       PassCmd "cat ${config.sops.secrets.mail.path}"
@@ -2331,17 +2721,17 @@ encrypted. This module uses the ~vars.nix~ as well as the home ~default.nix~ opt
       AuthMechs *
       CertificateFile /etc/ssl/certs/ca-certificates.crt
 
-      IMAPStore ret2pop-remote
-      Account ret2pop
+      IMAPStore ${config.monorepo.vars.internetName}-remote
+      Account ${config.monorepo.vars.internetName}
 
-      MaildirStore ret2pop-local
-      Path ~/email/ret2pop/
-      Inbox ~/email/ret2pop/INBOX
+      MaildirStore ${config.monorepo.vars.internetName}-local
+      Path ~/email/${config.monorepo.vars.internetName}/
+      Inbox ~/email/${config.monorepo.vars.internetName}/INBOX
       SubFolders Verbatim
 
-      Channel ret2pop 
-      Far :ret2pop-remote:
-      Near :ret2pop-local:
+      Channel ${config.monorepo.vars.internetName} 
+      Far :${config.monorepo.vars.internetName}-remote:
+      Near :${config.monorepo.vars.internetName}-local:
       Patterns *
       Create Near
       Sync All
@@ -3015,6 +3405,7 @@ standard.
       };
 
       shellAliases = {
+        get-channel-id = "yt-dlp --print \"%(channel_id)s\" --playlist-end 1 \"$1\"";
         se = "sops edit";
         f = "vim $(fzf)";
         e = "cd $(find . -type d -print | fzf)";
@@ -3024,9 +3415,9 @@ standard.
         py = "python3";
         rb = "sudo nixos-rebuild switch --flake $HOME/monorepo/nix#${systemHostName}";
         nfu = "cd ~/monorepo/nix && git add . && git commit -m \"new flake lock\" &&  nix flake update";
-        usync =  "rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/ret2pop-website/";
+        usync =  "rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/${config.monorepo.vars.internetName}-website/";
         usite
-        = "cd ~/src/publish-org-roam-ui && bash local.sh && rm -rf ~/website_html/graph_view; cp -r ~/src/publish-org-roam-ui/out ~/website_html/graph_view && rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/ret2pop-website/";
+        = "cd ~/src/publish-org-roam-ui && bash local.sh && rm -rf ~/website_html/graph_view; cp -r ~/src/publish-org-roam-ui/out ~/website_html/graph_view && rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/${config.monorepo.vars.internetName}-website/";
         sai = "eval \"$(ssh-agent -s)\" && ssh-add ~/.ssh/id_ed25519 && ssh-add -l";
         i3 = "exec ${pkgs.i3-gaps}/bin/i3";
       };
@@ -3052,7 +3443,7 @@ matrix server while having encryption.
           SSL = true;
         };
         local-matrix = {
-          Homeserver = "https://social.nullring.xyz";
+          Homeserver = "https://matrix.${config.monorepo.vars.orgHost}";
           ListenAddress = "127.0.0.1";
           ListenPort = "8008";
         };
@@ -3069,8 +3460,8 @@ for these configurations.
   {
     home = {
       activation.startup-files = lib.hm.dag.entryAfter [ "installPackages" ] ''
-      if [ ! -d "/home/${config.monorepo.vars.userName}/email/ret2pop/" ]; then
-        mkdir -p /home/${config.monorepo.vars.userName}/email/ret2pop/
+      if [ ! -d "/home/${config.monorepo.vars.userName}/email/${config.monorepo.vars.internetName}/" ]; then
+        mkdir -p /home/${config.monorepo.vars.userName}/email/${config.monorepo.vars.internetName}/
       fi
       if [ ! -d "/home/${config.monorepo.vars.userName}/music" ]; then
         mkdir -p /home/${config.monorepo.vars.userName}/music
@@ -3108,7 +3499,7 @@ for these configurations.
 
         # Apps
         # octaveFull
-        vesktop grim swww vim telegram-desktop qwen-code
+        vesktop grim swww vim telegram-desktop qwen-code fluffychat
 
         # Sound/media
         pavucontrol alsa-utils imagemagick ffmpeg helvum
@@ -3120,7 +3511,7 @@ for these configurations.
         torsocks tor-browser
 
         # fonts
-        nerd-fonts.iosevka noto-fonts noto-fonts-cjk-sans noto-fonts-emoji fira-code font-awesome_6
+        nerd-fonts.iosevka noto-fonts noto-fonts-cjk-sans noto-fonts-emoji fira-code font-awesome_6 victor-mono
         (aspellWithDicts
           (dicts: with dicts; [ en en-computers en-science ]))
 
@@ -3221,7 +3612,6 @@ the path.
   { config, sops-nix, ... }:
   {
     home-manager = {
-
       sharedModules = [
         sops-nix.homeManagerModules.sops
       ];
@@ -3231,16 +3621,27 @@ the path.
     };
   }
 #+end_src
-** Includes
+** Common
 These are the common includes for each of my systems. This ensures that we don't have to duplicate includes every time we want to add a new
-system.
-#+begin_src nix :tangle ../nix/systems/includes.nix
+system. Also more common configuration can go here.
+#+begin_src nix :tangle ../nix/systems/common.nix
   { config, lib, ... }:
   {
     imports = [
       ./home.nix
       ../modules/default.nix
     ];
+    # Put configuration (e.g. monorepo variable configuration) common to all configs here
+  }
+#+end_src
+** Home Manager Common
+#+begin_src nix :tangle ../nix/systems/home-common.nix
+  { lib, config, ... }:
+  {
+    imports = [
+      ../modules/home/default.nix
+    ];
+    # Put configuration (e.g. monorepo variable configuration) common to all configs here
   }
 #+end_src
 ** Continuity
@@ -3250,11 +3651,16 @@ This is pretty understandable, if you understand all the above.
   {
     imports = [
       ../../disko/drive-simple.nix
-      ../includes.nix
+      ../common.nix
     ];
     config = {
-      # drive to install to
-      monorepo.vars.device = "/dev/sda";
+      monorepo = {
+        profiles.impermanence.enable = true;
+        vars = {
+          device = "/dev/sda";
+          fileSystem = "btrfs";
+        };
+      };
     };
   }
 #+end_src
@@ -3265,7 +3671,7 @@ monorepo home options.
   { lib, config, pkgs, ... }:
   {
     imports = [
-      ../../modules/home/default.nix
+      ../home-common.nix
     ];
     config.monorepo.profiles.workstation.enable = false;
   }
@@ -3277,7 +3683,7 @@ as several other useful services.
   { config, lib, home-manager, ... }:
   {
     imports = [
-      ../includes.nix
+      ../common.nix
       ../../disko/drive-simple.nix
     ];
     config = {
@@ -3297,7 +3703,7 @@ as several other useful services.
   { lib, config, pkgs, ... }:
   {
     imports = [
-      ../../modules/home/default.nix
+      ../home-common.nix
     ];
     config.monorepo = {
       profiles.cuda.enable = true;
@@ -3308,12 +3714,17 @@ as several other useful services.
 Spontaneity is my VPS instance.
 #+begin_src nix :tangle ../nix/systems/spontaneity/default.nix
   { config, lib, ... }:
+  let
+    ipv4addr = "66.42.84.130";
+    ipv6addr = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+  in
   {
     imports = [
-      ../includes.nix
+      ../common.nix
+      ../../disko/drive-bios.nix
+
       # nixos-anywhere generates this file
       ./hardware-configuration.nix
-      ../../disko/drive-bios.nix
     ];
     config = {
       monorepo = {
@@ -3329,7 +3740,7 @@ Spontaneity is my VPS instance.
       networking = {
         interfaces.ens3.ipv6.addresses = [
           {
-            address = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+            address = ipv6addr;
             prefixLength = 64;
           }
         ];
@@ -3348,12 +3759,12 @@ Spontaneity is my VPS instance.
           enable = true;
           baseDomains = {
             "${config.monorepo.vars.remoteHost}" = {
-              a.data = "66.42.84.130";
-              aaaa.data = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+              a.data = ipv4addr;
+              aaaa.data = ipv6addr;
             };
-            "nullring.xyz" = {
-              a.data = "66.42.84.130";
-              aaaa.data = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+            "${config.monorepo.vars.orgHost}" = {
+              a.data = ipv4addr;
+              aaaa.data = ipv6addr;
             };
           };
           subDomains = {
@@ -3364,12 +3775,12 @@ Spontaneity is my VPS instance.
               mx.data = "10 mail.${config.monorepo.vars.remoteHost}.";
             };
 
-            "nullring.xyz" = {};
-            "git.nullring.xyz" = {};
-            "matrix.nullring.xyz" = {};
-            "talk.nullring.xyz" = {};
-            "mail.nullring.xyz" = {};
-            "ret2pop.nullring.xyz" = {};
+            "${config.monorepo.vars.orgHost}" = {};
+            "git.${config.monorepo.vars.orgHost}" = {};
+            "matrix.${config.monorepo.vars.orgHost}" = {};
+            "talk.${config.monorepo.vars.orgHost}" = {};
+            "mail.${config.monorepo.vars.orgHost}" = {};
+            "${config.monorepo.vars.internetName}.${config.monorepo.vars.orgHost}" = {};
           };
         };
       };
@@ -3381,7 +3792,7 @@ Spontaneity is my VPS instance.
   { lib, config, pkgs, ... }:
   {
     imports = [
-      ../../modules/home/default.nix
+      ../home-common.nix
     ];
     config.monorepo.profiles.enable = false;
   }
@@ -3455,6 +3866,10 @@ This contains the installation script I use to install my systems.
     exit 1
   fi
 
+  gum style --border normal --margin "1" --padding "1 2" "Notice: if using full disk encryption, write to /tmp/secret.key first with your password."
+
+  sleep 3
+
   cd "$HOME"
 
   ping -q -c1 google.com &>/dev/null && echo "online! Proceeding with the installation..." || nmtui
@@ -3507,7 +3922,7 @@ This contains the installation script I use to install my systems.
     gum input --placeholder "Press Enter to continue" >/dev/null
     vim "$HOME/monorepo/nix/systems/$SYSTEM/home.nix"
 
-    sed -i "/# add hostnames here/i \  \"$1\"" "$HOME/monorepo/nix/flake.nix"
+    sed -i "/hostnames = \[/,/];/ s/];/  \"$1\"\n    ];/" "$HOME/monorepo/nix/flake.nix"
 
     if [ ! -f "$HOME/monorepo/nix/disko/$DRIVE" ]; then
       cp "$HOME/monorepo/nix/disko/drive-simple.nix" "$HOME/monorepo/nix/disko/$DRIVE"
@@ -3557,27 +3972,3 @@ This contains the installation script I use to install my systems.
     };
   }
 #+end_src
-* Add System Script
-Here is a script to add a new system automatically:
-#+begin_src bash :tangle ../nix/add-system.sh
-  #!/usr/bin/env bash
-  sed -i "/# add hostnames here/i \  \"$1\"" "$HOME/monorepo/nix/flake.nix"
-  sed -i "/# add hostnames here/i \  \"$1\"" "$HOME/monorepo/config/nix.org"
-
-  mkdir -p "$HOME/monorepo/nix/systems/$1"
-
-  cat > "$HOME/monorepo/nix/systems/$1/default.nix" <<EOF
-  { ... }:
-  {
-    imports = [
-      ../includes.nix
-      ../../disko/drive-simple.nix
-    ];
-    # CHANGEME
-    config.monorepo.vars.drive = "/dev/sda";
-  }
-  EOF
-
-  cp "$HOME/monorepo/nix/systems/continuity/home.nix" "$HOME/monorepo/nix/systems/$1/home.nix"
-#+end_src
-note that one will have to add some files to this org file afterwards, but this is a fine short term solution.
diff --git a/journal/20250912.org b/journal/20250912.org
new file mode 100644 (file)
index 0000000..60eeaaa
--- /dev/null
@@ -0,0 +1,11 @@
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Friday, 12 September 2025
+** 23:46 
+Charlie Kirk died.
diff --git a/journal/20250914.org b/journal/20250914.org
new file mode 100644 (file)
index 0000000..893d33e
--- /dev/null
@@ -0,0 +1,12 @@
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Sunday, 14 September 2025
+** 02:17 
+I'm working on some more topology, specifically relating to product spaces. I also plan on cleaning up my house today.
+A lot of my life is solitary, and in many ways that is nice.
diff --git a/journal/20250915.org b/journal/20250915.org
new file mode 100644 (file)
index 0000000..57e2dfe
--- /dev/null
@@ -0,0 +1,11 @@
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Monday, 15 September 2025
+** 01:19 
+I am currently trying to do the practice problems for this chapter.
diff --git a/journal/20250916.org b/journal/20250916.org
new file mode 100644 (file)
index 0000000..62afc7e
--- /dev/null
@@ -0,0 +1,12 @@
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Tuesday, 16 September 2025
+** 03:13 
+I am doing more topology, and i'm realizing that these questions related to product spaces are easy.
+Still, I hope that I'm able to complete this fast enough.
diff --git a/journal/20250917.org b/journal/20250917.org
new file mode 100644 (file)
index 0000000..8833c07
--- /dev/null
@@ -0,0 +1,12 @@
+#+TITLE: Daily Journal
+#+STARTUP: showeverything
+#+DESCRIPTION: My daily journal entry
+#+AUTHOR: Preston Pan
+#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="../style.css" />
+#+html_head: <script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
+#+html_head: <script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
+#+options: broken-links:t
+* Wednesday, 17 September 2025
+** 03:39 
+I just set up the discord-matrix bridge, and I ate with my friend today. I have been a bit tired recently;
+I should figure out what's up with that with a blood test at some point.
diff --git a/nix/add-system.sh b/nix/add-system.sh
deleted file mode 100755 (executable)
index bd7d0cf..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env bash
-sed -i "/# add hostnames here/i \  \"$1\"" "$HOME/monorepo/nix/flake.nix"
-sed -i "/# add hostnames here/i \  \"$1\"" "$HOME/monorepo/config/nix.org"
-
-mkdir -p "$HOME/monorepo/nix/systems/$1"
-
-cat > "$HOME/monorepo/nix/systems/$1/default.nix" <<EOF
-{ ... }:
-{
-  imports = [
-    ../includes.nix
-    ../../disko/drive-simple.nix
-  ];
-  # CHANGEME
-  config.monorepo.vars.drive = "/dev/sda";
-}
-EOF
-
-cp "$HOME/monorepo/nix/systems/continuity/home.nix" "$HOME/monorepo/nix/systems/$1/home.nix"
index 08fafd46c5a1e3c22a2529343d8fc1da45ae35b9..b49558d556f57958b36e35912e962f0508ba01bd 100644 (file)
@@ -1,37 +1,68 @@
 { lib, config, ... }:
 let
   spec = {
-  disko.devices = {
-    disk = {
-      main = {
-        type = "disk";
-        device = config.monorepo.vars.device;
-        content = {
-          type = "gpt";
-          partitions = {
-            ESP = {
-              priority = 1;
-              name = "ESP";
-              start = "1M";
-              end = "128M";
-              type = "EF00";
-              content = {
-                type = "filesystem";
-                format = "vfat";
-                mountpoint = "/boot";
-                mountOptions = [ "umask=0077" ];
+    disko.devices = {
+      disk = {
+        main = {
+          type = "disk";
+          device = config.monorepo.vars.device;
+          content = {
+            type = "gpt";
+            partitions = {
+              ESP = {
+                size = "512M";
+                type = "EF00";
+                content = {
+                  type = "filesystem";
+                  format = "vfat";
+                  mountpoint = "/boot";
+                  mountOptions = [ "umask=0077" ];
+                };
               };
-            };
-            root = {
-              size = "100%";
-              content = {
-                type = "btrfs";
-                extraArgs = [ "-f" ]; # Override existing partition
-                mountpoint = "/";
-                mountOptions = [
-                  "compress=zstd"
-                  "noatime"
-                ];
+              luks = {
+                size = "100%";
+                content = {
+                  type = "luks";
+                  name = "crypted";
+                  passwordFile = "/tmp/secret.key";
+                  content = {
+                    type = "btrfs";
+                    extraArgs = [ "-f" ];
+                    subvolumes = {
+                      "/root" = {
+                        mountpoint = "/";
+                        mountOptions = [
+                          "compress=zstd"
+                          "noatime"
+                        ];
+                      };
+
+                      "/home" = {
+                        mountpoint = "/home";
+                        mountOptions = [
+                          "compress=zstd"
+                          "noatime"
+                        ];
+                      };
+
+                      "/nix" = {
+                        mountpoint = "/nix";
+                        mountOptions = [
+                          "compress=zstd"
+                          "noatime"
+                        ];
+                      };
+
+                      "/persistent" = {
+                        mountpoint = "/persistent";
+                        mountOptions = [
+                          "compress=zstd"
+                          "noatime"
+                        ];
+                      };
+                    };
+                  };
+                };
               };
             };
           };
@@ -39,7 +70,6 @@ let
       };
     };
   };
-};
 in
 {
   monorepo.vars.diskoSpec = spec;
index 7f2b3b27cf011cbea9325c7890a93d49f2bd76ca..2baf2b28dbf54c1a8d223603744e0d686367ae9f 100644 (file)
         "type": "github"
       }
     },
+    "impermanence": {
+      "locked": {
+        "lastModified": 1737831083,
+        "narHash": "sha256-LJggUHbpyeDvNagTUrdhe/pRVp4pnS6wVKALS782gRI=",
+        "owner": "nix-community",
+        "repo": "impermanence",
+        "rev": "4b3e914cdf97a5b536a889e939fb2fd2b043a170",
+        "type": "github"
+      },
+      "original": {
+        "owner": "nix-community",
+        "repo": "impermanence",
+        "type": "github"
+      }
+    },
     "lanzaboote": {
       "inputs": {
         "crane": "crane",
         "deep-research": "deep-research",
         "disko": "disko",
         "home-manager": "home-manager",
+        "impermanence": "impermanence",
         "lanzaboote": "lanzaboote",
         "nix-topology": "nix-topology",
         "nixos-dns": "nixos-dns",
index 326809b3a0eaf148543b352c24ab9398536e7581..795ab4ba8229035446f3a7333635a86b8feef4da 100644 (file)
@@ -5,48 +5,58 @@
     nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
     nur.url = "github:nix-community/NUR";
     sops-nix.url = "github:Mic92/sops-nix";
+
     scripts.url = "github:ret2pop/scripts";
     wallpapers.url = "github:ret2pop/wallpapers";
     sounds.url = "github:ret2pop/sounds";
+    deep-research.url = "github:ret2pop/ollama-deep-researcher";
+    impermanence.url = "github:nix-community/impermanence";
+
     nix-topology = {
       url = "github:oddlama/nix-topology";
       inputs.nixpkgs.follows = "nixpkgs";
     };
-    deep-research = {
-      url = "github:ret2pop/ollama-deep-researcher";
-    };
+
     home-manager = {
            url = "github:nix-community/home-manager/release-25.05";
            inputs.nixpkgs.follows = "nixpkgs";
     };
+
     disko = {
            url = "github:nix-community/disko";
            inputs.nixpkgs.follows = "nixpkgs";
     };
+
     lanzaboote = {
            url = "github:nix-community/lanzaboote/v0.4.1";
            inputs.nixpkgs.follows = "nixpkgs";
     };
+
     nixos-dns = {
       url = "github:Janik-Haag/nixos-dns";
       inputs.nixpkgs.follows = "nixpkgs";
     };
   };
 
-  outputs = { self, nixpkgs, home-manager, nur, disko, lanzaboote, sops-nix, nix-topology, nixos-dns, deep-research, ... }@attrs:
+  outputs = {
+    self,
+      nixpkgs,
+      home-manager,
+      nur,
+      disko,
+      lanzaboote,
+      sops-nix,
+      nix-topology,
+      nixos-dns,
+      deep-research,
+      impermanence,
+      ...
+  }
+    @attrs:
     let
-      hostnames = [
-        "affinity"
-        "continuity"
-        "installer"
-        "spontaneity"
-        # add hostnames here
-      ];
-
+      vars = import ./flakevars.nix;
       system = "x86_64-linux";
-
       pkgs = import nixpkgs { inherit system; };
-
       generate = nixos-dns.utils.generate nixpkgs.legacyPackages."${system}";
 
       dnsConfig = {
 
       # function that generates all systems from hostnames
       mkConfigs = map (hostname: {name = "${hostname}";
-        value = nixpkgs.lib.nixosSystem {
-          inherit system;
-          specialArgs = attrs;
-          modules = if (hostname == "installer") then [
-            (./. + "/systems/${hostname}/default.nix")
-            { networking.hostName = "${hostname}"; }
-            nix-topology.nixosModules.default
-          ] else [
-            {
-              environment.systemPackages = with nixpkgs.lib; [
-                deep-research.packages."${system}".deep-research
-              ];
-            }
-            nix-topology.nixosModules.default
-            lanzaboote.nixosModules.lanzaboote
-            disko.nixosModules.disko
-            home-manager.nixosModules.home-manager
-            sops-nix.nixosModules.sops
-            nixos-dns.nixosModules.dns
-            {
-              nixpkgs.overlays = [ nur.overlays.default ];
-              home-manager.extraSpecialArgs = attrs // { systemHostName = "${hostname}"; };
-              networking.hostName = "${hostname}";
-            }
-            (./. + "/systems/${hostname}/default.nix")
-          ];
-        };
-      });
+                                value = nixpkgs.lib.nixosSystem {
+                                  inherit system;
+                                  specialArgs = attrs;
+                                  modules = if (hostname == "installer") then [
+                                    (./. + "/systems/${hostname}/default.nix")
+                                    { networking.hostName = "${hostname}"; }
+                                    nix-topology.nixosModules.default
+                                  ] else [
+                                    {
+                                      environment.systemPackages = with nixpkgs.lib; [
+                                        deep-research.packages."${system}".deep-research
+                                      ];
+                                    }
+                                    impermanence.nixosModules.impermanence
+                                    nix-topology.nixosModules.default
+                                    lanzaboote.nixosModules.lanzaboote
+                                    disko.nixosModules.disko
+                                    home-manager.nixosModules.home-manager
+                                    sops-nix.nixosModules.sops
+                                    nixos-dns.nixosModules.dns
+                                    {
+                                      nixpkgs.overlays = [ nur.overlays.default ];
+                                      home-manager.extraSpecialArgs = attrs // { systemHostName = "${hostname}"; };
+                                      networking.hostName = "${hostname}";
+                                    }
+                                    (./. + "/systems/${hostname}/default.nix")
+                                  ];
+                                };
+                               });
 
       mkDiskoFiles = map (hostname: {
         name = "${hostname}";
         value = self.nixosConfigurations."${hostname}".config.monorepo.vars.diskoSpec;
       });
+    in
+      {
+        nixosConfigurations = builtins.listToAttrs (mkConfigs vars.hostnames);
 
-    in {
-      nixosConfigurations = builtins.listToAttrs (mkConfigs hostnames);
-
-      evalDisko = builtins.listToAttrs (mkDiskoFiles (builtins.filter (x: x != "installer") hostnames));
+        evalDisko = builtins.listToAttrs (mkDiskoFiles (builtins.filter (x: x != "installer") vars.hostnames));
 
-      topology."${system}" = import nix-topology {
-        pkgs = import nixpkgs {
-          inherit system;
-          overlays = [ nix-topology.overlays.default ];
+        topology."${system}" = import nix-topology {
+          pkgs = import nixpkgs {
+            inherit system;
+            overlays = [ nix-topology.overlays.default ];
+          };
+          modules = [
+            ./topology/default.nix
+            { nixosConfigurations = self.nixosConfigurations; }
+          ];
         };
-        modules = [
-          ./topology/default.nix
-          { nixosConfigurations = self.nixosConfigurations; }
-        ];
-      };
 
-      devShell."${system}" = with pkgs; mkShell {
-        buildInputs = [
-          fira-code
-          python3
-          poetry
-          statix
-          deadnix
-        ];
-      };
+        devShell."${system}" = with pkgs; mkShell {
+          buildInputs = [
+            fira-code
+            python3
+            poetry
+            statix
+            deadnix
+          ];
+        };
 
-      packages."${system}" = {
-        zoneFiles = generate.zoneFiles dnsConfig;
-        octodns = generate.octodnsConfig {
-          inherit dnsConfig;
-          
-          config = {
-            providers = {
-              cloudflare = {
-                class = "octodns_cloudflare.CloudflareProvider";
-                token = "env/CLOUDFLARE_TOKEN";
-              };
-              config = {
-                check_origin = false;
+        packages."${system}" = {
+          zoneFiles = generate.zoneFiles dnsConfig;
+          octodns = generate.octodnsConfig {
+            inherit dnsConfig;
+            
+            config = {
+              providers = {
+                cloudflare = {
+                  class = "octodns_cloudflare.CloudflareProvider";
+                  token = "env/CLOUDFLARE_TOKEN";
+                };
+                config = {
+                  check_origin = false;
+                };
               };
             };
-          };
-          zones = {
-            "ret2pop.net." = nixos-dns.utils.octodns.generateZoneAttrs [ "cloudflare" ];
-            "nullring.xyz." = nixos-dns.utils.octodns.generateZoneAttrs [ "cloudflare" ];
+            zones = {
+              "${vars.remoteHost}." = nixos-dns.utils.octodns.generateZoneAttrs [ "cloudflare" ];
+              "${vars.orgHost}." = nixos-dns.utils.octodns.generateZoneAttrs [ "cloudflare" ];
+            };
           };
         };
       };
-    };
 }
diff --git a/nix/flakevars.nix b/nix/flakevars.nix
new file mode 100644 (file)
index 0000000..dd42616
--- /dev/null
@@ -0,0 +1,22 @@
+let
+  # I'm ret2pop! What's your name?
+  internetName = "ret2pop";
+in
+{
+  # Name of spontaneity box
+  remoteHost = "${internetName}.net";
+
+  # Your internet name
+  internetName = internetName;
+
+  # Name of your organization
+  orgHost = "nullring.xyz";
+
+  # Hostnames of my systems
+  hostnames = [
+    "affinity"
+    "continuity"
+    "spontaneity"
+    "installer"
+  ];
+}
index e47c7a26eaf100ca0665a4ce87711969bcc123ab..dc3ea56b141e8477d195a33373d0efa80d310b28 100644 (file)
@@ -3,10 +3,11 @@
   services.matrix-conduit = {
     enable = lib.mkDefault config.monorepo.profiles.server.enable;
     settings.global = {
-      server_name = "matrix.${config.monorepo.vars.remoteHost}";
+      server_name = "matrix.${config.monorepo.vars.orgHost}";
       trusted_servers = [
         "matrix.org"
         "nixos.org"
+        "conduit.rs"
       ];
       address = "0.0.0.0";
       port = 6167;
index 27002ff4add07d1a29ec8501e0375486c968e1f1..a2912ea9c99e488e2b0559fb47f5e8d43bca86bc 100644 (file)
@@ -2,6 +2,7 @@
 {
   imports = [
     ./matterbridge.nix
+    ./mautrix.nix
     ./xserver.nix
     ./ssh.nix
     ./pipewire.nix
@@ -20,6 +21,7 @@
     ./ngircd.nix
     ./znc.nix
     ./docker.nix
+    ./impermanence.nix
   ];
 
   documentation = {
          "kernel.kptr_restrict" = 2;
 
          # madaidan
-            "kernel.smtcontrol" = "on";
+      "kernel.smtcontrol" = "on";
          "vm.swappiness" = 1;
          "vm.unprivileged_userfaultfd" = 0;
          "dev.tty.ldisc_autoload" = 0;
index becaac879c9363f4b103411ed9742b46b6f6affd..adf54b9b8fa8b65ee593572f4b2eeef72d4a4596 100644 (file)
         ttyonly.enable = lib.mkEnableOption "TTY only, no xserver";
         grub.enable = lib.mkEnableOption "Enables grub instead of systemd-boot";
         workstation.enable = lib.mkEnableOption "Enables workstation services";
+        impermanence.enable = lib.mkEnableOption "Enables imperamanence";
            };
     };
   };
 
   config = {
-    environment.systemPackages = lib.mkIf config.monorepo.profiles.documentation.enable (with pkgs; [
+    environment.systemPackages = lib.mkIf config.monorepo.profiles.documentation.enable ((with pkgs; [
            linux-manual
            man-pages
            man-pages-posix
       iproute2
       silver-searcher
       ripgrep
-    ]);
+    ]) ++
+    (if (config.monorepo.vars.fileSystem == "btrfs") then with pkgs; [
+      btrfs-progs
+      btrfs-snap
+      btrfs-list
+      btrfs-heatmap
+    ] else []));
+
     boot.loader.grub = lib.mkIf config.monorepo.profiles.grub.enable {
       enable = true;
     };
@@ -41,6 +49,7 @@
                    pipewire.enable = lib.mkDefault true;
                    tor.enable = lib.mkDefault true;
                    home.enable = lib.mkDefault true;
+        impermanence.enable = lib.mkDefault false;
            };
     };
   };
diff --git a/nix/modules/heisenbridge.nix b/nix/modules/heisenbridge.nix
new file mode 100644 (file)
index 0000000..f3b88fc
--- /dev/null
@@ -0,0 +1,9 @@
+{ lib, config, ... }:
+{
+  services.heisenbridge = {
+    enable = true;
+    registrationUrl = "http://localhost:6167";
+    owner = "@ret2pop:matrix.nullring.xyz";
+    homeserver = "http://localhost:6167";
+  };
+}
index a5228723765c7ad7d1dc69fd6f837da3fd4336c7..f5f8d34dac7c2d08a077d49faab8221ab1063ba6 100644 (file)
@@ -36,6 +36,8 @@
            lang-openscad.enable = lib.mkEnableOption "Enables openscad language support";
            lang-js.enable = lib.mkEnableOption "Enables javascript language support";
            lang-nix.enable = lib.mkEnableOption "Enables nix language support";
+           lang-idris.enable = lib.mkEnableOption "Enables idris language support";
+           lang-agda.enable = lib.mkEnableOption "Enables agda language support";
            lang-coq.enable = lib.mkEnableOption "Enables coq language support";
       lang-lean.enable = lib.mkEnableOption "Enables lean language support";
            lang-haskell.enable = lib.mkEnableOption "Enables haskell language support";
@@ -81,6 +83,7 @@
                                                          gnumake
                                                          bear
                                                          clang-tools
+                      autotools-language-server
                                                  ]) else [])
                     ++
                     (if config.monorepo.profiles.workstation.enable then (with pkgs; [
                     (if config.monorepo.profiles.lang-lean.enable then (with pkgs; [
                       lean4
                     ]) else [])
+                                                 ++
+                                                 (if config.monorepo.profiles.lang-agda.enable then (with pkgs; [
+                      agda
+                                                 ]) else [])
+                                                 ++
+                                                 (if config.monorepo.profiles.lang-idris.enable then (with pkgs; [
+                      idris
+                      idris2Packages.idris2Lsp
+                                                 ]) else [])
                                                  ++
                                                  (if config.monorepo.profiles.lang-nix.enable then (with pkgs; [
                                                          nil
            lang-coq.enable = lib.mkDefault config.monorepo.profiles.enable;
            lang-lean.enable = lib.mkDefault config.monorepo.profiles.enable;
            lang-haskell.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-idris.enable = lib.mkDefault config.monorepo.profiles.enable;
+           lang-agda.enable = lib.mkDefault config.monorepo.profiles.enable;
 
            crypto.enable = lib.mkDefault config.monorepo.profiles.enable;
            art.enable = lib.mkDefault config.monorepo.profiles.enable;
index e44db8dfcf9ae65ff35d9fa18550626f7a4aab4c..c5bd3832e5f32012d154f32ef5b200d19580ea5f 100644 (file)
@@ -5,10 +5,14 @@
       enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
       package = pkgs.emacs-pgtk;
       extraConfig = ''
-      (setq debug-on-error t)
-      (org-babel-load-file
-        (expand-file-name "~/monorepo/config/emacs.org"))'';
+(setq debug-on-error t)
+(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"))'';
       extraPackages = epkgs: [
+        epkgs.agda2-mode
         epkgs.all-the-icons
         epkgs.auctex
         epkgs.catppuccin-theme
@@ -17,6 +21,7 @@
         epkgs.company-solidity
         epkgs.counsel
         epkgs.dashboard
+        epkgs.doom-themes
         epkgs.doom-modeline
         epkgs.elfeed
         epkgs.elfeed-org
@@ -39,6 +44,7 @@
         epkgs.gruvbox-theme
         epkgs.haskell-mode
         epkgs.htmlize
+        epkgs.idris-mode
         epkgs.irony-eldoc
         epkgs.ivy
         epkgs.ivy-pass
@@ -48,6 +54,7 @@
         epkgs.lsp-mode
         epkgs.lsp-haskell
         epkgs.lyrics-fetcher
+        epkgs.mastodon
         epkgs.magit
         epkgs.magit-delta
         epkgs.mu4e
index 819f1fa894c6dff0845f0ffa93047e6d1c78411e..dbe0b39e47150a13f78acdd2afe93fc2d2b4464c 100644 (file)
@@ -64,6 +64,7 @@
         "$mod, B, exec, bitcoin-qt"
         "$mod, M, exec, monero-wallet-gui"
         "$mod, V, exec, vesktop"
+        "$mod, C, exec, fluffychat"
         "$mod, D, exec, wofi --show run"
         "$mod, P, exec, bash ${scripts}/powermenu.sh"
         "$mod, Q, killactive"
index 67d971ab095dd9016d32c87710034f444fe709f7..b7c7424e99d456e6022baf7e4f52d835bb9c9c5b 100644 (file)
@@ -3,7 +3,7 @@
   programs.mbsync = {
     enable = lib.mkDefault config.monorepo.profiles.email.enable;
     extraConfig = ''
-      IMAPAccount ret2pop
+      IMAPAccount ${config.monorepo.vars.internetName}
       Host ${config.monorepo.profiles.email.imapsServer}
       User ${config.monorepo.profiles.email.email}
       PassCmd "cat ${config.sops.secrets.mail.path}"
       AuthMechs *
       CertificateFile /etc/ssl/certs/ca-certificates.crt
 
-      IMAPStore ret2pop-remote
-      Account ret2pop
+      IMAPStore ${config.monorepo.vars.internetName}-remote
+      Account ${config.monorepo.vars.internetName}
 
-      MaildirStore ret2pop-local
-      Path ~/email/ret2pop/
-      Inbox ~/email/ret2pop/INBOX
+      MaildirStore ${config.monorepo.vars.internetName}-local
+      Path ~/email/${config.monorepo.vars.internetName}/
+      Inbox ~/email/${config.monorepo.vars.internetName}/INBOX
       SubFolders Verbatim
 
-      Channel ret2pop 
-      Far :ret2pop-remote:
-      Near :ret2pop-local:
+      Channel ${config.monorepo.vars.internetName} 
+      Far :${config.monorepo.vars.internetName}-remote:
+      Near :${config.monorepo.vars.internetName}-local:
       Patterns *
       Create Near
       Sync All
index 4645687f0459daad90d1ef8dbe75476a25c91308..b523865ff211c263b116e91d368d5b62cfdb94ce 100644 (file)
@@ -8,7 +8,7 @@
         SSL = true;
       };
       local-matrix = {
-        Homeserver = "https://social.nullring.xyz";
+        Homeserver = "https://matrix.${config.monorepo.vars.orgHost}";
         ListenAddress = "127.0.0.1";
         ListenPort = "8008";
       };
index 24b61da245e41239bae579dba42ce7a2812a45a7..c02d9a05c2599952ef53dcdc664de4b231b8b5cf 100644 (file)
@@ -2,8 +2,8 @@
 {
   home = {
     activation.startup-files = lib.hm.dag.entryAfter [ "installPackages" ] ''
-    if [ ! -d "/home/${config.monorepo.vars.userName}/email/ret2pop/" ]; then
-      mkdir -p /home/${config.monorepo.vars.userName}/email/ret2pop/
+    if [ ! -d "/home/${config.monorepo.vars.userName}/email/${config.monorepo.vars.internetName}/" ]; then
+      mkdir -p /home/${config.monorepo.vars.userName}/email/${config.monorepo.vars.internetName}/
     fi
     if [ ! -d "/home/${config.monorepo.vars.userName}/music" ]; then
       mkdir -p /home/${config.monorepo.vars.userName}/music
@@ -41,7 +41,7 @@
 
       # Apps
       # octaveFull
-      vesktop grim swww vim telegram-desktop qwen-code
+      vesktop grim swww vim telegram-desktop qwen-code fluffychat
 
       # Sound/media
       pavucontrol alsa-utils imagemagick ffmpeg helvum
@@ -53,7 +53,7 @@
       torsocks tor-browser
 
       # fonts
-      nerd-fonts.iosevka noto-fonts noto-fonts-cjk-sans noto-fonts-emoji fira-code font-awesome_6
+      nerd-fonts.iosevka noto-fonts noto-fonts-cjk-sans noto-fonts-emoji fira-code font-awesome_6 victor-mono
       (aspellWithDicts
         (dicts: with dicts; [ en en-computers en-science ]))
 
index cb4f1b07b26e1047956546a6e54b0a4f8ddfafc1..574e6ace76e2705b00f718f11c053c1f8d9a30a6 100644 (file)
@@ -21,6 +21,7 @@
     };
 
     shellAliases = {
+      get-channel-id = "yt-dlp --print \"%(channel_id)s\" --playlist-end 1 \"$1\"";
       se = "sops edit";
       f = "vim $(fzf)";
       e = "cd $(find . -type d -print | fzf)";
@@ -30,9 +31,9 @@
       py = "python3";
       rb = "sudo nixos-rebuild switch --flake $HOME/monorepo/nix#${systemHostName}";
       nfu = "cd ~/monorepo/nix && git add . && git commit -m \"new flake lock\" &&  nix flake update";
-      usync =  "rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/ret2pop-website/";
+      usync =  "rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/${config.monorepo.vars.internetName}-website/";
       usite
-      = "cd ~/src/publish-org-roam-ui && bash local.sh && rm -rf ~/website_html/graph_view; cp -r ~/src/publish-org-roam-ui/out ~/website_html/graph_view && rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/ret2pop-website/";
+      = "cd ~/src/publish-org-roam-ui && bash local.sh && rm -rf ~/website_html/graph_view; cp -r ~/src/publish-org-roam-ui/out ~/website_html/graph_view && rsync -azvP --chmod=\"Du=rwx,Dg=rx,Do=rx,Fu=rw,Fg=r,Fo=r\" ~/website_html/ root@${config.monorepo.vars.remoteHost}:/var/www/${config.monorepo.vars.internetName}-website/";
       sai = "eval \"$(ssh-agent -s)\" && ssh-add ~/.ssh/id_ed25519 && ssh-add -l";
       i3 = "exec ${pkgs.i3-gaps}/bin/i3";
     };
diff --git a/nix/modules/honk.nix b/nix/modules/honk.nix
new file mode 100644 (file)
index 0000000..b13a9dc
--- /dev/null
@@ -0,0 +1,8 @@
+{ lib, config, ... }:
+{
+  services.honk = {
+    enable = config.monorepo.vars.ttyonly;
+    servername = "ret2pop.net";
+    username = "ret2pop";
+  };
+}
diff --git a/nix/modules/impermanence.nix b/nix/modules/impermanence.nix
new file mode 100644 (file)
index 0000000..73bccdc
--- /dev/null
@@ -0,0 +1,85 @@
+{ lib, config, ... }:
+{
+  assertions = [
+    {
+      assertion = ! (config.monorepo.profiles.impermanence.enable && (! (config.monorepo.vars.filesystem == "btrfs")));
+      message = "Impermanence requires btrfs filesystem.";
+    }
+  ];
+
+  boot.initrd.postResumeCommands = (if config.monorepo.profiles.impermanence.enable then lib.mkAfter ''
+    mkdir /btrfs_tmp
+    mount /dev/root_vg/root /btrfs_tmp
+    if [[ -e /btrfs_tmp/root ]]; then
+        mkdir -p /btrfs_tmp/old_roots
+        timestamp=$(date --date="@$(stat -c %Y /btrfs_tmp/root)" "+%Y-%m-%-d_%H:%M:%S")
+        mv /btrfs_tmp/root "/btrfs_tmp/old_roots/$timestamp"
+    fi
+
+    delete_subvolume_recursively() {
+        IFS=$'\n'
+        for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
+            delete_subvolume_recursively "/btrfs_tmp/$i"
+        done
+        btrfs subvolume delete "$1"
+    }
+
+    for i in $(find /btrfs_tmp/old_roots/ -maxdepth 1 -mtime +30); do
+        delete_subvolume_recursively "$i"
+    done
+
+    btrfs subvolume create /btrfs_tmp/root
+    umount /btrfs_tmp
+  '' else "");
+  
+  environment.persistence."/persistent" = {
+    enable = config.monorepo.profiles.impermanence.enable;
+    hideMounts = true;
+    directories = [
+      "/var/log"
+      "/var/lib/bluetooth"
+      "/var/lib/nixos"
+      "/var/lib/systemd/coredump"
+      "/etc/NetworkManager/system-connections"
+    ];
+    files = [
+      "/etc/machine-id"
+      "/etc/matterbridge.toml"
+      { file = "/var/keys/secret_file"; parentDirectory = { mode = "u=rwx,g=,o="; }; }
+    ];
+    users."${config.monorepo.vars.userName}" = {
+      directories = [
+        "Downloads"
+        "music"
+        "Pictures"
+        "Documents"
+        "Videos"
+        "Monero"
+        "org"
+        "monorepo"
+        "soundfont"
+        "website_html"
+        "ardour"
+        "audacity"
+        "img"
+        "email"
+        "projects"
+        "secrets"
+
+        ".emacs.d"
+        ".elfeed"
+        ".electrum"
+        ".mozilla"
+        ".bitmonero"
+        ".config"
+        { directory = ".gnupg"; mode = "0700"; }
+        { directory = ".ssh"; mode = "0700"; }
+        { directory = ".local/share/keyrings"; mode = "0700"; }
+        ".local/share/direnv"
+      ];
+      files = [
+        ".emacs"
+      ];
+    };
+  };
+}
index f97ba0518e6c8cbb5d491bc8bfc9a2ded9c414d1..c84b59c602cd0d845c167af7b86b9e6ccab51363 100644 (file)
@@ -3,7 +3,8 @@
   services.maddy = {
     enable = lib.mkDefault config.monorepo.profiles.server.enable;
     openFirewall = true;
-    primaryDomain = "${config.monorepo.vars.remoteHost}";
+    hostName = "${config.monorepo.vars.remoteHost}";
+    primaryDomain = "mail.${config.monorepo.vars.remoteHost}";
     tls = {
       loader = "acme";
     };
       "imap tls://0.0.0.0:993 tcp://0.0.0.0:143"
       "submission tls://0.0.0.0:465 tcp://0.0.0.0:587"
     ] options.services.maddy.config.default;
+    ensureCredentials = {
+      "${config.monorepo.vars.userName}@localhost" = {
+        passwordFile = "/secrets/${config.monorepo.vars.userName}-localhost";
+      };
+    };
   };
 }
diff --git a/nix/modules/mautrix.nix b/nix/modules/mautrix.nix
new file mode 100644 (file)
index 0000000..5eacb4a
--- /dev/null
@@ -0,0 +1,150 @@
+{ lib, config, ... }:
+{
+  services.mautrix-discord = {
+    enable = lib.mkDefault config.monorepo.profiles.server.enable;
+    environmentFile = "/etc/mautrix";
+    settings = {
+      bridge = {
+        animated_sticker = {
+          args = {
+            fps = 25;
+            height = 320;
+            width = 320;
+          };
+          target = "webp";
+        };
+        autojoin_thread_on_open = true;
+        avatar_proxy_key = "generate";
+        backfill = {
+          forward_limits = {
+            initial = {
+              channel = 0;
+              dm = 0;
+              thread = 0;
+            };
+            max_guild_members = -1;
+            missed = {
+              channel = 0;
+              dm = 0;
+              thread = 0;
+            };
+          };
+        };
+        cache_media = "unencrypted";
+        channel_name_template = "{{if or (eq .Type 3) (eq .Type 4)}}{{.Name}}{{else}}#{{.Name}}{{end}}";
+        command_prefix = "!discord";
+        custom_emoji_reactions = true;
+        delete_guild_on_leave = true;
+        delete_portal_on_channel_delete = false;
+        delivery_receipts = false;
+        direct_media = {
+          allow_proxy = true;
+          enabled = false;
+          server_key = "generate";
+        };
+        displayname_template = "{{if .Webhook}}Webhook{{else}}{{or .GlobalName .Username}}{{if .Bot}} (bot){{end}}{{end}}";
+        double_puppet_allow_discovery = true;
+        double_puppet_server_map = { };
+        embed_fields_as_tables = true;
+        enable_webhook_avatars = true;
+        encryption = {
+          allow = false;
+          allow_key_sharing = false;
+          appservice = false;
+          default = false;
+          delete_keys = {
+            delete_fully_used_on_decrypt = false;
+            delete_on_device_delete = false;
+            delete_outbound_on_ack = false;
+            delete_outdated_inbound = false;
+            delete_prev_on_new_session = false;
+            dont_store_outbound = false;
+            periodically_delete_expired = false;
+            ratchet_on_decrypt = false;
+          };
+          msc4190 = false;
+          plaintext_mentions = false;
+          require = false;
+          rotation = {
+            disable_device_change_key_rotation = false;
+            enable_custom = false;
+            messages = 100;
+            milliseconds = 604800000;
+          };
+          verification_levels = {
+            receive = "unverified";
+            send = "unverified";
+            share = "cross-signed-tofu";
+          };
+        };
+        federate_rooms = true;
+        guild_name_template = "{{.Name}}";
+        login_shared_secret_map = { };
+        management_room_text = {
+          additional_help = "";
+          welcome = "Hello, I'm a Discord bridge bot.";
+          welcome_connected = "Use `help` for help.";
+          welcome_unconnected = "Use `help` for help or `login` to log in.";
+        };
+        message_error_notices = true;
+        message_status_events = false;
+        mute_channels_on_create = false;
+        permissions = {
+          "@${config.monorepo.vars.internetName}:matrix.${config.monorepo.vars.orgHost}" = "admin";
+          "*" = "user";
+        };
+        portal_message_buffer = 128;
+        prefix_webhook_messages = true;
+        private_chat_portal_meta = "default";
+        provisioning = {
+          debug_endpoints = false;
+          prefix = "/_matrix/provision";
+          shared_secret = "generate";
+        };
+        public_address = null;
+        resend_bridge_info = false;
+        restricted_rooms = false;
+        startup_private_channel_create_limit = 5;
+        sync_direct_chat_list = false;
+        use_discord_cdn_upload = true;
+        username_template = "discord_{{.}}";
+      };
+
+      appservice = {
+        address = "http://localhost:29334";
+        hostname = "0.0.0.0";
+        port = 29334;
+        id = "discord";
+        bot = {
+          username = "discordbot";
+          displayname = "Discord bridge bot";
+          avatar = "mxc://maunium.net/nIdEykemnwdisvHbpxflpDlC";
+        };
+        ephemeral_events = true;
+        async_transactions = false;
+        database = {
+          type = "sqlite3";
+          uri = "file:${config.services.mautrix-discord.dataDir}/mautrix-discord.db?_txlock=immediate";
+          max_open_conns = 20;
+          max_idle_conns = 2;
+          max_conn_idle_time = null;
+          max_conn_lifetime = null;
+        };
+        as_token = "$MAUTRIX_DISCORD_APPSERVICE_AS_TOKEN";
+        hs_token = "$MAUTRIX_DISCORD_APPSERVICE_HS_TOKEN";
+      };
+
+      dataDir = "/var/lib/mautrix-discord";
+      homeserver = {
+        async_media = false;
+        message_send_checkpoint_endpoint = null;
+        ping_interval_seconds = 0;
+        software = "standard";
+        status_endpoint = null;
+        websocket = false;
+        domain = "matrix.${config.monorepo.vars.orgHost}";
+        address = "http://localhost:6167";
+      };
+    };
+  };
+}
index 7595520f7ac414e194a55bd7a70c4621c5edd2a7..b809fc70bac065be6dce16621105caea65321c06 100644 (file)
@@ -7,8 +7,8 @@
     hostName = "0.0.0.0";
     welcometext = "Wecome to the Null Murmur instance!";
     registerName = "nullring";
-    registerHostname = "nullring.xyz";
-    sslCert = "/var/lib/acme/nullring.xyz/fullchain.pem";
-    sslKey = "/var/lib/acme/nullring.xyz/sslKey.pem";
+    registerHostname = "${config.monorepo.vars.orgHost}";
+    sslCert = "/var/lib/acme/${config.monorepo.vars.orgHost}/fullchain.pem";
+    sslKey = "/var/lib/acme/${config.monorepo.vars.orgHost}/sslKey.pem";
   };
 }
index bb87fceb7185c8044c6076101b565bd6a1811647..9337774564924a5886ecd48b74f2b90b8262b204 100644 (file)
@@ -16,7 +16,7 @@
     };
 
     virtualHosts = {
-      "matrix.${config.monorepo.vars.remoteHost}" = {
+      "matrix.${config.monorepo.vars.orgHost}" = {
         enableACME = true;
         forceSSL = true;
         listen = [
       };
            "${config.monorepo.vars.remoteHost}" = {
         serverName = "${config.monorepo.vars.remoteHost}";
-        serverAliases = [ "ret2pop.nullring.xyz" ];
-             root = "/var/www/ret2pop-website/";
+        serverAliases = [ "${config.monorepo.vars.internetName}.${config.monorepo.vars.orgHost}" ];
+             root = "/var/www/${config.monorepo.vars.internetName}-website/";
              addSSL = true;
              enableACME = true;
            };
 
-      "nullring.xyz" = {
-        serverName = "nullring.xyz";
+      "${config.monorepo.vars.orgHost}" = {
+        serverName = "${config.monorepo.vars.orgHost}";
         root = "/var/www/nullring/";
         addSSL = true;
         enableACME = true;
index 090001703b3103e9ac842ffa7507bc9c16b332a3..c8348bfcef18ec11d50213e1d1fde115ca213b32 100644 (file)
@@ -4,7 +4,7 @@
     enable = lib.mkDefault config.monorepo.profiles.server.enable;
     config = ''
 [Global]
-       Name = nullring.xyz
+       Name = ${config.monorepo.vars.orgHost}
        Info = NullRing IRC Instance
   Listen = 0.0.0.0
   MotdFile = /etc/motd.txt
@@ -13,9 +13,9 @@
 [Options]
        PAM = no
 [SSL]
-       CertFile = /var/lib/acme/nullring.xyz/fullchain.pem
+       CertFile = /var/lib/acme/${config.monorepo.vars.orgHost}/fullchain.pem
        CipherList = HIGH:!aNULL:@STRENGTH:!SSLv3
-       KeyFile = /var/lib/acme/nullring.xyz/key.pem
+       KeyFile = /var/lib/acme/${config.monorepo.vars.orgHost}/key.pem
        Ports = 6697
 '';
   };
index 33c41c98425de083dc0d9c42fd6524e5aacdc410..bfa0cf3322004f26f04b0a56008404f60c6e5e69 100644 (file)
@@ -1,14 +1,16 @@
 { config, lib, ... }:
 {
   services.ollama = {
-    enable = lib.mkDefault (!config.monorepo.profiles.ttyonly.enable);
+    enable = lib.mkDefault (!config.monorepo.profiles.server.enable);
     acceleration = if (config.monorepo.profiles.workstation.enable) then "cuda" else null;
-    loadModels = [
+    loadModels = if (config.monorepo.profiles.workstation.enable) then [
       "qwen3:30b"
       "qwen3-coder:latest"
       "qwen2.5-coder:latest"
-      "qwen2.5-coder:3b"
       "gemma3:12b-it-qat"
+    ] else [
+      "qwen3:0.6b"
+      "qwen2.5-coder:0.5b"
     ];
     host = "0.0.0.0";
     openFirewall = true;
index de9736e28e50ccb97263d1556ed0fa8ef7af1be0..c99158871626ecf38c326d3e35bc300e9f712118 100644 (file)
@@ -1,4 +1,7 @@
 { lib, ... }:
+let
+  vars = import ../flakevars.nix;
+in
 {
   options.monorepo.vars = {
     device = lib.mkOption {
@@ -8,6 +11,20 @@
       description = "device that NixOS is installed to";
     };
 
+    internetName = lib.mkOption {
+      type = lib.types.str;
+      default = "${vars.internetName}";
+      example = "myinternetname";
+      description = "Internet name to be used for internet usernames";
+    };
+
+    repoName = lib.mkOption {
+      type = lib.types.str;
+      default = "monorepo";
+      example = "myreponame";
+      description = "Name of this repository";
+    };
+
     fileSystem = lib.mkOption {
       type = lib.types.str;
       default = "ext4";
 
     remoteHost = lib.mkOption {
       type = lib.types.str;
-      default = "ret2pop.net";
+      default = "${vars.remoteHost}";
       example = "example.com";
       description = "Address to push to and pull from for website and git repos";
     };
 
+    orgHost = lib.mkOption {
+      type = lib.types.str;
+      default = "${vars.orgHost}";
+      example = "orgname.org";
+      description = "Domain name of your organization";
+    };
+
     timeZone = lib.mkOption {
       type = lib.types.str;
       default = "America/Vancouver";
index 17f140addb087506db95abbb122fc5dd58065436..72057dd7bc654335aed224e725a1e0c10bbfeab2 100644 (file)
@@ -1,7 +1,7 @@
 { config, lib, home-manager, ... }:
 {
   imports = [
-    ../includes.nix
+    ../common.nix
     ../../disko/drive-simple.nix
   ];
   config = {
index 7b081388ce046ce975b555adcf5da52f1d8b4a3b..7c8a1190238585b585b5412e2d86ab227027a405 100644 (file)
@@ -1,7 +1,7 @@
 { lib, config, pkgs, ... }:
 {
   imports = [
-    ../../modules/home/default.nix
+    ../home-common.nix
   ];
   config.monorepo = {
     profiles.cuda.enable = true;
diff --git a/nix/systems/common.nix b/nix/systems/common.nix
new file mode 100644 (file)
index 0000000..c122b0d
--- /dev/null
@@ -0,0 +1,8 @@
+{ config, lib, ... }:
+{
+  imports = [
+    ./home.nix
+    ../modules/default.nix
+  ];
+  # Put configuration (e.g. monorepo variable configuration) common to all configs here
+}
index 5bd6517a34ce4c5e62d57c04c5038ca9b08112ed..e9efd3434ec58ed0e40118cd58f364f99377933a 100644 (file)
@@ -2,10 +2,15 @@
 {
   imports = [
     ../../disko/drive-simple.nix
-    ../includes.nix
+    ../common.nix
   ];
   config = {
-    # drive to install to
-    monorepo.vars.device = "/dev/sda";
+    monorepo = {
+      profiles.impermanence.enable = true;
+      vars = {
+        device = "/dev/sda";
+        fileSystem = "btrfs";
+      };
+    };
   };
 }
index fb4a0a7de14d304d5b0bbc4bb44c740ca5b81383..2b133a57c7717f73f7c3651cadd551e95cd22443 100644 (file)
@@ -1,7 +1,7 @@
 { lib, config, pkgs, ... }:
 {
   imports = [
-    ../../modules/home/default.nix
+    ../home-common.nix
   ];
   config.monorepo.profiles.workstation.enable = false;
 }
diff --git a/nix/systems/home-common.nix b/nix/systems/home-common.nix
new file mode 100644 (file)
index 0000000..ba0e6f2
--- /dev/null
@@ -0,0 +1,7 @@
+{ lib, config, ... }:
+{
+  imports = [
+    ../modules/home/default.nix
+  ];
+  # Put configuration (e.g. monorepo variable configuration) common to all configs here
+}
index 63c41503b7d34e9e4dba3a65a27920452eaef72c..c1252dfe7442741256e509932fece2225be6412f 100644 (file)
@@ -1,7 +1,6 @@
 { config, sops-nix, ... }:
 {
   home-manager = {
-
     sharedModules = [
       sops-nix.homeManagerModules.sops
     ];
diff --git a/nix/systems/includes.nix b/nix/systems/includes.nix
deleted file mode 100644 (file)
index 5122fb2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-{ config, lib, ... }:
-{
-  imports = [
-    ./home.nix
-    ../modules/default.nix
-  ];
-}
index 4bda0d6b314a7c72c8078e0c668f5d0434cf54c1..8fb9dfd2dea8c2ed5e2ab14909eedbf3dbc0752f 100644 (file)
@@ -50,6 +50,10 @@ if [ "$(id -u)" -eq 0 ]; then
   exit 1
 fi
 
+gum style --border normal --margin "1" --padding "1 2" "Notice: if using full disk encryption, write to /tmp/secret.key first with your password."
+
+sleep 3
+
 cd "$HOME"
 
 ping -q -c1 google.com &>/dev/null && echo "online! Proceeding with the installation..." || nmtui
@@ -102,7 +106,7 @@ EOF
   gum input --placeholder "Press Enter to continue" >/dev/null
   vim "$HOME/monorepo/nix/systems/$SYSTEM/home.nix"
 
-  sed -i "/# add hostnames here/i \  \"$1\"" "$HOME/monorepo/nix/flake.nix"
+  sed -i "/hostnames = \[/,/];/ s/];/  \"$1\"\n    ];/" "$HOME/monorepo/nix/flake.nix"
 
   if [ ! -f "$HOME/monorepo/nix/disko/$DRIVE" ]; then
     cp "$HOME/monorepo/nix/disko/drive-simple.nix" "$HOME/monorepo/nix/disko/$DRIVE"
index 3ab7a9ef67121a2b39015c805f2d0bbe5a4990d2..5f3dc361a85e98d88476c5982ef7062f2dd1efe1 100644 (file)
@@ -1,10 +1,15 @@
 { config, lib, ... }:
+let
+  ipv4addr = "66.42.84.130";
+  ipv6addr = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+in
 {
   imports = [
-    ../includes.nix
+    ../common.nix
+    ../../disko/drive-bios.nix
+
     # nixos-anywhere generates this file
     ./hardware-configuration.nix
-    ../../disko/drive-bios.nix
   ];
   config = {
     monorepo = {
     networking = {
       interfaces.ens3.ipv6.addresses = [
         {
-          address = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+          address = ipv6addr;
           prefixLength = 64;
         }
       ];
       firewall.allowedTCPPorts = [
         80
+        143
         443
         465
+        587
         993
-        8448
         6697
         6667
+        8448
       ];
       domains = {
         enable = true;
         baseDomains = {
           "${config.monorepo.vars.remoteHost}" = {
-            a.data = "66.42.84.130";
-            aaaa.data = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+            a.data = ipv4addr;
+            aaaa.data = ipv6addr;
           };
-          "nullring.xyz" = {
-            a.data = "66.42.84.130";
-            aaaa.data = "2001:19f0:5401:10d0:5400:5ff:fe4a:7794";
+          "${config.monorepo.vars.orgHost}" = {
+            a.data = ipv4addr;
+            aaaa.data = ipv6addr;
           };
         };
         subDomains = {
           "${config.monorepo.vars.remoteHost}" = {};
           "matrix.${config.monorepo.vars.remoteHost}" = {};
           "www.${config.monorepo.vars.remoteHost}" = {};
-          "mail.${config.monorepo.vars.remoteHost}" = {};
+          "mail.${config.monorepo.vars.remoteHost}" = {
+            mx.data = "10 mail.${config.monorepo.vars.remoteHost}.";
+          };
 
-          "nullring.xyz" = {};
-          "git.nullring.xyz" = {};
-          "matrix.nullring.xyz" = {};
-          "talk.nullring.xyz" = {};
-          "mail.nullring.xyz" = {};
-          "ret2pop.nullring.xyz" = {};
+          "${config.monorepo.vars.orgHost}" = {};
+          "git.${config.monorepo.vars.orgHost}" = {};
+          "matrix.${config.monorepo.vars.orgHost}" = {};
+          "talk.${config.monorepo.vars.orgHost}" = {};
+          "mail.${config.monorepo.vars.orgHost}" = {};
+          "${config.monorepo.vars.internetName}.${config.monorepo.vars.orgHost}" = {};
         };
       };
     };
index cc93b5dbc7865e18d427093091a830b341f8c13d..205ea020bf48336d6432909123eb27ac50f70d8a 100644 (file)
@@ -1,7 +1,7 @@
 { lib, config, pkgs, ... }:
 {
   imports = [
-    ../../modules/home/default.nix
+    ../home-common.nix
   ];
   config.monorepo.profiles.enable = false;
 }