From 2e4742b9289bd3f84af8474ca33f497a20122f36 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sun, 10 May 2026 23:21:04 -0700 Subject: first test? --- config/nix.org | 132 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 126 insertions(+), 6 deletions(-) (limited to 'config') 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&q={}"; w = "https://en.wikipedia.org/wiki/Special:Search?search={}&go=Go&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 -- cgit v1.3 From 5315bcdf371a4310018fb9599f7d78f93f9aedcb Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Mon, 11 May 2026 11:19:18 -0700 Subject: final --- config/emacs.org | 7 ++- flake.lock | 173 +++++++++++++++++++++++++++---------------------------- nix | 2 +- style.scss | 69 +++++++++++++++++----- 4 files changed, 146 insertions(+), 105 deletions(-) (limited to 'config') 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/^

//' -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/^

//' -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/^

//' -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/^

//' -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 "


%s%s
" - :html-head ,(concat "\n\n\n\n\n\n\n\n\n\n\n" + :html-head ,(concat "\n\n\n\n\n\n\n\n\n" "