summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/emacs.org7
-rw-r--r--config/nix.org132
2 files changed, 130 insertions, 9 deletions
diff --git a/config/emacs.org b/config/emacs.org
index 2970ca3..e5baafc 100644
--- a/config/emacs.org
+++ b/config/emacs.org
@@ -490,8 +490,9 @@ This is my org mode configuration, which also configures latex.
")
(org-preview-latex-image-directory (expand-file-name "~/.cache/ltximg/") "don't use weird cache location")
(org-latex-preview-ltxpng-directory (expand-file-name "~/.cache/ltximg/") "don't use weird cache location")
- (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>$//'" "latex to MathML with special character handling")
- (org-latex-to-mathml-convert-command "printf '%%s' %i | pandoc -f latex -t html --mathml | tr -d '\\n' | sed -e 's/^<p>//' -e 's/<\\/p>$//'" "latex to MathML with special character handling")
+
+ (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>$//' -e 's/ style=\"[^\"]*\"//g'" "latex to MathML with special character handling")
+ (org-latex-to-mathml-convert-command "printf '%%s' %i | pandoc -f latex -t html --mathml | tr -d '\\n' | sed -e 's/^<p>//' -e 's/<\\/p>$//' -e 's/ style=\"[^\"]*\"//g'" "latex to MathML with special character handling")
(TeX-engine 'xetex "set xelatex as default engine")
(preview-default-option-list '("displaymath" "textmath" "graphics") "preview latex")
@@ -622,7 +623,7 @@ This is my org mode configuration, which also configures latex.
:publishing-function org-html-publish-to-html
:headline-levels 4
:html-footnotes-section "<div id=\"footnotes\"><hr><div id=\"text-footnotes\"><span class=\"footnotes-label-hidden\">%s</span>%s</div></div>"
- :html-head ,(concat "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS Feed\" href=\"/blog/rss.xml\"><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"
+ :html-head ,(concat "<link rel=\"alternate\" type=\"application/rss+xml\" title=\"RSS Feed\" href=\"/blog/rss.xml\"><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>"
(->> (create-htmlize-css)
(s-replace-regexp "<style[^>]*>" "")
diff --git a/config/nix.org b/config/nix.org
index 83f06dc..caabe50 100644
--- a/config/nix.org
+++ b/config/nix.org
@@ -2454,6 +2454,105 @@ We must put Nixpkgs in another configuration because we don't want to include it
};
}
#+end_src
+** AutoUpdater
+#+begin_src nix :tangle ../nix/modules/auto-update.nix
+{ config, pkgs, lib, ... }:
+
+{
+ config = lib.mkIf config.monorepo.profiles.workstation.enable {
+ systemd.timers.monorepo-flake-updater = {
+ description = "Timer for Automated Monorepo Flake Updates";
+ wantedBy = [ "timers.target" ];
+ timerConfig = {
+ OnCalendar = "hourly";
+ Persistent = true;
+ };
+ };
+
+ systemd.services.monorepo-flake-updater = {
+ description = "Automated Flake Update, Check, and Patch for Monorepo";
+ wants = [ "network-online.target" ];
+ after = [ "network-online.target" ];
+
+ serviceConfig = {
+ Type = "oneshot";
+ User = "${config.monorepo.vars.userName}";
+ };
+ environment = {
+ HOME = "/home/${config.monorepo.vars.userName}";
+ };
+
+ path = with pkgs; [ git nix coreutils curl ];
+ script = ''
+ # Exit immediately if any command fails
+ set -euo pipefail
+
+ API_URL="https://channels.nixos.org/nixos-unstable/git-revision"
+ if ! curl --silent --head --location --fail "$API_URL" > /dev/null; then
+ echo "No internet or NixOS API is down. Aborting."
+ exit 0
+ fi
+
+ LATEST_REV=$(curl --silent --location "$API_URL")
+ STATE_FILE="$HOME/.local/state/monorepo-updater-rev"
+
+ mkdir -p "$(dirname "$STATE_FILE")"
+
+ if [ ! -f "$STATE_FILE" ]; then
+ echo "First run. Initializing baseline hash ($LATEST_REV) and exiting."
+ echo "$LATEST_REV" > "$STATE_FILE"
+ exit 0
+ fi
+
+ if [ "$(cat "$STATE_FILE")" = "$LATEST_REV" ]; then
+ echo "Channel has not bumped since last check ($LATEST_REV). Aborting."
+ exit 0
+ fi
+
+ echo "$LATEST_REV" > "$STATE_FILE"
+
+ TEMP_DIR=$(mktemp -d)
+ trap 'rm -rf "$TEMP_DIR"' EXIT
+ cd "$TEMP_DIR"
+
+ echo "Cloning repository..."
+ git clone git://git.nullring.xyz/monorepo.git --recurse-submodules
+
+ cd monorepo/nix
+
+ # Create and checkout [date]-bump branch INSIDE the submodule
+ DATE=$(date +%Y-%m-%d)
+ BRANCH_NAME="''${DATE}-bump"
+ git checkout -b "$BRANCH_NAME"
+
+ echo "Running nix flake update..."
+ nix flake update --extra-experimental-features "nix-command flakes"
+
+ # If the channel bumped, but flake update didn't change flake.lock, exit
+ if git diff --quiet flake.lock; then
+ echo "No actual updates to flake.lock. Aborting."
+ exit 0
+ fi
+
+ nix flake check --extra-experimental-features "nix-command flakes"
+
+ git config user.name "NixOS Updater"
+ git config user.email "updater@localhost"
+ git add flake.lock
+ git commit -m "chore: automated flake update ''${DATE}"
+
+ PATCH_DIR="$HOME/monorepo/nix"
+ mkdir -p "$PATCH_DIR"
+ PATCH_FILE="$PATCH_DIR/0000-flake-update-''${DATE}.patch"
+
+ git format-patch -1 HEAD --stdout > "$PATCH_FILE"
+ echo "Successfully checked updates and created patch at $PATCH_FILE"
+'';
+ };
+ };
+}
+#+end_src
+
** Main Configuration
This is the backbone of the all the NixOS configurations, with all these options being shared
because they enhance security.
@@ -3494,19 +3593,41 @@ be straightforward.
*** QuteBrowser
#+begin_src nix :tangle ../nix/modules/home/qutebrowser.nix
-{ lib, config, catppuccin-qutebrowser, ... }:
+{ pkgs, lib, config, catppuccin-qutebrowser, ... }:
{
programs.qutebrowser = {
enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
+ package = pkgs.qutebrowser.overrideAttrs (old: {
+ qtWrapperArgs = (old.qtWrapperArgs or []) ++ [
+ "--set" "__EGL_VENDOR_LIBRARY_FILENAMES" "/run/opengl-driver/share/glvnd/egl_vendor.d/10_nvidia.json"
+ "--set" "GBM_BACKEND" "nvidia-drm"
+ "--set" "__GLX_VENDOR_LIBRARY_NAME" "nvidia"
+ "--set" "QT_QPA_PLATFORM" "wayland"
+ ];
+ });
+
enableDefaultBindings = true;
searchEngines = {
+ DEFAULT = "https://search.marginalia.nu/search?query={}";
g = "https://www.google.com/search?hl=en&amp;q={}";
w = "https://en.wikipedia.org/wiki/Special:Search?search={}&amp;go=Go&amp;ns0=1";
aw = "https://wiki.archlinux.org/?search={}";
nw = "https://wiki.nixos.org/index.php?search={}";
npk = "https://search.nixos.org/packages?channel=unstable&query={}";
};
+
settings = {
+ # This is the magic combination for Qtile + Wayland + Qutebrowser
+ qt.args = [
+ "enable-features=UseOzonePlatform"
+ "disable-gpu"
+ "disable-software-rasterizer"
+ "disable-gpu-sandbox"
+ ];
+
+ # Force Qt to draw the UI in software mode so it doesn't look for OpenGL
+ qt.force_software_rendering = "qt-quick";
+
content.blocking.method = "both";
fonts.default_family = "Lora";
fonts.default_size = "12pt";
@@ -3523,10 +3644,8 @@ be straightforward.
# Hints
fonts.hints = "bold 12pt Lora";
-
- # Rendering
- qt.force_software_rendering = "chromium";
};
+
extraConfig = (builtins.readFile "${catppuccin-qutebrowser}/setup.py") +
''
config.load_autoconfig()
@@ -4220,7 +4339,7 @@ for these configurations.
homeDirectory = "/home/${super.monorepo.vars.userName}";
stateVersion = "24.11";
sessionVariables = {
- QTWEBENGINE_FORCE_USE_GBM = 0;
+ QT_QPA_PLATFORM = "wayland;xcb";
NIXOS_OZONE_WL = 1;
XDG_SESSION_TYPE = "wayland";
XDG_CURRENT_DESKTOP = "qtile";
@@ -4233,6 +4352,7 @@ for these configurations.
unzip
mupdf
zathura
+ qt6.qtwayland
fzf
# passwords
@@ -4246,7 +4366,7 @@ for these configurations.
# Apps
# octaveFull
- grim swww vim element-desktop signal-desktop signal-cli imv slurp wl-clipboard
+ grim awww vim element-desktop signal-desktop signal-cli imv slurp wl-clipboard
# Sound/media
pavucontrol alsa-utils imagemagick ffmpeg pulseaudio