Compare commits

...
17 Commits
Author SHA1 Message Date
Alexander Heldt ef585c9cf3 pinwheel: Make tmux pane borders visible
The borders used the terminal background color since the switch to
the grayscale palette, which hid them against the panes. Draw them in
the dim gray used for inactive window names instead.
2026-11-03 14:27:56 +01:00
Alexander Heldt fe49c4957e Update dagbok flake input 2026-11-03 14:22:55 +01:00
Alexander Heldt 44afaf3936 pinwheel: Restore claude and emacs panes with tmux-resurrect 2026-11-03 14:22:55 +01:00
Alexander Heldt 65c16f2ea6 pinwheel: Increase foot font size to 17 2026-11-03 14:21:39 +01:00
Alexander Heldt ee0cb23acc pinwheel: Save and restore tmux sessions with resurrect and continuum 2026-11-03 13:46:56 +01:00
Alexander Heldt 64640e98aa pinwheel: Fix intermittent webcam failure from IPU6 isys oops
On 7.3 the in-tree IPU6 isys driver can be runtime-suspended while
isys_probe() is still running, before it has set drvdata. The suspend
callback then dereferences a NULL isys, oopses, and psys never probes,
so /dev/ipu-psys0 is missing and the camera HAL fails with "Failed to
open PSYS".

Patch the isys runtime PM callbacks to return early when drvdata is
not set yet. The patched module is built on its own from the kernel
source and installed under updates/, so it overrides the in-tree one
without having to rebuild the whole kernel.
2026-11-03 13:46:56 +01:00
Alexander Heldt 4dfce548bf pinwheel: Make claude settings writable with nix as defaults 2026-11-03 12:05:53 +01:00
Alexander Heldt 04f277014e pinwheel: Rename Emacs theme to sodium 2026-11-03 10:18:40 +01:00
Alexander Heldt 001f201221 pinwheel: Match tig colors to theme and show added lines in green 2026-11-03 10:05:27 +01:00
Alexander Heldt f1af14766b Update ct flake input 2026-11-03 09:50:15 +01:00
Alexander Heldt d8df987268 pinwheel: Show green as a muted green in terminals 2026-11-03 09:48:52 +01:00
Alexander Heldt 8d0f2bbf52 pinwheel: Brighten terminal background and soften text color 2026-11-03 09:28:12 +01:00
Alexander Heldt 20118ad828 pinwheel: Use amber instead of red for decorative Emacs faces 2026-11-03 09:28:12 +01:00
Alexander Heldt 4a1f524864 pinwheel: Replace purple color scheme with grayscale and amber
Terminals, tmux and Emacs share a grayscale palette with amber
accents instead of Dracula, and the desktop bars and menus use a
matching gray background.
2026-11-03 09:28:12 +01:00
Alexander Heldt 79df296690 pinwheel: Tint work Firefox toolbars instead of outlining the window 2026-11-03 09:28:12 +01:00
Alexander Heldt e88cc48bf0 pinwheel: Outline work Firefox window instead of tab tops 2026-11-03 09:28:12 +01:00
Alexander Heldt 91d0d8d34b pinwheel: Restore rounded corners on Firefox tabs 2026-11-03 09:28:12 +01:00
14 changed files with 453 additions and 43 deletions

No files matched your search

Generated
+8 -8
View File
@@ -60,11 +60,11 @@
]
},
"locked": {
"lastModified": 1793616777,
"narHash": "sha256-JBTAOCuZc2t0NJMB035KkXAsHYiFlB31LZHOJXYkqWY=",
"lastModified": 1793694413,
"narHash": "sha256-/mHKKtMAVEC7266BBWQCubKvbe1u9tUqQ7S9zklrrgI=",
"ref": "main",
"rev": "6f21c78edc02918e6144e35bdc4b1f13131be50b",
"revCount": 20,
"rev": "05088c29c42280e4e99a70439e5b0121fbc40d52",
"revCount": 21,
"type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/ct.git"
},
@@ -81,11 +81,11 @@
]
},
"locked": {
"lastModified": 1793693555,
"narHash": "sha256-4oPW++ch1fk9sWMdQKsPjUPOEQJiSoy2XnIfcgcUdjE=",
"lastModified": 1793710954,
"narHash": "sha256-l4gvGPFNhWnhHhh+jNwhPm6XLGpH4+Hxbh7XspfTBwU=",
"ref": "main",
"rev": "c748aeff3755063b2fda1047c3b2dda53132144f",
"revCount": 28,
"rev": "196941c5fc0431ed64fb02d2f02b4e4d4a649881",
"revCount": 29,
"type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/dagbok.git"
},
+24 -2
View File
@@ -34,6 +34,16 @@ let
pr = "";
};
hooks = {
SessionStart = [
{
hooks = [
{
type = "command";
command = "tmux-panes claude-session";
}
];
}
];
PostToolUse = [
{
matcher = "Write|Edit";
@@ -47,6 +57,8 @@ let
];
};
};
settingsFile = pkgs.writeText "claude-settings.json" settings;
in
{
options = {
@@ -68,8 +80,18 @@ in
pclaude = "CLAUDE_CONFIG_DIR=$HOME/.claude-personal command claude";
};
home.file.".claude-work/settings.json".text = settings;
home.file.".claude-personal/settings.json".text = settings;
home.activation.claudeSettings = {
after = [ "linkGeneration" ];
before = [ ];
data = ''
for f in "$HOME"/.claude-{work,personal}/settings.json; do
current="$(cat "$f" 2>/dev/null || echo '{}')"
run mkdir -p "$(dirname "$f")"
run rm -f "$f"
echo "$current" | ${pkgs.jq}/bin/jq -s '.[0] * .[1]' ${settingsFile} - | run tee "$f" > /dev/null
done
'';
};
programs.ct = {
enable = true;
+37 -4
View File
@@ -1,12 +1,45 @@
let
bar = "2c2c2c";
in
{
lib = {
colors = {
foreground = "bd93f9";
foreground-dim = "644294";
background = "1E1E2F";
foreground = "ffb347";
foreground-dim = "8a5a20";
background = bar;
gray = "3a3a3a";
warning = "ff6969";
warning = "e0473c";
terminal = {
foreground = "e2e2e2";
background = "222222";
cursor = "b8843a";
selection = "4a3820";
status = bar;
regular = [
"181818" # black
"e0473c" # red
"7fb35a" # green
"b8904a" # yellow
"8a8a8a" # blue
"a05048" # magenta
"9e9e9e" # cyan
"e2e2e2" # white
];
bright = [
"5a5a5a" # black
"ff5f52" # red
"9fd078" # green
"d8b070" # yellow
"aaaaaa" # blue
"c06058" # magenta
"bebebe" # cyan
"fafafa" # white
];
};
};
};
}
+36 -1
View File
@@ -159,7 +159,7 @@
** Theme
#+BEGIN_SRC emacs-lisp
(use-package doom-themes
:init (load-theme 'doom-dracula t))
:config (load-theme 'sodium t))
#+END_SRC
** Disable the menu bar
#+BEGIN_SRC emacs-lisp
@@ -332,6 +332,41 @@ https://github.com/justbur/emacs-which-key
(setq history-length 25)
(savehist-mode 1)
#+END_SRC
** Remember open buffers per tmux pane
Used by `tmux-panes` to reopen buffers when tmux-resurrect restores a pane
#+BEGIN_SRC emacs-lisp
(defun tmux-panes--state-file ()
(when-let* ((pane (getenv "TMUX_PANE")))
(expand-file-name (concat "tmux-panes/" (substring pane 1) "/emacs")
(or (getenv "XDG_STATE_HOME") "~/.local/state"))))
(defun tmux-panes-save-buffers ()
(when-let* ((file (tmux-panes--state-file)))
(make-directory (file-name-directory file) t)
(let ((buffers (delq nil (mapcar (lambda (buffer)
(when-let* ((name (buffer-file-name buffer)))
(cons name (with-current-buffer buffer (point)))))
(buffer-list)))))
(with-temp-file file
(prin1 buffers (current-buffer))))))
(defun tmux-panes-restore-buffers ()
(when-let* ((file (getenv "TMUX_PANES_RESTORE")))
(setenv "TMUX_PANES_RESTORE" nil)
(when (file-readable-p file)
(let ((buffers (with-temp-buffer
(insert-file-contents file)
(read (current-buffer)))))
(dolist (entry (reverse buffers))
(when (file-exists-p (car entry))
(find-file (car entry))
(goto-char (cdr entry)))))
(delete-file file)))
(tmux-panes-save-buffers))
(add-hook 'emacs-startup-hook #'tmux-panes-restore-buffers)
(run-with-idle-timer 30 t #'tmux-panes-save-buffers)
#+END_SRC
** Vertico
#+BEGIN_SRC emacs-lisp
(use-package vertico
+3 -1
View File
@@ -18,7 +18,7 @@ let
};
e = pkgs.writeShellScriptBin "e" ''
${emacs}/bin/emacs -nw $@
exec ${emacs}/bin/emacs -nw "$@"
'';
ec = pkgs.writeShellScriptBin "ec" ''
@@ -35,6 +35,8 @@ in
TIG_EDITOR = "${e}/bin/e $@";
};
home.file.".emacs.d/sodium-theme.el".source = ./sodium-theme.el;
home.packages = [
e
ec
@@ -0,0 +1,79 @@
;;; sodium-theme.el --- Grayscale with amber accents, like sodium streetlights at night -*- lexical-binding: t; no-byte-compile: t; -*-
(require 'doom-themes)
(def-doom-theme sodium
"Grayscale with amber accents, like sodium streetlights at night."
((bg '("#222222" nil nil))
(bg-alt '("#181818" nil nil))
(base0 '("#121212" nil nil))
(base1 '("#181818" nil nil))
(base2 '("#242424" nil nil))
(base3 '("#2c2c2c" nil nil))
(base4 '("#404040" nil nil))
(base5 '("#626262" nil nil))
(base6 '("#858585" nil nil))
(base7 '("#a0a0a0" nil nil))
(base8 '("#f4f4f4" nil nil))
(fg '("#e2e2e2" nil nil))
(fg-alt '("#9a9a9a" nil nil))
(grey base5)
(red '("#e0473c" nil nil))
(orange '("#ffb347" nil nil))
(green '("#f4f4f4" nil nil))
(teal '("#aaaaaa" nil nil))
(yellow '("#ffb347" nil nil))
(blue '("#aaaaaa" nil nil))
(dark-blue '("#7a7a7a" nil nil))
(magenta '("#ffb347" nil nil))
(violet '("#9a9a9a" nil nil))
(cyan '("#bebebe" nil nil))
(dark-cyan '("#8a8a8a" nil nil))
(added '("#7fb35a" nil nil))
(highlight orange)
(vertical-bar base3)
(selection base3)
(builtin fg)
(comments base5)
(doc-comments base6)
(constants yellow)
(functions base8)
(keywords orange)
(methods base8)
(operators fg-alt)
(type fg)
(strings base7)
(variables fg)
(numbers yellow)
(region '("#4a3820" nil nil))
(error red)
(warning red)
(success green)
(vc-modified base6)
(vc-added added)
(vc-deleted red)
(modeline-fg fg)
(modeline-fg-alt base6)
(modeline-bg base2)
(modeline-bg-alt bg-alt)
(modeline-bg-inactive bg-alt)
(modeline-bg-inactive-l bg-alt))
(((custom-group-subtitle &override) :foreground orange)
((diff-added &override) :foreground added)
((diff-indicator-added &override) :foreground added)
((magit-diff-added &override) :foreground added)
((magit-diff-added-highlight &override) :foreground added)
((magit-diffstat-added &override) :foreground added)
((hl-todo &override) :foreground orange)
((magit-blame-date &override) :foreground orange)
((markdown-list-face &override) :foreground orange)
((markdown-metadata-key-face &override) :foreground orange)
((org-journal-calendar-scheduled-face &override) :foreground orange)
((org-priority &override) :foreground orange)
((paren-face-match &override) :foreground orange)
((widget-button-pressed &override) :foreground orange)))
;;; sodium-theme.el ends here
+9 -13
View File
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ pkgs, config, ... }:
let
wrapped = pkgs.wrapFirefox pkgs.firefox-devedition-unwrapped {
extraPolicies = {
@@ -66,14 +66,7 @@ let
"network.dns.force_waiting_https_rr" = false;
"browser.smartwindow.enabled" = false;
"browser.smartwindow.isDefaultWindow" = false;
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
};
sharedUserChrome = ''
:root {
--tab-border-radius: 0 !important;
}
'';
in
{
home-manager.users.alex = {
@@ -95,8 +88,6 @@ in
isDefault = true;
settings = sharedSettings // { };
userChrome = sharedUserChrome;
};
work = {
@@ -104,12 +95,17 @@ in
name = "work";
settings = sharedSettings // {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"network.lna.skip-domains" = "music-admin-staging.soundtr.ac,api-internal.apps-us.platform.staging.internal.syb.sh";
};
userChrome = sharedUserChrome + ''
.tab-content {
border-top: solid #9400FF !important;
userChrome = ''
#navigator-toolbox,
#nav-bar {
background-image: linear-gradient(
color-mix(in srgb, #${config.lib.colors.foreground} 5%, transparent),
color-mix(in srgb, #${config.lib.colors.foreground} 5%, transparent)
) !important;
}
'';
};
+14 -2
View File
@@ -8,6 +8,9 @@ let
enabled = config.mod.foot.enable;
hyprlandEnabled = config.mod.hyprland.enable;
colors = config.lib.colors.terminal;
indexed = prefix: list: lib.listToAttrs (lib.imap0 (i: c: lib.nameValuePair "${prefix}${toString i}" c) list);
in
{
options = {
@@ -24,9 +27,18 @@ in
settings = {
main = {
term = "xterm-256color";
font = "JetBrainsMono Nerd Font:size=15";
include = "${pkgs.foot.themes}/share/foot/themes/dracula";
font = "JetBrainsMono Nerd Font:size=17";
};
colors-dark = {
foreground = colors.foreground;
background = colors.background;
cursor = "${colors.background} ${colors.cursor}";
selection-foreground = colors.foreground;
selection-background = colors.selection;
}
// indexed "regular" colors.regular
// indexed "bright" colors.bright;
};
};
+30
View File
@@ -85,6 +85,36 @@ in
home.file.".tigrc".text = ''
set main-view-line-number = yes
set main-view-line-number-interval = 1
color default default default
color cursor color0 yellow bold
color search-result color0 yellow
color title-focus white color8 bold
color title-blur color8 default
color status white default
color delimiter color8 default
color line-number color8 default
color id yellow default
color date color8 default
color author cyan default
color mode cyan default
color graph-commit yellow default
color main-commit default default
color main-head yellow default bold
color main-ref yellow default
color main-local-tag color11 default
color main-tag color11 default bold
color main-remote color8 default
color main-tracked yellow default bold
color main-replace cyan default
color diff-header color15 default bold
color diff-index color8 default
color diff-chunk cyan default
color diff-add green default
color diff-del red default
color diff-stat cyan default
'';
};
+42 -10
View File
@@ -1,6 +1,21 @@
{ pkgs, config, ... }:
let
colors = config.lib.colors.terminal;
dim = builtins.elemAt colors.bright 0;
tmuxPanes = pkgs.writeShellApplication {
name = "tmux-panes";
runtimeInputs = [
pkgs.jq
pkgs.tmux
];
text = builtins.readFile ./panes.sh;
};
in
{
home-manager.users.alex = {
home.packages = [ tmuxPanes ];
programs.tmux = {
enable = true;
@@ -10,7 +25,27 @@
# Allow vi mode to be enabled instantly
escapeTime = 0;
plugins = [ pkgs.tmuxPlugins.sensible ];
plugins = [
pkgs.tmuxPlugins.sensible
{
plugin = pkgs.tmuxPlugins.resurrect;
extraConfig = ''
set -g @resurrect-capture-pane-contents 'on'
set -g @resurrect-processes '"~bin/claude->${tmuxPanes}/bin/tmux-panes restore claude" "~bin/emacs -nw->${tmuxPanes}/bin/tmux-panes restore emacs"'
set -g @resurrect-hook-post-save-all '${tmuxPanes}/bin/tmux-panes save'
'';
}
{
plugin = pkgs.tmuxPlugins.continuum;
extraConfig = ''
# Remove date/time etc. on the right side
set -g status-right ""
set -g @continuum-restore 'on'
set -g @continuum-save-interval '10'
'';
}
];
extraConfig = ''
set -g renumber-windows on
@@ -26,18 +61,15 @@
set -g set-clipboard on
# Status line colors
set -g status-fg '#${config.lib.colors.foreground}'
set -g status-bg '#${config.lib.colors.background}'
# Remove date/time etc. on the right side
set -g status-right ""
set -g status-fg '#${colors.foreground}'
set -g status-bg '#${colors.status}'
# Status window colors
set -g window-status-current-style bg='#${config.lib.colors.background}',fg='#${config.lib.colors.foreground}'
set -g window-status-style bg='#${config.lib.colors.background}',fg='#${config.lib.colors.foreground-dim}'
set -g window-status-current-style bg='#${colors.status}',fg='#${colors.cursor}'
set -g window-status-style bg='#${colors.status}',fg='#${dim}'
set -g pane-border-style fg='#${config.lib.colors.background}'
set -g pane-active-border-style fg='#${config.lib.colors.background}'
set -g pane-border-style fg='#${dim}'
set -g pane-active-border-style fg='#${dim}'
set -g pane-border-lines "heavy"
# Remove accidental `suspend-client` triggers
+81
View File
@@ -0,0 +1,81 @@
state_root="${XDG_STATE_HOME:-$HOME/.local/state}/tmux-panes"
snapshot_root="${XDG_DATA_HOME:-$HOME/.local/share}/tmux/resurrect/panes"
pane_state() {
echo "$state_root/${1#%}"
}
pane_snapshot() {
echo "$snapshot_root/${1//\//_}"
}
case "${1:-}" in
claude-session)
[ -n "${TMUX_PANE:-}" ] || exit 0
session_id="$(jq -r '.session_id')"
dir="$(pane_state "$TMUX_PANE")"
mkdir -p "$dir"
printf '%s\n%s\n' "${CLAUDE_CONFIG_DIR:-}" "$session_id" > "$dir/claude"
;;
save)
mkdir -p "$(dirname "$snapshot_root")" "$state_root"
snapshot="$(mktemp -d "$snapshot_root.XXXXXX")"
live=()
while IFS=$'\t' read -r id pos cmd; do
live+=("${id#%}")
case "$cmd" in
claude | emacs) ;;
*) continue ;;
esac
src="$(pane_state "$id")/$cmd"
[ -f "$src" ] || continue
dst="$snapshot/${pos//\//_}"
mkdir -p "$dst"
cp "$src" "$dst/$cmd"
done < <(tmux list-panes -a -F '#{pane_id} #S:#I.#P #{pane_current_command}')
rm -rf "$snapshot_root"
mv "$snapshot" "$snapshot_root"
for dir in "$state_root"/*/; do
[ -d "$dir" ] || continue
name="$(basename "$dir")"
[[ " ${live[*]} " == *" $name "* ]] || rm -rf "$dir"
done
;;
restore)
pos="$(tmux display-message -p -t "$TMUX_PANE" '#S:#I.#P')"
file="$(pane_snapshot "$pos")/${2:-}"
case "${2:-}" in
claude)
if [ ! -f "$file" ]; then
echo "tmux-panes: no saved claude session for $pos" >&2
exit 1
fi
{ read -r config_dir; read -r session_id; } < "$file"
CLAUDE_CONFIG_DIR="$config_dir" exec claude --resume "$session_id"
;;
emacs)
if [ -f "$file" ]; then
buffers="$(mktemp)"
cp "$file" "$buffers"
TMUX_PANES_RESTORE="$buffers" exec e
fi
exec e
;;
*)
echo "usage: tmux-panes restore claude|emacs" >&2
exit 1
;;
esac
;;
*)
echo "usage: tmux-panes claude-session|save|restore <claude|emacs>" >&2
exit 1
;;
esac
+54 -1
View File
@@ -1,4 +1,55 @@
{ config, lib, ... }:
{
config,
lib,
pkgs,
...
}:
let
inherit (config.boot.kernelPackages) kernel kernelModuleMakeFlags;
ipu6-isys = pkgs.stdenv.mkDerivation {
pname = "ipu6-isys";
inherit (kernel) version;
__structuredAttrs = true;
patches = [ ./ipu6-isys-runtime-pm-null-check.patch ];
nativeBuildInputs = kernel.moduleBuildDependencies;
unpackPhase = ''
tar -xf ${kernel.src} --strip-components=1 --wildcards '*/drivers/media/pci/intel/ipu6/*'
'';
postPatch = ''
sed -i '/+= intel-ipu6\.o/d' drivers/media/pci/intel/ipu6/Makefile
'';
makeFlags = kernelModuleMakeFlags ++ [
"KERNELRELEASE=${kernel.modDirVersion}"
];
installFlags = [
"DEPMOD=true"
"INSTALL_MOD_PATH=${placeholder "out"}"
];
buildPhase = ''
runHook preBuild
make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \
M=$(pwd)/drivers/media/pci/intel/ipu6 "''${makeFlags[@]}"
runHook postBuild
'';
installPhase = ''
runHook preInstall
make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \
M=$(pwd)/drivers/media/pci/intel/ipu6 modules_install \
"''${makeFlags[@]}" "''${installFlags[@]}"
runHook postInstall
'';
};
in
{
nixpkgs.overlays = [
(final: prev: {
@@ -28,6 +79,8 @@
})
];
boot.extraModulePackages = [ ipu6-isys ];
hardware.ipu6 = {
enable = true;
platform = "ipu6epmtl";
@@ -0,0 +1,22 @@
--- a/drivers/media/pci/intel/ipu6/ipu6-isys.c
+++ b/drivers/media/pci/intel/ipu6/ipu6-isys.c
@@ -858,6 +858,9 @@
unsigned long flags;
int ret;
+ if (!isys)
+ return 0;
+
ret = ipu6_mmu_hw_init(adev->mmu);
if (ret)
return ret;
@@ -885,6 +888,9 @@
struct ipu6_isys *isys = dev_get_drvdata(dev);
unsigned long flags;
+ if (!isys)
+ return 0;
+
spin_lock_irqsave(&isys->power_lock, flags);
isys->power = 0;
spin_unlock_irqrestore(&isys->power_lock, flags);
+14 -1
View File
@@ -8,6 +8,9 @@ let
enabled = config.mod.wezterm.enable;
hyprlandEnabled = config.mod.hyprland.enable;
colors = config.lib.colors.terminal;
luaList = list: "{ " + lib.concatMapStringsSep ", " (c: "'#${c}'") list + " }";
in
{
options = {
@@ -27,7 +30,17 @@ in
local config = wezterm.config_builder()
config.color_scheme = 'Dracula (Official)'
config.colors = {
foreground = '#${colors.foreground}',
background = '#${colors.background}',
cursor_bg = '#${colors.cursor}',
cursor_border = '#${colors.cursor}',
cursor_fg = '#${colors.background}',
selection_bg = '#${colors.selection}',
selection_fg = '#${colors.foreground}',
ansi = ${luaList colors.regular},
brights = ${luaList colors.bright},
}
config.font = wezterm.font 'JetBrainsMono Nerd Font'
-- to get "perfect" scaling to the right