diff options
Diffstat (limited to 'config')
| -rw-r--r-- | config/README.org | 2 | ||||
| -rw-r--r-- | config/elfeed.org | 2 | ||||
| -rw-r--r-- | config/emacs.org | 39 | ||||
| -rw-r--r-- | config/index.org | 3 | ||||
| -rw-r--r-- | config/nix.org | 47 | ||||
| -rw-r--r-- | config/qutebrowser.org | 1 |
6 files changed, 82 insertions, 12 deletions
diff --git a/config/README.org b/config/README.org index c317bf9..ecdf42f 100644 --- a/config/README.org +++ b/config/README.org @@ -2,7 +2,7 @@ #+author: Preston Pan #+date: <2023-06-11 Sun> #+language: en -#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" /> + #+OPTIONS: broken-links:t * My Literate Configs diff --git a/config/elfeed.org b/config/elfeed.org index c114294..a6ef555 100644 --- a/config/elfeed.org +++ b/config/elfeed.org @@ -2,7 +2,7 @@ #+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 diff --git a/config/emacs.org b/config/emacs.org index 0705af9..2d87907 100644 --- a/config/emacs.org +++ b/config/emacs.org @@ -1,7 +1,7 @@ #+title: Emacs Configuration #+author: Preston Pan #+description: my personal emacs configuration for NixOS -#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" /> + * Introduction This is my Vanilla Emacs configuration, made to work with my NixOS configuration. For that reason, you will not see :ensure t inside any use-package declaration, for emacs packages @@ -164,6 +164,22 @@ This is my org mode configuration, which also configures latex. (org-pretty-entities t "prettify org mode") (org-agenda-files (list "~/monorepo/agenda.org" "~/org/notes.org" "~/org/agenda.org") "set default org files") (org-default-notes-file (concat org-directory "/notes.org") "Notes file") + (org-html-with-latex 'html) + (org-html-mathjax-options nil) + (org-html-mathjax-template "") + (org-html-head-include-default-style nil) ; Clear Org's default CSS + (org-html-head-include-scripts nil) ; Clear Org's default JS + (org-html-divs '((preamble "header" "preamble") + (content "main" "content") + (postamble "footer" "postamble"))) + (org-html-head-extra (concat "<meta name=\"theme-color\" content=\"#ffffff\">\n<link rel=\"preload\" href=\"/fonts/Inconsolata-Medium.woff2\" as=\"font\" type=\"font/woff2\" crossorigin>\n<meta name=\"theme-color\" content=\"#ffffff\">\n<link rel=\"preload\" href=\"/fonts/Lora-Medium.woff2\" as=\"font\" type=\"font/woff2\" crossorigin>\n<link rel=\"preload\" href=\"/fonts/CormorantGaramond-Bold.woff2\" as=\"font\" type=\"font/woff2\" crossorigin>\n<link rel=\"preload\" href=\"/fonts/CormorantGaramond-Medium.woff2\" as=\"font\" type=\"font/woff2\" crossorigin>\n<link rel=\"manifest\" href=\"/site.webmanifest\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/favicon-16x16.png\">\n<link rel=\"mask-icon\" href=\"/safari-pinned-tab.svg\" color=\"#5bbad5\">\n<link rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/favicon-32x32.png\">\n<link rel=\"apple-touch-icon\" sizes=\"180x180\" href=\"/apple-touch-icon.png\"><meta name=\"msapplication-TileColor\" content=\"#da532c\">\n" + "<style>\n" + (with-temp-buffer (insert-file-contents "~/monorepo/style.css") (buffer-string)) + "\n" + (with-temp-buffer (insert-file-contents "~/monorepo/syntax.css") (buffer-string)) + "\n</style>")) + (org-latex-to-html-convert-command + "printf '%%s' %i | pandoc -f latex -t html --mathml | tr -d '\\n' | sed -e 's/^<p>//' -e 's/<\\/p>$//'") (org-html-viewport '((width "device-width") (initial-scale "1.0") (minimum-scale "1.0")) "Prevent zooming out past default size") @@ -182,7 +198,7 @@ This is my org mode configuration, which also configures latex. :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\\|txt" + :base-extension "css\\|js\\|png\\|jpg\\|gif\\|pdf\\|mp3\\|ogg\\|swf\\|ico\\|asc\\|pub\\|webmanifest\\|xml\\|svg\\|txt\\|webp" :publishing-directory "~/website_html/" :recursive t :publishing-function org-publish-attachment) @@ -192,6 +208,21 @@ This is my org mode configuration, which also configures latex. (require 'ox-publish) (require 'org-tempo) (require 'org-habit) + (require 'ob-latex) + + (defun my-org-html-latex-environment-pandoc-fix (orig-fun latex-environment contents info) + "Force `ox-html' to use the convert command for LaTeX environments when set to 'html." + (let ((processing-type (plist-get info :with-latex))) + (if (eq processing-type 'html) + (let* ((latex-frag (org-remove-indentation + (org-element-property :value latex-environment))) + (converted (org-format-latex-as-html latex-frag))) + (format "<div class=\"equation-container\">\n<span class=\"equation\">\n%s\n</span>\n</div>" + converted)) + (funcall orig-fun latex-environment contents info)))) + + (advice-add 'org-html-latex-environment :around #'my-org-html-latex-environment-pandoc-fix) + (org-babel-do-load-languages 'org-babel-load-languages '((shell . t) (python . t) @@ -332,7 +363,7 @@ I use org-journal to journal about my life, and it's a part of my website: "Custom function to create journal header." (concat (pcase org-journal-file-type - (`daily "#+TITLE: Daily Journal\n#+STARTUP: showeverything\n#+DESCRIPTION: My daily journal entry\n#+AUTHOR: Preston Pan\n#+HTML_HEAD: <link rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" />\n#+html_head: <script src=\"https://polyfill.io/v3/polyfill.min.js?features=es6\"></script>\n#+html_head: <script id=\"MathJax-script\" async src=\"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js\"></script>\n#+options: broken-links:t") + (`daily "#+TITLE: Daily Journal\n#+STARTUP: showeverything\n#+DESCRIPTION: My daily journal entry\n#+AUTHOR: Preston Pan\n#+options: broken-links:t") (`weekly "#+TITLE: Weekly Journal\n#+STARTUP: folded") (`monthly "#+TITLE: Monthly Journal\n#+STARTUP: folded") (`yearly "#+TITLE: Yearly Journal\n#+STARTUP: folded")))) @@ -745,7 +776,7 @@ For all my mathematics and programming notes: (org-roam-directory (file-truename "~/monorepo/mindmap") "Set org-roam directory inside monorepo") (org-roam-capture-templates '(("d" "default" plain "%?" :target (file+head "${title}.org" - "#+title: ${title}\n#+author: Preston Pan\n#+html_head: <link rel=\"stylesheet\" type=\"text/css\" href=\"../style.css\" />\n#+html_head: <script src=\"https://polyfill.io/v3/polyfill.min.js?features=es6\"></script>\n#+html_head: <script id=\"MathJax-script\" async src=\"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js\"></script>\n#+options: broken-links:t") + "#+title: ${title}\n#+author: Preston Pan\n#+description:\n#+options: broken-links:t") :unnarrowed t)) "org-roam files start with this snippet by default") :config (org-roam-db-autosync-mode) diff --git a/config/index.org b/config/index.org index 17fd3f2..138c940 100644 --- a/config/index.org +++ b/config/index.org @@ -2,8 +2,9 @@ #+title: Configurations #+author: Preston Pan #+date: <2023-06-10 Sat> +#+description: My configurations for my computer programs. #+language: en -#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" /> + #+OPTIONS: broken-links:t * What is this magic? They're configurations for extremely obscure programs I use. Yeah, I know, I'm somewhat of a hipster myself. diff --git a/config/nix.org b/config/nix.org index 996d35c..a32c14d 100644 --- a/config/nix.org +++ b/config/nix.org @@ -1,7 +1,6 @@ #+title: NixOS Configuration #+AUTHOR: Preston Pan #+DESCRIPTION: My NixOS system, written entirely in a literate configuration -#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" /> * Introduction This is my NixOS configuration. It is a part of my monorepo, and this file automatically tangles @@ -389,6 +388,12 @@ you own: key_groups: - age: - *vps + + - path_regex: secrets/common_secrets.yaml$ + key_groups: + - age: + - *primary + - *vps #+end_src also note that you will have to write your own secrets.yaml file, with an entry called ~mail~, which is used for the imaps and smtps password. @@ -579,6 +584,13 @@ largely self-documenting. description = "Linux timezone"; }; + ntfySecret = lib.mkOption { + type = lib.types.str; + default = "ntfy"; + example = "ntfy-env"; + description = "Name of Ntfy secret for notification handling"; + }; + monitors = lib.mkOption { type = lib.types.listOf lib.types.str; default = [ @@ -703,6 +715,7 @@ to relevant places. content = (builtins.concatStringsSep "\n" (builtins.map (x: "machine mail.${config.monorepo.vars.orgHost} login ${x}@${config.monorepo.vars.orgHost} password ${config.sops.placeholder."mail_monorepo_password_pi"}") config.monorepo.vars.projects)) + '' machine mail.${config.monorepo.vars.orgHost} login discussion@${config.monorepo.vars.orgHost} password ${config.sops.placeholder."mail_monorepo_password_pi"}''; }; + "matterbridge" = { owner = "matterbridge"; content = '' @@ -767,15 +780,19 @@ to relevant places. znc = { format = "yaml"; }; + znc_password_salt = { format = "yaml"; }; + znc_password_hash = { format = "yaml"; }; + matrix_bridge = { format = "yaml"; }; + mail_password = { format = "yaml"; owner = "maddy"; @@ -789,12 +806,15 @@ to relevant places. mautrix_env = { format = "yaml"; }; + telegram_token = { format = "yaml"; }; + discord_token = { format = "yaml"; }; + mpd_password = { format = "yaml"; owner = "nginx"; @@ -1580,12 +1600,13 @@ I want to have notifications on my phone, and run my own server to do this. let serverName = "ntfy.${config.monorepo.vars.remoteHost}"; port = 2586; - ntfySecret = "ntfy"; + ntfySecret = config.monorepo.vars.ntfySecret; in { sops.secrets."${ntfySecret}" = lib.mkIf config.services.ntfy-sh.enable { format = "yaml"; owner = "ntfy-sh"; + sopsFile = ../secrets/common_secrets.yaml; }; services.ntfy-sh = { @@ -1668,6 +1689,7 @@ to the outside world under a domain. user = "nginx"; recommendedGzipSettings = true; recommendedOptimisation = true; + recommendedBrotliSettings = true; recommendedTlsSettings = true; recommendedProxySettings = false; virtualHosts = { @@ -1677,6 +1699,18 @@ to the outside world under a domain. root = "${monorepoSelf.packages.${pkgs.system}.website}"; addSSL = true; enableACME = true; + locations."/" = { + extraConfig = '' + add_header Cache-Control "no-cache, must-revalidate"; + expires off; + ''; + }; + locations."~* \\.(?:woff2|ttf|otf|eot|woff|ico|css|js|gif|jpe?g|png|svg|mp3|mp4|iso|webmanifest)$" = { + extraConfig = '' + add_header Cache-Control "public, max-age=31536000, immutable"; + access_log off; + ''; + }; }; # the port comes from ssh tunnelling @@ -3238,6 +3272,12 @@ These are some secrets that I use regularly for my programs in home. format = "yaml"; path = "${config.sops.defaultSymlinkPath}/dn42"; }; + + ntfy = { + format = "yaml"; + path = "${config.sops.defaultSymlinkPath}/${super.monorepo.vars.ntfySecret}"; + sopsFile = ../../secrets/common_secrets.yaml; + }; } else { }; defaultSymlinkPath = "/run/user/1000/secrets"; @@ -3371,6 +3411,7 @@ I want to separate out these packages so that my parent flake which builds my we epkgs.mu4e epkgs.minuet epkgs.nix-mode + epkgs.org-contrib epkgs.org-fragtog epkgs.org-journal epkgs.org-roam @@ -4886,8 +4927,6 @@ This contains the installation script I use to install my systems. }; }; - users.extraUsers.root.password = "nixos"; - users.extraUsers.nixos.password = "nixos"; users.users = { root.openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICts6+MQiMwpA+DfFQxjIN214Jn0pCw/2BDvOzPhR/H2 preston@continuity-dell" diff --git a/config/qutebrowser.org b/config/qutebrowser.org index 1deb37a..b243a3e 100644 --- a/config/qutebrowser.org +++ b/config/qutebrowser.org @@ -3,7 +3,6 @@ #+date: <2023-06-09 Fri> #+description: a catppuccin configuration for qutebrowser. #+auto_tangle: t -#+html_head: <link rel="stylesheet" type="text/css" href="../style.css" /> * Configuration ** Imports |
