Compare commits

...
139 Commits
Author SHA1 Message Date
Alexander Heldt c29f8c94e3 Update ndp flake input 2026-11-22 15:53:42 +01:00
Alexander Heldt f537765495 Update dagbok flake input 2026-11-20 11:30:41 +01:00
Alexander Heldt a9ffe67b8b Update dagbok flake input 2026-11-20 10:31:03 +01:00
Alexander Heldt fab534431c Update ct flake input 2026-11-20 10:30:53 +01:00
Alexander Heldt ddbeaa7b5b Update ndp flake input 2026-11-20 10:27:50 +01:00
Alexander Heldt 3a6a75bffa pinwheel: Give ndp an Anthropic API key for asking an LLM 2026-11-20 10:27:50 +01:00
Alexander Heldt ef499b0581 manatee: Remove solo-referee module and flake input 2026-11-20 08:56:34 +01:00
Alexander Heldt d469f067bd Update ndp flake input 2026-11-17 16:47:41 +01:00
Alexander Heldt cc4b41a4b0 Update dagbok flake input 2026-11-17 14:55:46 +01:00
Alexander Heldt ef21a9a785 pinwheel: Turn off code-action hints with refactor-indications
Eglot 1.25 moved code actions to the `refactor` package and made
`eglot-code-action-indications` an obsolete alias for
`refactor-indications`. The alias is set before eglot loads, so the
setting no longer applies and the `refactor` default comes back. Its
eldoc hint then takes the one-line echo area, hiding the hover
signature.
2026-11-17 14:25:42 +01:00
Alexander Heldt 0ec4085359 Update ndp flake input 2026-11-17 10:38:18 +01:00
Alexander Heldt c40dec90bd pinwheel: Fix webcam breaking after resume from hibernation
Hibernation powers off the Lattice USBIO bridge that the ov08x40
sensor and Intel CVS sit behind. usbio has no reset_resume callback,
so on restore the USB core unbinds and rebinds it, which re-creates
the sensor and CVS I2C clients. The new clients lack the fwnode graph
that ipu-bridge built at boot, and ipu-bridge never rebuilds it, so
the camera stays dead until a cold boot.

Patch usbio to redo the bridge handshake in reset_resume instead of
being rebound, and patch gpio-usbio to restore its pin configuration
and output values after such a reset. Both are built from the kernel
source and installed under updates/, sharing the build recipe with
the patched ipu6-isys module.
2026-11-17 10:36:46 +01:00
Alexander Heldt c8b2340d14 Update ndp flake input 2026-11-17 10:36:46 +01:00
Alexander Heldt 3ddba7f670 pinwheel: Install picard plugin replaygain2 from a pinned source 2026-11-17 09:07:05 +01:00
Alexander Heldt ec4d407422 Update ndp flake input 2026-11-16 22:14:11 +01:00
Alexander Heldt 301aa7c1bb pinwheel: Scale picard by 1.5 with QT_SCREEN_SCALE_FACTORS 2026-11-16 22:13:41 +01:00
Alexander Heldt a52494e39b pinwheel: Add picard with the replaygain2 plugin 2026-11-16 22:03:18 +01:00
Alexander Heldt 66f65a1131 Update ct flake input 2026-11-16 09:04:42 +01:00
Alexander Heldt 6ef357012d Update dagbok flake input 2026-11-16 09:04:32 +01:00
Alexander Heldt 323707c21c Update ct flake input 2026-11-15 21:42:40 +01:00
Alexander Heldt a0654a6619 Update dagbok flake input 2026-11-15 21:28:30 +01:00
Alexander Heldt 470eb72279 Update dagbok flake input 2026-11-15 21:18:01 +01:00
Alexander Heldt b91a9abb85 Update ndp flake input 2026-11-15 21:04:07 +01:00
Alexander Heldt e4ba4fefc6 Update dagbok flake input 2026-11-15 15:50:10 +01:00
Alexander Heldt 8bb925d9e7 Update ndp flake input 2026-11-15 15:49:49 +01:00
Alexander Heldt 7ad43db433 pinwheel: Name the exit node in the tailscale connect notification
The notification shows the exit node's hostname, followed by its city
and country when tailscale knows the node's location.
2026-11-15 15:49:20 +01:00
Alexander Heldt f4b0269b08 pinwheel: Hibernate instead of suspend when the battery is low
Adds a swap file to hold the hibernation image. The low battery timer and
UPower's critical action now hibernate, and SUPER+SHIFT+x uses
`suspend-then-hibernate` so a suspended laptop hibernates before the
battery runs out.
2026-11-15 15:08:35 +01:00
Alexander Heldt f31ac25f3d backwards: Replace tailscale-qs with the official tailscale systray
The `tailscale-qs` extension's node list could not be opened. The
official `tailscale systray` shows the nodes and exit nodes, with the
AppIndicator extension providing a tray in GNOME. The systray never
retries if no tray exists when it starts, so it waits for one first.
2026-11-13 19:42:38 +01:00
Alexander Heldt b4b9136593 backwards: Add a raw touchpad bridge for the K400 Plus
The K400 Plus firmware turns two-finger swipes into whole wheel ticks, so
every scroll jumps a fixed distance. A trimmed copy of k400-raw's touchpad
mode switches the touchpad to raw HID++ reporting and exposes it as a
native multitouch touchpad, which GNOME scrolls smoothly.
2026-11-13 19:02:11 +01:00
Alexander Heldt 0d1e7d4c77 pinwheel: Autoload every dagbok command the README lists 2026-11-13 10:20:06 +01:00
Alexander Heldt a981623b67 pinwheel: Autoload dagbok-refresh instead of the removed dagbok-reload 2026-11-13 10:20:06 +01:00
Alexander Heldt de1b78561d Update puppy-tracker flake input 2026-11-13 09:14:40 +00:00
Alexander Heldt 69bc014849 manatee: Send Galleriet and disk SMART alerts only to the Pixel
Only the fridge door and water leak alerts need to reach both phones.
2026-11-13 09:14:34 +00:00
Alexander Heldt 542a83b07d Update dagbok flake input 2026-11-13 10:14:00 +01:00
Alexander Heldt 3153366a06 Update ndp flake input 2026-11-13 10:14:00 +01:00
Alexander Heldt a3c9c28875 pinwheel: Autoload dagbok-year instead of the removed dagbok-open-date 2026-11-13 10:14:00 +01:00
Alexander Heldt 629e26fb28 Update ct flake input 2026-11-13 10:14:00 +01:00
Alexander Heldt d6068b10ae Update dagbok flake input 2026-11-13 10:14:00 +01:00
Alexander Heldt c9304fbc54 Update ndp flake input 2026-11-13 10:14:00 +01:00
Alexander Heldt 404138d411 pinwheel: Toggle the work VPN from waybar without sudo 2026-11-13 10:14:00 +01:00
Alexander Heldt 36655ac153 manatee: Alert when Galleriet is above 23°C and notify both phones
Add a `binary_sensor.galleriet_too_warm` template sensor and an alert
that repeats hourly while it's on. Send all Home Assistant
notifications through a `phones` notify group so they reach both the
Pixel and the iPhone, with a critical alert on iOS for water leaks.
2026-11-11 08:57:51 +00:00
Alexander Heldt 72cc9932c4 pinwheel: Pass shift+enter and other modified keys through tmux 2026-11-09 14:47:37 +01:00
Alexander Heldt 11a3e84d06 Update dagbok flake input 2026-11-09 12:46:17 +00:00
Alexander Heldt 20489e7342 Update dagbok flake input 2026-11-09 13:17:21 +01:00
Alexander Heldt db875fed40 Update ndp flake input 2026-11-09 13:14:27 +01:00
Alexander Heldt b63c2ee12f pinwheel: Show ndp in the waybar music status 2026-11-09 08:42:40 +01:00
Alexander Heldt bca53976af Update ndp flake input 2026-11-09 07:54:36 +01:00
Alexander Heldt 71218ee0c6 Update ndp flake input 2026-11-08 19:26:10 +01:00
Alexander Heldt 765c28149d Update ndp flake input 2026-11-08 19:10:01 +01:00
Alexander Heldt 9c9e2456e2 manatee: Configure lbsync from an agenix secret 2026-11-08 18:49:48 +01:00
Alexander Heldt 6f855b3ff2 Update ndp flake input 2026-11-08 18:49:48 +01:00
Alexander Heldt b3b5afc2dd manatee: Run the lbsync Navidrome plugin 2026-11-08 15:49:02 +01:00
Alexander Heldt 1f84da1eeb Update ndp flake input 2026-11-08 15:49:02 +01:00
Alexander Heldt b2d0da1ede pinwheel: Control ndp with the media keys 2026-11-08 15:23:34 +01:00
Alexander Heldt 40e89a6006 pinwheel: Add ndp, a terminal player for Navidrome
The player's config is generated by its home-manager module; the Navidrome
password stays in an agenix secret that the config reads at startup.
2026-11-08 15:20:00 +01:00
Alexander Heldt 75a045c2c6 manatee: Add an SSH key for reaching tadpole
Add `alex.manatee-tadpole`, a passphrase-protected key, with a `tadpole`
host entry in manatee's SSH config. tadpole authorizes it next to the
key from pinwheel.
2026-11-07 18:33:06 +00:00
Alexander Heldt 5bedd29fd2 tadpole: Redirect www.heldtenkelt.se to heldtenkelt.se
www gets its own ACME certificate so that a problem with it can't block
the certificate for heldtenkelt.se.
2026-11-07 15:05:12 +00:00
Alexander Heldt 449e3cbfdf tadpole: Host heldtenkelt.se
Add the heldtenkelt.se-site flake as an input and serve it with nginx
on tadpole, with its own ACME certificate.
2026-11-07 14:59:33 +00:00
Alexander Heldt 6e86006dc2 Update dagbok flake input 2026-11-07 14:35:25 +00:00
Alexander Heldt 33bdae3866 Update dagbok flake input 2026-11-05 14:52:09 +00:00
Alexander Heldt fa2564bf12 Update dagbok flake input 2026-11-05 08:27:48 +00:00
Alexander Heldt c9078cfb7d Update ct flake input 2026-11-05 08:46:24 +01:00
Alexander Heldt f686ce6253 Update dagbok flake input 2026-11-05 07:45:16 +00:00
Alexander Heldt 25e727a283 Update dagbok flake input 2026-11-03 14:33:01 +01:00
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
Alexander Heldt 5839e8ea1a Update dagbok flake input 2026-11-03 08:26:55 +00:00
Alexander Heldt afe4f2db81 manatee: Wait for ZFS mounts before starting sandboxed /mnt/media services 2026-11-02 10:55:35 +00:00
Alexander Heldt 248eb13b16 Update ct flake input 2026-11-02 11:54:26 +01:00
Alexander Heldt 29fd0e032c Update dagbok flake input 2026-11-02 10:19:05 +01:00
Alexander Heldt abf6230995 pinwheel: Unpin tailscale 2026-11-02 10:08:06 +01:00
Alexander Heldt 5da548741a pinwheel: Remove rounded corners from Firefox tabs 2026-11-02 10:07:11 +01:00
Alexander Heldt 1d172e315e pinwheel: Disable Firefox "Smart Window" 2026-11-02 10:06:04 +01:00
Alexander Heldt 304bf84a97 Update flake inputs 2026-11-02 08:10:31 +00:00
Alexander Heldt d1bc16660f Update dagbok flake input 2026-11-02 08:02:32 +00:00
Alexander Heldt d5c9038a9f Update schema flake input 2026-11-02 07:40:20 +00:00
Alexander Heldt 3b779054e3 tadpole: Drop removed DOMAIN setting from gitea 2026-11-02 08:33:31 +01:00
Alexander Heldt 59d1d331e2 Update flake inputs 2026-11-02 07:23:31 +00:00
Alexander Heldt 924d06865a manatee: Reload Plejd when its BLE link goes stale
pyplejd keeps using a dead BLE client ("Service Discovery has not been
performed yet") instead of reconnecting, which left the Plejd lights
unreachable for two days. Fire system log events and let an automation
reload the integration when that warning shows up.

Also add systemd to bt-reset's PATH so its `systemctl` calls work.
2026-11-02 07:22:57 +00:00
Alexander Heldt 3f4a790b53 pinwheel: Configure ct through its Home Manager module 2026-10-29 11:45:02 +01:00
Alexander Heldt cf5b74e251 pinwheel/manatee: Drop tmux r reload binding in favour of R from tmux-sensible 2026-10-29 08:45:28 +01:00
Alexander Heldt 540099f56b Update ct flake input 2026-10-28 15:10:23 +01:00
Alexander Heldt cd807b550f pinwheel: Add ct for side threads in Claude Code sessions
Install ct from its flake, with its config, a tmux menu on prefix T and a user service for the web UI. Also keep Claude Code transcripts for ten years instead of 30 days, since threads are meant to be revisited.
2026-10-27 14:49:43 +01:00
Alexander Heldt a74e75d9ab pinwheel: Add screenshot annotation with satty
Shift-prefixed screenshot bindings pipe the capture to satty, and notifications use a short timeout so they are not captured.
2026-10-27 09:59:09 +01:00
Alexander Heldt b74c715164 pinwheel: Copy to clipboard via OSC 52 in Emacs so it works over SSH 2026-10-26 15:41:53 +01:00
Alexander Heldt 8088bc5199 pinwheel: Add Emacs command to copy file path with line number 2026-10-26 15:41:53 +01:00
Alexander Heldt 93c9484541 Update dagbok flake input 2026-10-26 14:41:27 +00:00
Alexander Heldt c3c83b07b7 Update dagbok flake input 2026-10-26 12:50:52 +00:00
Alexander HeldtandClaude Opus 5.5 c9ca657416 manatee: Alert on kitchen water leak
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 07:37:24 +00:00
Alexander Heldt ae22edcbee Update dagbok flake input 2026-10-23 12:00:14 +02:00
Alexander Heldt 48248e8c7d pinwheel: Lock instead of suspend on lid close
Have logind ignore the lid switch and suspend/hibernate keys so the
machine stays reachable over SSH with the lid closed. SUPER + SHIFT + x
remains the way to suspend; closing the lid now only locks the screen.
2026-10-22 19:37:42 +02:00
Alexander Heldt 36292c4f14 pinwheel: Fix webcam frame drops and raise resolution to 1080p
With the default 6 icamerasrc buffers the camera HAL ran out of pending
requests and dropped every fourth sensor frame, capping output at ~22.5 fps.
Using 10 buffers keeps the request queue fed and restores 30 fps.
2026-10-22 19:37:42 +02:00
Alexander Heldt 647415b549 Update dagbok flake input 2026-10-22 17:37:20 +00:00
Alexander Heldt 3c01ed4698 Update dagbok flake input 2026-10-21 08:36:30 +02:00
Alexander Heldt 4d0977c482 backwards/pinwheel: Add SSH key for backwards to access pinwheel
Pinwheel's sshd had no way to accept keys from other hosts. Give it the
same `authorizedKeysCommand` setup as backwards and manatee, and authorize
a new `alex.backwards-pinwheel` key that backwards uses for `ssh pinwheel`.
2026-10-20 21:59:21 +02:00
Alexander Heldt 4f2c93d2b0 backwards: Disable rtw88 power saving 2026-10-20 21:20:31 +02:00
Alexander Heldt 0c3b0a26e1 backwards: Disable i915 display power saving 2026-10-20 21:20:31 +02:00
Alexander Heldt ccd58b62ce backwards: Enable Steam and let it use the 8BitDo pad
`hid_nintendo` claims the pad when it is in Nintendo Switch mode, which
leaves Steam unable to reach it through hidraw. Blacklist the module and
tag the device with `uaccess` so Steam can open it.
2026-10-20 21:20:31 +02:00
Alexander Heldt 657be047ec backwards: Replace nix-gc-env with nh clean
`nix.gc` run as root cannot prune generations under
`~/.local/state/nix/profiles` (NixOS/nix#8508), and `nix-gc-env` only
looks in `/nix/var/nix/profiles`. Home-manager generations therefore
accumulated since August 2024 and filled the disk.

`nh clean all` enumerates users and walks their per-user profiles too.
It replaces `nix.gc.automatic`, which cannot be enabled alongside it.
2026-10-20 21:20:31 +02:00
Alexander Heldt 062321ee7f backwards/manatee/tadpole: Clean /tmp on boot
Only `pinwheel` set this. Elsewhere files in `/tmp` survived reboots,
and leftover `nh` build result symlinks there kept acting as GC roots,
pinning store paths that should have been collected.
2026-10-20 21:20:31 +02:00
Alexander Heldt 951428e7a1 backwards: Add tailscale-qs GNOME extension for switching exit nodes 2026-10-20 21:20:31 +02:00
Alexander Heldt dc390606aa Update dagbok flake input 2026-10-20 14:01:47 +02:00
Alexander Heldt cea16ebd3a Update schema flake input 2026-10-20 09:04:31 +00:00
Alexander Heldt c345949301 Update dagbok flake input 2026-10-20 09:04:17 +00:00
Alexander Heldt 350e576994 Update dagbok flake input 2026-10-15 11:52:40 +00:00
Alexander Heldt 21a1039fff manatee: Remove stale restic locks before each backup 2026-10-15 13:38:44 +02:00
Alexander Heldt 57040a5bd8 Update dagbok flake input 2026-10-13 12:47:11 +00:00
Alexander Heldt 0db6cf99eb Update dagbok flake input 2026-10-13 09:50:12 +00:00
Alexander Heldt 7ace09785d Update whib-frontend flake input 2026-10-13 11:48:14 +02:00
Alexander Heldt 8f64ce6fe7 Update dagbok flake input 2026-10-13 07:55:28 +00:00
Alexander Heldt 40b9f3e861 pinwheel: Add dagbok Emacs client
Built from the dagbok flake's Emacs overlay, reading the shared token
from agenix.
2026-10-12 16:31:14 +02:00
Alexander Heldt 154f33f258 manatee: Add dagbok
Served at dagbok.ppp.pm through nginx from 127.0.0.1:8093, with its token
from agenix, a Hetzner DNS-01 certificate, a dynamic DNS record and a
state backup snapshot.
2026-10-12 16:31:14 +02:00
Alexander Heldt bbae47fd77 Update schema flake input 2026-10-12 14:18:36 +00:00
Alexander Heldt 7429a82857 Update schema and puppy-tracker flake inputs 2026-10-04 18:24:42 +00:00
Alexander Heldt 1dc9571e1b manatee: Drop the schema/puppy-tracker link and its secret
The link was removed from both apps, so the commented-out config for it
and the shared schema-puppy-token secret go too.
2026-10-04 18:18:08 +00:00
Alexander Heldt 7a7499ba6d manatee: Back up SQLite databases of DynamicUser services
/var/lib/<name> is a symlink into /var/lib/private for those, so find
stopped at the link and the state dump never copied their databases
(schema, puppy-tracker, todo, …). Follow it with find -H.
2026-10-04 16:36:33 +00:00
Alexander Heldt ab700c0368 manatee: Cap ZFS ARC at 4 GiB 2026-10-04 16:36:33 +00:00
Alexander Heldt 00475b637b pinwheel: Give the webcam v4l2loopback device more buffers 2026-10-02 09:45:20 +02:00
Alexander Heldt cae7c4cbcf pinwheel: Route browser links to work firefox profile from work checkouts 2026-10-02 09:16:32 +02:00
Alexander Heldt 935b3022e2 pinwheel: Open gcloud links in work firefox profile 2026-10-02 08:59:12 +02:00
Alexander Heldt 5d4f43c5f8 pinwheel: Use alt instead of ctrl for atuin numeric shortcuts 2026-10-02 08:55:17 +02:00
Alexander Heldt 6ee912e39f pinwheel: Skip local network access checks for work domains in firefox 2026-10-02 08:54:52 +02:00
Alexander Heldt 94232b1ff6 pinwheel: Read atuin key from age secret, keep up arrow for zsh history 2026-10-01 08:56:55 +02:00
Alexander Heldt e1989d913a manatee: Disable atuin open registration 2026-10-01 08:56:55 +02:00
65 changed files with 2475 additions and 435 deletions

No files matched your search

Generated
+190 -210
View File
@@ -2,19 +2,16 @@
"nodes": { "nodes": {
"agenix": { "agenix": {
"inputs": { "inputs": {
"darwin": "darwin",
"home-manager": "home-manager",
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ]
"systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1770165109, "lastModified": 1792507013,
"narHash": "sha256-9VnK6Oqai65puVJ4WYtCTvlJeXxMzAp/69HhQuTdl/I=", "narHash": "sha256-8tKjSQajD3mUND1GaAuaWTcuyUpgcGsh5V+l4ibzC7U=",
"owner": "ryantm", "owner": "ryantm",
"repo": "agenix", "repo": "agenix",
"rev": "b027ee29d959fda4b60b57566d64c98a202e0feb", "rev": "5e5b88a0c8e56f291a108c2fe9934054d9745b2e",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -43,11 +40,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1789630322, "lastModified": 1793363642,
"narHash": "sha256-jiUl3+k9K+BASO4hvKFhlCMUpHPPoy2q5uZMl3pzOF0=", "narHash": "sha256-LKHPWs7mm7/y8Y0urwmYnnGZ00YTCoF/SU/aEEwPi5I=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "aquamarine", "repo": "aquamarine",
"rev": "f31c47a1b9d300847d8fc3108ad959448103dfc1", "rev": "eac1b827c4a12dc026f21c966cde2f248fe6ee12",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -56,26 +53,46 @@
"type": "github" "type": "github"
} }
}, },
"darwin": { "ct": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"agenix",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1744478979, "lastModified": 1795167012,
"narHash": "sha256-dyN+teG9G82G+m+PX/aSAagkC+vUv0SgUw3XkPhQodQ=", "narHash": "sha256-lrLLMUJNddmAMMDobTJVshu7ckzMTmTab4S3XPFgT1E=",
"owner": "lnl7", "ref": "main",
"repo": "nix-darwin", "rev": "7be6c580cb78e8e3267b6d98e421275aacc8140b",
"rev": "43975d782b418ebf4969e9ccba82466728c2851b", "revCount": 30,
"type": "github" "type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/ct.git"
}, },
"original": { "original": {
"owner": "lnl7", "ref": "main",
"ref": "master", "type": "git",
"repo": "nix-darwin", "url": "ssh://gitea@git.ppp.pm:1122/alex/ct.git"
"type": "github" }
},
"dagbok": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1795169003,
"narHash": "sha256-He4Tde9AYNSIb8D8ZowMAUECQnUM07cSEwqc10D04xc=",
"ref": "main",
"rev": "c3114be05fda532d8fbb14149a5a662550bc49f2",
"revCount": 61,
"type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/dagbok.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/dagbok.git"
} }
}, },
"disko": { "disko": {
@@ -85,11 +102,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1789770686, "lastModified": 1792526520,
"narHash": "sha256-uZkBR7yHdIKUFB5SZdfgh1qkGfI3XmYmI/lTiquxbck=", "narHash": "sha256-3hSJlv8mUVnZPMWK2+CM7a9O+nR6Z4mCh27NfLCmTPc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "disko", "repo": "disko",
"rev": "725ea35e410ad83be4931d1bff7e090eacaf3563", "rev": "cedd626e11b635470fa6f9fdb8ad79b0075dd7f9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -106,11 +123,11 @@
"nixpkgs-stable": "nixpkgs-stable" "nixpkgs-stable": "nixpkgs-stable"
}, },
"locked": { "locked": {
"lastModified": 1790345467, "lastModified": 1793596370,
"narHash": "sha256-5rRgQncqgIgKpCGmajrXd4+Q9j5QlUY/kCp7SnAwuMk=", "narHash": "sha256-AlMzvHIikcdd7QgEaPE5t8z1IDZibPHQq+4Eu2caVFA=",
"owner": "nix-community", "owner": "nix-community",
"repo": "emacs-overlay", "repo": "emacs-overlay",
"rev": "c70ae6cc52020e2b5f647e2d35e2cc2621293af3", "rev": "fa4b32e9d0b8f72c25bc5925f07bbddb78d5ed72",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -153,7 +170,7 @@
}, },
"flake-utils": { "flake-utils": {
"inputs": { "inputs": {
"systems": "systems_3" "systems": "systems_2"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1731533236,
@@ -171,7 +188,7 @@
}, },
"flake-utils_2": { "flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems_4" "systems": "systems_3"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1731533236,
@@ -189,7 +206,7 @@
}, },
"flake-utils_3": { "flake-utils_3": {
"inputs": { "inputs": {
"systems": "systems_6" "systems": "systems_5"
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1731533236,
@@ -205,57 +222,39 @@
"type": "github" "type": "github"
} }
}, },
"flake-utils_4": { "heldtenkeltdotse-site": {
"inputs": { "inputs": {
"systems": "systems_7" "nixpkgs": [
"nixpkgs"
]
}, },
"locked": { "locked": {
"lastModified": 1731533236, "lastModified": 1794063438,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", "narHash": "sha256-EGel47G3RfH6USIYDn+w0XNbHNxJETqvl6evckzZ1wk=",
"owner": "numtide", "ref": "main",
"repo": "flake-utils", "rev": "f72065e17484b2315f27b3ffb5a4e7be440aa44d",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", "revCount": 1,
"type": "github" "type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/heldtenkelt.se-site.git"
}, },
"original": { "original": {
"owner": "numtide", "ref": "main",
"repo": "flake-utils", "type": "git",
"type": "github" "url": "ssh://gitea@git.ppp.pm:1122/alex/heldtenkelt.se-site.git"
} }
}, },
"home-manager": { "home-manager": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
"agenix",
"nixpkgs" "nixpkgs"
] ]
}, },
"locked": { "locked": {
"lastModified": 1745494811, "lastModified": 1793193205,
"narHash": "sha256-YZCh2o9Ua1n9uCvrvi5pRxtuVNml8X2a03qIFfRKpFs=", "narHash": "sha256-X6xa6sGA7RnJQuZGbFMC+K+KToWAlBDCCjJXfTwEPsw=",
"owner": "nix-community", "owner": "nix-community",
"repo": "home-manager", "repo": "home-manager",
"rev": "abfad3d2958c9e6300a883bd443512c55dfeb1be", "rev": "095fef2f265c3c0da4fe315efba8f8a04495ab34",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1790292277,
"narHash": "sha256-z+knvdMItRrMonmG4RIsqKYIa/hwYUzKjotDTfC5DDc=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "4b9add8645d5e2b0f7de18f7a442d08fe2bdcc91",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -309,11 +308,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1786464367, "lastModified": 1791066858,
"narHash": "sha256-k58p4wbzIXWyRWrW84pP8tD+iaZSSYiiM+fr0Auk4oU=", "narHash": "sha256-hLh6ALHrGpgYm8viWCo1pO+ErC22YDGdAvVPcfYsXA8=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprgraphics", "repo": "hyprgraphics",
"rev": "7c895c44e3ca6d28ed68ddd80ec02b02b925e7fc", "rev": "80c7d00f2236732853e390019ff8d79d17fa3612",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -330,6 +329,7 @@
"hyprland-guiutils": "hyprland-guiutils", "hyprland-guiutils": "hyprland-guiutils",
"hyprland-protocols": "hyprland-protocols", "hyprland-protocols": "hyprland-protocols",
"hyprlang": "hyprlang", "hyprlang": "hyprlang",
"hyprtoolkit": "hyprtoolkit",
"hyprutils": "hyprutils", "hyprutils": "hyprutils",
"hyprwayland-scanner": "hyprwayland-scanner", "hyprwayland-scanner": "hyprwayland-scanner",
"hyprwire": "hyprwire", "hyprwire": "hyprwire",
@@ -337,15 +337,15 @@
"nixpkgs" "nixpkgs"
], ],
"pre-commit-hooks": "pre-commit-hooks", "pre-commit-hooks": "pre-commit-hooks",
"systems": "systems_2", "systems": "systems",
"xdph": "xdph" "xdph": "xdph"
}, },
"locked": { "locked": {
"lastModified": 1790173459, "lastModified": 1793557552,
"narHash": "sha256-6/r7tBSiLpohq6hYBLmiuc6KdgTjo6Rers3lE3V3zBM=", "narHash": "sha256-4Ce6YOJDxHxpR+zZIA0t5XrqQZTp4owwhxYGeV1GL0E=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "Hyprland", "repo": "Hyprland",
"rev": "e368c13c27a42a173b9e08fa0bf413f9f7073187", "rev": "d55a55d72a2ecfbb31b875b0b45c27559ce86691",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -361,11 +361,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1787301232, "lastModified": 1792709073,
"narHash": "sha256-qSzrIIqQUtEVeVZxQLj/L4p7+xKBEtPhgMTzFW2c6P8=", "narHash": "sha256-eiWcuJH3ft0epDVue6pkxsY6ekBa/s7Rwx+yI1g0VVQ=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "contrib", "repo": "contrib",
"rev": "57baf317e5196a8286b80976771ef55febad8660", "rev": "a54daf843dcdf6f5ff86996ab011de6e86a1bd7c",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -388,7 +388,10 @@
"hyprland", "hyprland",
"hyprlang" "hyprlang"
], ],
"hyprtoolkit": "hyprtoolkit", "hyprtoolkit": [
"hyprland",
"hyprtoolkit"
],
"hyprutils": [ "hyprutils": [
"hyprland", "hyprland",
"hyprutils" "hyprutils"
@@ -407,11 +410,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1786464504, "lastModified": 1793110121,
"narHash": "sha256-7sHwM86KILQyHDHDuE2SDBlQ2jvZ0EW3hY7sW009/cg=", "narHash": "sha256-5CLVHQKv4lcVjw8e4HQ72ZlkMWkrPMNdfoud70Nvuq4=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-guiutils", "repo": "hyprland-guiutils",
"rev": "4c30cf3097ea963c0e250749ee0c59f8b08816d6", "rev": "d038577531e3ab6646b13a82d17e610be34c30cc",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -432,11 +435,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1789475883, "lastModified": 1792767066,
"narHash": "sha256-YRFLrPESYitsDYqQKquOFg8OWNI7tHKwPnTrTZWXxWY=", "narHash": "sha256-ucakq4Y8H5Wwr/+work1ckFVQTkpfkOTZ/+KWRfja7k=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprland-protocols", "repo": "hyprland-protocols",
"rev": "cc9a8fd253bdc00f48a967ecf4828211ef08751f", "rev": "cd1aba6bd78775825eb230b3a4274c48b6705eb7",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -478,46 +481,39 @@
"inputs": { "inputs": {
"aquamarine": [ "aquamarine": [
"hyprland", "hyprland",
"hyprland-guiutils",
"aquamarine" "aquamarine"
], ],
"hyprgraphics": [ "hyprgraphics": [
"hyprland", "hyprland",
"hyprland-guiutils",
"hyprgraphics" "hyprgraphics"
], ],
"hyprlang": [ "hyprlang": [
"hyprland", "hyprland",
"hyprland-guiutils",
"hyprlang" "hyprlang"
], ],
"hyprutils": [ "hyprutils": [
"hyprland", "hyprland",
"hyprland-guiutils",
"hyprutils" "hyprutils"
], ],
"hyprwayland-scanner": [ "hyprwayland-scanner": [
"hyprland", "hyprland",
"hyprland-guiutils",
"hyprwayland-scanner" "hyprwayland-scanner"
], ],
"nixpkgs": [ "nixpkgs": [
"hyprland", "hyprland",
"hyprland-guiutils",
"nixpkgs" "nixpkgs"
], ],
"systems": [ "systems": [
"hyprland", "hyprland",
"hyprland-guiutils",
"systems" "systems"
] ]
}, },
"locked": { "locked": {
"lastModified": 1785930473, "lastModified": 1793302898,
"narHash": "sha256-DitTu625BhEYpZjtjxtGpjrEJwPwW+X/+jJvhSZNSJM=", "narHash": "sha256-k6dW+HQh5+spLpkLt+3qsE4k9NGsrBjlfINfgqPgYMY=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprtoolkit", "repo": "hyprtoolkit",
"rev": "af515b69dfbe366dc7873aa1475cb2f4db3ebad7", "rev": "92646e15fb295285b10de626f2d9597216465f7b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -538,11 +534,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1788619883, "lastModified": 1792769344,
"narHash": "sha256-dpmeFq5vPvSOsi30ZchOLjltAZEuVBucDvGKs3IZYf4=", "narHash": "sha256-vafQgUKYqxJzob39NXf2sB+k0U2u8XuMsWFOj8d0aRw=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprutils", "repo": "hyprutils",
"rev": "a21e87b878e72ee5dfd375899e8b2ad0d0c4c0e1", "rev": "7e1f69209cd910615d0573a93fa970408f643539",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -592,11 +588,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1786464294, "lastModified": 1792081530,
"narHash": "sha256-ZQsZ2WvBdkboCIyh8LStDPdAIARmxzn0XMNxxoOhjPE=", "narHash": "sha256-SRs96bR3VbViiQ1vOhZOqy/HxczIWCoHaGKhncwr1js=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "hyprwire", "repo": "hyprwire",
"rev": "4ce7cd6b6128c1ac41caf23c58a30a26b327f9dd", "rev": "a546e42d45e161682f729ebf52375bd4800d7041",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -633,11 +629,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1773858923, "lastModified": 1793606847,
"narHash": "sha256-JOm+qe+loPxpjpTn2fN5QuqeGLDqYc1QevNeZZuEkdE=", "narHash": "sha256-Xa8jyyuvFfcNKvq0JCvohfAM3+Vr+76xBg0iybCP/Eg=",
"ref": "main", "ref": "main",
"rev": "2ab63ae85af1e2009e4bce10940e8db56827d942", "rev": "da9eba502b830251d65ba88f70452a1dbec867bc",
"revCount": 67, "revCount": 68,
"type": "git", "type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/komga-comictracker.git" "url": "ssh://gitea@git.ppp.pm:1122/alex/komga-comictracker.git"
}, },
@@ -655,11 +651,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1782065297, "lastModified": 1793606847,
"narHash": "sha256-/pRul59iTUd3Oz8fJNEeB0A2qXfNCMai5LwYlpLTkvY=", "narHash": "sha256-05R3X2U+loa376PQHQU1LCmd44AeiXJauJQPBqqniAk=",
"ref": "main", "ref": "main",
"rev": "1975a872f6587813e9f3741bdab29d9dc1573bc3", "rev": "37bcea9f10abd51ca9cf0f1515ffa1696ab4091d",
"revCount": 43, "revCount": 44,
"type": "git", "type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/komga-reading-stats.git" "url": "ssh://gitea@git.ppp.pm:1122/alex/komga-reading-stats.git"
}, },
@@ -690,6 +686,27 @@
"type": "gitlab" "type": "gitlab"
} }
}, },
"ndp": {
"inputs": {
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1795359024,
"narHash": "sha256-y8QxP87mNSW+Dzb4MnTmibVkrQ9yrz+WJthJaFKr9h0=",
"ref": "main",
"rev": "dd0c3762e91759ebd6fb449194690bf4cddb824f",
"revCount": 48,
"type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/ndp.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/ndp.git"
}
},
"nh": { "nh": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs" "nixpkgs": "nixpkgs"
@@ -730,14 +747,14 @@
"nixpkgs": [ "nixpkgs": [
"nixpkgs" "nixpkgs"
], ],
"systems": "systems_5" "systems": "systems_4"
}, },
"locked": { "locked": {
"lastModified": 1789825595, "lastModified": 1793448635,
"narHash": "sha256-vy7zsqnTB8mlGu1BoXKYuOfUyqIdMUS++CPrbaMDqvk=", "narHash": "sha256-fo5cEqZp/y6MyR9+7ktayGdIv50VcXtH2Pv/uLdAfQc=",
"owner": "nix-community", "owner": "nix-community",
"repo": "nix-jetbrains-plugins", "repo": "nix-jetbrains-plugins",
"rev": "9b2d6dbf6e2219e94f0ba2e9e2f6d6e8d0bf486f", "rev": "2564a112ec5fa4183da7281a1001e7e58c15a597",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -751,11 +768,11 @@
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_2"
}, },
"locked": { "locked": {
"lastModified": 1790321948, "lastModified": 1793355509,
"narHash": "sha256-mZGHLGi217oLIwzDM4PNRZeCNa6g2WBXURyXbNMFs7Y=", "narHash": "sha256-/Zs18x+IW4LuVH0rKxra0WPRgsk0DQsi0Bwkf8sOC5c=",
"owner": "nixos", "owner": "nixos",
"repo": "nixos-hardware", "repo": "nixos-hardware",
"rev": "30d48a0ec6035f8140d0125af274f0de95f1e9b5", "rev": "04c6b94fa104bc23650983a4513aea196794d321",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -783,11 +800,11 @@
}, },
"nixpkgs-stable": { "nixpkgs-stable": {
"locked": { "locked": {
"lastModified": 1790218706, "lastModified": 1793410479,
"narHash": "sha256-6e4Na3z008XpdVyOXgfasXIn1aN+z8AXFG+jXdQSyuI=", "narHash": "sha256-HzgjxrLY4AEc0044ZuM5CHbLSWLZgDlay1idmzvvpJs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "c508844df6c28fa6dabc1b6af70f3ccbd65c5201", "rev": "fa1373130d5a21c040a47c5dbe1913d59ed91808",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -812,11 +829,11 @@
}, },
"nixpkgs_3": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1790185690, "lastModified": 1793341285,
"narHash": "sha256-xJ+X4hBtOcAFGBOe5nAMyMUeF9foJBmIOu3NjBqBycU=", "narHash": "sha256-Y1CiZ4SoBUjLQyQM/pY+rS2dXD3CHLPstF0lmOc73D4=",
"owner": "nixos", "owner": "nixos",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "4975466d324710c576dc11ad614684e6bd8cad8e", "rev": "1c89083e451e891152365b799595cf7790a43325",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -856,11 +873,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1789514889, "lastModified": 1791909798,
"narHash": "sha256-PFD1nxptCXJyJoiYO1gf/5Vv43yqGpHtMC6LUhl9/pQ=", "narHash": "sha256-VAhpCOmrun/KXimYfR8NM88bciKCui7CqHHhThSzgag=",
"owner": "cachix", "owner": "cachix",
"repo": "git-hooks.nix", "repo": "git-hooks.nix",
"rev": "59f4ca0d063a1a3ec722c88b51a33004862e5379", "rev": "1ba1dbfe28738c9a71c266be6efa5b89e75491a9",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -877,11 +894,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1790753592, "lastModified": 1794479223,
"narHash": "sha256-ESPv4BdIlnEzIF8/XODt3S9coyH2OHPhRqNaYVGT8fc=", "narHash": "sha256-Ys2deXGT4PEbsaXBm+jDNFsk0DW6POT6tYNJzI/gycU=",
"ref": "main", "ref": "main",
"rev": "533aa1cc345c9224208fa017fe7c245a5878001a", "rev": "a01d74e9d528ee9a293319310c8d3496617f4539",
"revCount": 135, "revCount": 144,
"type": "git", "type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/puppy-tracker.git" "url": "ssh://gitea@git.ppp.pm:1122/alex/puppy-tracker.git"
}, },
@@ -894,15 +911,19 @@
"root": { "root": {
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"ct": "ct",
"dagbok": "dagbok",
"disko": "disko", "disko": "disko",
"emacs-overlay": "emacs-overlay", "emacs-overlay": "emacs-overlay",
"home-manager": "home-manager_2", "heldtenkeltdotse-site": "heldtenkeltdotse-site",
"home-manager": "home-manager",
"hyprland": "hyprland", "hyprland": "hyprland",
"hyprland-contrib": "hyprland-contrib", "hyprland-contrib": "hyprland-contrib",
"komga-bookmanager": "komga-bookmanager", "komga-bookmanager": "komga-bookmanager",
"komga-comictracker": "komga-comictracker", "komga-comictracker": "komga-comictracker",
"komga-reading-stats": "komga-reading-stats", "komga-reading-stats": "komga-reading-stats",
"naviterm": "naviterm", "naviterm": "naviterm",
"ndp": "ndp",
"nh": "nh", "nh": "nh",
"nix-gc-env": "nix-gc-env", "nix-gc-env": "nix-gc-env",
"nix-jetbrains-plugins": "nix-jetbrains-plugins", "nix-jetbrains-plugins": "nix-jetbrains-plugins",
@@ -911,7 +932,6 @@
"pppdotpm-site": "pppdotpm-site", "pppdotpm-site": "pppdotpm-site",
"puppy-tracker": "puppy-tracker", "puppy-tracker": "puppy-tracker",
"schema": "schema", "schema": "schema",
"solo-referee": "solo-referee",
"todo": "todo", "todo": "todo",
"whib-backend": "whib-backend", "whib-backend": "whib-backend",
"whib-frontend": "whib-frontend" "whib-frontend": "whib-frontend"
@@ -924,11 +944,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1790709196, "lastModified": 1793605066,
"narHash": "sha256-vOECM4pgVkSv0bsbM3kXSCb53p4cxRL6HNsWvB2vSbY=", "narHash": "sha256-HDquk/k2dLSbly5m209Z/VT4YCPIr0J9OhxUiIrIajA=",
"ref": "main", "ref": "main",
"rev": "c3e9e54ac9b69c205d3582e621fffef3dd0decea", "rev": "27921903aed5e587e62df764ce4fa0b7c9b538ed",
"revCount": 5, "revCount": 69,
"type": "git", "type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/schema.git" "url": "ssh://gitea@git.ppp.pm:1122/alex/schema.git"
}, },
@@ -938,44 +958,7 @@
"url": "ssh://gitea@git.ppp.pm:1122/alex/schema.git" "url": "ssh://gitea@git.ppp.pm:1122/alex/schema.git"
} }
}, },
"solo-referee": {
"inputs": {
"flake-utils": "flake-utils_4",
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1787992030,
"narHash": "sha256-YmUpFIy+YVr8e4qe95QZNmn7dqwExsKeBWqAOTAKMG0=",
"ref": "main",
"rev": "81b4725df14be407353d49cce2100a2f1bb49353",
"revCount": 79,
"type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/solo-referee.git"
},
"original": {
"ref": "main",
"type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/solo-referee.git"
}
},
"systems": { "systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": { "locked": {
"lastModified": 1689347949, "lastModified": 1689347949,
"narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=", "narHash": "sha256-12tWmuL2zgBgZkdoB6qXZsgJEH9LR3oUgpaQq2RbI80=",
@@ -990,6 +973,21 @@
"type": "github" "type": "github"
} }
}, },
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_3": { "systems_3": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1681028828,
@@ -1007,11 +1005,11 @@
}, },
"systems_4": { "systems_4": {
"locked": { "locked": {
"lastModified": 1681028828, "lastModified": 1791244623,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", "narHash": "sha256-uuanbkFk8a313Zfrxdcz8Us/yQtaxNnKJtX8v0ZPpd8=",
"owner": "nix-systems", "owner": "nix-systems",
"repo": "default", "repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", "rev": "d36eeed142f88b5a636f2e3856a53c61654cf29b",
"type": "github" "type": "github"
}, },
"original": { "original": {
@@ -1035,36 +1033,6 @@
"type": "github" "type": "github"
} }
}, },
"systems_6": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_7": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"todo": { "todo": {
"inputs": { "inputs": {
"nixpkgs": [ "nixpkgs": [
@@ -1114,11 +1082,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1790790340, "lastModified": 1790927912,
"narHash": "sha256-IA+vXd99fPksgLvnPf3k7S0qWmPwTR1VtS0wn+ibk8s=", "narHash": "sha256-zJY90RWK8nRFnzB5lFQb5E2+Yn/v2e0Ko0KyEF/vlgA=",
"ref": "master", "ref": "master",
"rev": "51e380d0b52d9106d6b3a1385683dd6185bb8131", "rev": "4563f7e849e1f035f6ff61e3c0e4e9cbc3c62c53",
"revCount": 225, "revCount": 231,
"type": "git", "type": "git",
"url": "ssh://gitea@git.ppp.pm:1122/alex/whib-react.git" "url": "ssh://gitea@git.ppp.pm:1122/alex/whib-react.git"
}, },
@@ -1130,6 +1098,14 @@
}, },
"xdph": { "xdph": {
"inputs": { "inputs": {
"aquamarine": [
"hyprland",
"aquamarine"
],
"hyprgraphics": [
"hyprland",
"hyprgraphics"
],
"hyprland-protocols": [ "hyprland-protocols": [
"hyprland", "hyprland",
"hyprland-protocols" "hyprland-protocols"
@@ -1138,6 +1114,10 @@
"hyprland", "hyprland",
"hyprlang" "hyprlang"
], ],
"hyprtoolkit": [
"hyprland",
"hyprtoolkit"
],
"hyprutils": [ "hyprutils": [
"hyprland", "hyprland",
"hyprutils" "hyprutils"
@@ -1156,11 +1136,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1788025068, "lastModified": 1793185370,
"narHash": "sha256-TBqronrrc/F2Ry/E37d/1TLldDLJDFNSwvJjgk+cXzU=", "narHash": "sha256-uyd3OAvtB2TJ9Y1RooCyLr6dlFUZKDmac5QtMbbPq4c=",
"owner": "hyprwm", "owner": "hyprwm",
"repo": "xdg-desktop-portal-hyprland", "repo": "xdg-desktop-portal-hyprland",
"rev": "ba31964ee42b56bcb0d3b78a64ead5d8a1c3c6f6", "rev": "d1467fea8d1895cb7835829c2fbb271a0d37760a",
"type": "github" "type": "github"
}, },
"original": { "original": {
+24 -6
View File
@@ -52,11 +52,23 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
ndp = {
url = "git+ssh://gitea@git.ppp.pm:1122/alex/ndp.git?ref=main";
# url = "git+file:///home/alex/code/own/ndp?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
};
pppdotpm-site = { pppdotpm-site = {
url = "git+ssh://gitea@git.ppp.pm:1122/alex/ppp.pm-site.git?ref=main"; url = "git+ssh://gitea@git.ppp.pm:1122/alex/ppp.pm-site.git?ref=main";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
heldtenkeltdotse-site = {
url = "git+ssh://gitea@git.ppp.pm:1122/alex/heldtenkelt.se-site.git?ref=main";
# url = "git+file:///home/alex/code/heldtenkelt.se-site?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
};
whib-backend = { whib-backend = {
url = "git+ssh://gitea@git.ppp.pm:1122/alex/whib.git?ref=master"; url = "git+ssh://gitea@git.ppp.pm:1122/alex/whib.git?ref=master";
# url = "path:/home/alex/code/own/whib"; # url = "path:/home/alex/code/own/whib";
@@ -93,12 +105,6 @@
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
solo-referee = {
url = "git+ssh://gitea@git.ppp.pm:1122/alex/solo-referee.git?ref=main";
# url = "path:/home/alex/code/solo-referee";
inputs.nixpkgs.follows = "nixpkgs";
};
schema = { schema = {
url = "git+ssh://gitea@git.ppp.pm:1122/alex/schema.git?ref=main"; url = "git+ssh://gitea@git.ppp.pm:1122/alex/schema.git?ref=main";
# url = "path:/home/alex/code/schema"; # url = "path:/home/alex/code/schema";
@@ -110,6 +116,18 @@
# url = "git+file:///home/alex/code/todo?ref=main"; # url = "git+file:///home/alex/code/todo?ref=main";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
dagbok = {
url = "git+ssh://gitea@git.ppp.pm:1122/alex/dagbok.git?ref=main";
# url = "git+file:///home/alex/code/own/dagbok?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
};
ct = {
url = "git+ssh://gitea@git.ppp.pm:1122/alex/ct.git?ref=main";
# url = "git+file:///home/alex/code/own/ct?ref=main";
inputs.nixpkgs.follows = "nixpkgs";
};
}; };
outputs = outputs =
+21 -8
View File
@@ -1,5 +1,4 @@
{ {
inputs,
lib, lib,
config, config,
... ...
@@ -8,8 +7,6 @@ let
configurationLimit = config.mod.gc.configurationLimit; configurationLimit = config.mod.gc.configurationLimit;
in in
{ {
imports = [ inputs.nix-gc-env.nixosModules.default ];
options = { options = {
mod.gc = { mod.gc = {
configurationLimit = lib.mkOption { configurationLimit = lib.mkOption {
@@ -21,15 +18,22 @@ in
}; };
config = { config = {
nix.gc = { # `nix.gc` cannot prune generations under `~/.local/state/nix/profiles`
automatic = true; # when run as root (NixOS/nix#8508), so home-manager generations piled up.
dates = "weekly"; # `nh clean` walks those per-user profiles too.
programs.nh = {
enable = true;
# `delete_generations` added by nix-gc-env clean = {
delete_generations = "+${builtins.toString configurationLimit}"; enable = true;
dates = "weekly";
extraArgs = "--keep ${builtins.toString configurationLimit}";
};
}; };
boot = { boot = {
tmp.cleanOnBoot = true;
loader = { loader = {
systemd-boot = { systemd-boot = {
enable = true; enable = true;
@@ -39,9 +43,18 @@ in
efi.canTouchEfiVariables = true; efi.canTouchEfiVariables = true;
}; };
blacklistedKernelModules = [ "hid_nintendo" ];
kernelParams = [
"i915.enable_dc=0"
"i915.disable_power_well=0"
];
extraModprobeConfig = '' extraModprobeConfig = ''
options snd-intel-dspcfg dsp_driver=1 options snd-intel-dspcfg dsp_driver=1
options snd_hda_intel power_save=0 power_save_controller=N options snd_hda_intel power_save=0 power_save_controller=N
options rtw88_core disable_lps_deep=y
options rtw88_pci disable_aspm=y
''; '';
}; };
}; };
@@ -1,5 +1,13 @@
{ pkgs, ... }: { pkgs, ... }:
{ {
programs.steam.enable = true;
services.udev.extraRules = ''
# 8BitDo in Nintendo Switch mode - allow Steam hidraw access
KERNEL=="hidraw*", ATTRS{idVendor}=="057e", ATTRS{idProduct}=="2009", \
MODE="0660", GROUP="input", TAG+="uaccess"
'';
home-manager.users.alex = { home-manager.users.alex = {
home.packages = [ home.packages = [
pkgs.nethack pkgs.nethack
+43
View File
@@ -0,0 +1,43 @@
{ lib, pkgs, ... }:
let
py = pkgs.python3Packages;
in
{
# The K400 Plus firmware turns two-finger swipes into coarse wheel ticks.
# This switches its touchpad to raw HID++ reporting and exposes it as a
# native multitouch touchpad, so GNOME scrolls it smoothly.
systemd.services.k400-touchpad = {
description = "Logitech K400 Plus raw touchpad bridge";
wants = [ "systemd-udevd.service" ];
after = [ "systemd-udevd.service" ];
wantedBy = [ "multi-user.target" ];
environment = {
# `toPythonModule` exposes Solaar's `logitech_receiver`. Not a
# `withPackages` env, since Solaar bundles a conflicting `hid_parser`.
PYTHONPATH = py.makePythonPath [
(py.toPythonModule pkgs.solaar)
py.evdev
py.pygobject3
];
# `logitech_receiver` imports Gdk at load time
GI_TYPELIB_PATH = lib.makeSearchPath "lib/girepository-1.0" [
pkgs.gtk3
pkgs.pango.out
pkgs.gdk-pixbuf
pkgs.harfbuzz
pkgs.gobject-introspection
];
};
serviceConfig = {
ExecStart = "${py.python.interpreter} ${./k400-touchpad.py}";
Restart = "on-failure";
RestartSec = 3;
TimeoutStopSec = 8;
};
};
boot.kernelModules = [ "uinput" ];
}
@@ -0,0 +1,648 @@
# Logitech K400 Plus raw touchpad bridge.
#
# Trimmed copy of the touchpad mode of k400-raw
# (https://github.com/Infinality/k400-raw, commit 04f2e58). The K400 Plus
# firmware quantizes touchpad movement into coarse mouse/wheel steps. This
# switches the touchpad to HID++ TOUCHPAD_RAW_XY (0x6100) reporting and
# exposes the raw contacts as a two-finger multitouch touchpad, so
# libinput/GNOME handle motion, tapping and scrolling. The keyboard and the
# physical buttons stay on the kernel's input device.
#
# Dropped from upstream: pointer mode, F-key configuration, CLI tunables and
# receiver/slot overrides.
#
# MIT License
#
# Copyright (c) 2026 Infinality
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import argparse
import logging
import signal
import struct
import threading
import time
from dataclasses import dataclass
from evdev import AbsInfo, UInput, ecodes
# Solaar warns at import time when libnotify is missing; nothing here sends
# desktop notifications
logging.getLogger("logitech_receiver.desktop_notifications").setLevel(logging.ERROR)
from logitech_receiver import base, listener # noqa: E402
from logitech_receiver import receiver as receiver_mod # noqa: E402
from logitech_receiver.hidpp20_constants import SupportedFeature # noqa: E402
LOG = logging.getLogger("k400-touchpad")
WPID_K400_PLUS = "404D"
RAW_FEATURE = SupportedFeature.TOUCHPAD_RAW_XY
RAW_FLAG = 0x01
ENHANCED_FLAG = 0x04
RAW_ENHANCED = RAW_FLAG | ENHANCED_FLAG
ORIGIN_LOWER_LEFT = 0x01
ORIGIN_LOWER_RIGHT = 0x02
ORIGIN_UPPER_RIGHT = 0x04
TOUCHPAD_NAME = "Logitech K400 Raw Touchpad"
FEATURE_WAIT_SECONDS = 15.0
RECONNECT_DELAY_SECONDS = 2.0
class DeviceNotReady(RuntimeError):
"""Expected transient state: the K400 is paired but asleep/offline."""
# --- HID++ raw report parsing ------------------------------------------------
@dataclass
class Touch:
finger_id: int
contact_status: int
x: int
y: int
@dataclass
class RawFrame:
spurious: bool
touches: tuple[Touch, Touch]
@dataclass
class TouchpadInfo:
x_size: int
y_size: int
max_fingers: int
origin: int
dpi: int
def parse_touch(data: bytes, offset: int) -> Touch:
x_high = data[offset]
y_high = data[offset + 2]
return Touch(
finger_id=data[offset + 6] >> 4,
contact_status=y_high >> 6,
x=((x_high & 0x3F) << 8) | data[offset + 1],
y=((y_high & 0x3F) << 8) | data[offset + 3],
)
def parse_frame(data: bytes) -> RawFrame | None:
if len(data) < 16:
return None
return RawFrame(
spurious=bool(data[8] & 0x02),
touches=(parse_touch(data, 2), parse_touch(data, 9)),
)
def parse_info(data: bytes) -> TouchpadInfo:
if not data or len(data) < 15:
raise RuntimeError(f"Short/empty TOUCHPAD_RAW_XY GetTouchpadInfo response: {data!r}")
return TouchpadInfo(
x_size=int.from_bytes(data[0:2], "big"),
y_size=int.from_bytes(data[2:4], "big"),
max_fingers=data[7],
origin=data[8],
dpi=int.from_bytes(data[13:15], "big"),
)
def active_touches(frame: RawFrame) -> list[Touch]:
touches = [t for t in frame.touches if t.finger_id != 0 and t.contact_status != 0]
if touches:
return touches
# Defensive fallback in case this firmware represents contact status
# differently while still supplying finger IDs.
return [t for t in frame.touches if t.finger_id != 0]
def origin_inversions(origin: int) -> tuple[bool, bool]:
# Screen-relative coordinates: +X right, +Y down.
invert_x = origin in (ORIGIN_LOWER_RIGHT, ORIGIN_UPPER_RIGHT)
invert_y = origin in (ORIGIN_LOWER_LEFT, ORIGIN_LOWER_RIGHT)
return invert_x, invert_y
# --- HID++ device access (via Solaar's logitech_receiver) --------------------
class StartedEventsListener(listener.EventsListener):
def __init__(self, receiver, callback):
self.started_event = threading.Event()
super().__init__(receiver, callback)
def has_started(self):
self.started_event.set()
@dataclass
class Candidate:
receiver: object
device: object
path: str
online: bool
has_raw_feature: bool
def find_k400():
"""Find the paired K400 Plus.
Prefer one that is awake and answers TOUCHPAD_RAW_XY, then one that is
awake. A sole paired K400 is used even while asleep; wait_for_feature()
then waits for it to wake.
"""
opened = []
candidates = []
for dev_info in base.receivers():
try:
r = receiver_mod.create_receiver(base, dev_info)
if not r:
continue
opened.append(r)
# Solaar stops iterating after the receiver's paired-device count
for dev in list(r):
if (dev.wpid or "").upper() != WPID_K400_PLUS:
continue
try:
online = bool(dev.ping())
except Exception:
online = False
has_raw_feature = False
if online:
try:
has_raw_feature = bool(dev.features[RAW_FEATURE])
except Exception as exc:
LOG.debug("K400 slot %d could not probe 0x6100: %s", dev.number, exc)
candidates.append(Candidate(r, dev, dev_info.path, online, has_raw_feature))
except Exception as exc:
LOG.debug("Unable to inspect receiver %s: %s", dev_info.path, exc)
preferred = (
[c for c in candidates if c.online and c.has_raw_feature]
or [c for c in candidates if c.online]
or candidates
)
selected = preferred[0] if len(preferred) == 1 else None
for r in opened:
if selected is None or r is not selected.receiver:
try:
r.close()
except Exception:
pass
if selected is None:
if not preferred:
raise RuntimeError("Could not find a paired Logitech K400 Plus")
if not any(c.online for c in preferred):
raise DeviceNotReady("Multiple paired K400 Plus records, none responding; waiting for one to wake")
locations = ", ".join(f"{c.path} slot {c.device.number}" for c in preferred)
raise RuntimeError(f"Found multiple responding K400 Plus devices: {locations}")
LOG.info(
"Selected K400 Plus on receiver %s slot %d (online=%s)",
selected.path, selected.device.number, selected.online,
)
return selected.receiver, selected.device
def wait_for_feature(dev, timeout_seconds: float, interval_seconds: float = 0.25) -> int:
"""Wake the device and wait for TOUCHPAD_RAW_XY to become queryable.
Solaar's FeaturesArray refuses feature discovery while dev.online is false,
and a K400 may be paired but asleep. Retry ping/feature discovery, falling
back to a direct ROOT.GetFeature query. If a transient lookup cached False,
the false entry is removed before installing the known-good feature index.
"""
deadline = time.monotonic() + timeout_seconds
last_error = None
while time.monotonic() < deadline:
try:
dev.ping()
except Exception as exc:
last_error = exc
if dev.online:
try:
index = dev.features[RAW_FEATURE]
if index:
return index
except Exception as exc:
last_error = exc
try:
response = dev.request(0x0000, struct.pack("!H", int(RAW_FEATURE)))
if response and response[0]:
index = response[0]
# FeaturesArray forbids deletion through its public API, so
# use the underlying dict operation only for this recovery
if dict.get(dev.features, RAW_FEATURE) is False:
dict.__delitem__(dev.features, RAW_FEATURE)
dev.features[RAW_FEATURE] = index
if len(response) > 1:
dev.features.flags[RAW_FEATURE] = response[1]
if len(response) > 2:
dev.features.version[RAW_FEATURE] = response[2]
return index
except Exception as exc:
last_error = exc
time.sleep(interval_seconds)
message = (
f"Timed out waiting for HID++ feature 0x{int(RAW_FEATURE):04X} "
f"(online={dev.online}; last error: {last_error!r})"
)
if not dev.online:
raise DeviceNotReady(message)
raise RuntimeError(message)
def enable_raw_reports(dev) -> None:
dev.feature_request(RAW_FEATURE, 0x20, bytes([RAW_ENHANCED]))
reply = dev.feature_request(RAW_FEATURE, 0x10)
if not reply or (reply[0] & RAW_FLAG) == 0:
raise RuntimeError(f"Failed to enable HID++ raw reporting; readback was {reply!r}")
if reply[0] != RAW_ENHANCED:
LOG.warning(
"Device did not preserve every requested state bit: requested=0x%02X actual=0x%02X",
RAW_ENHANCED, reply[0],
)
# --- Virtual touchpad --------------------------------------------------------
def make_absinfo(maximum: int, resolution: int = 0) -> AbsInfo:
return AbsInfo(value=0, min=0, max=maximum, fuzz=0, flat=0, resolution=resolution)
class VirtualTouchpad:
"""Translate K400 raw contacts into a two-slot Linux Type-B MT touchpad.
The uinput device is created on first connect and kept across HID++
reconnects, so the desktop keeps its settings for it.
"""
def __init__(self):
self.ui = None
self.geometry = None
self.invert_x = False
self.invert_y = False
# The HID++ listener thread and the reconnect loop both write events
self.lock = threading.Lock()
self.finger_to_slot: dict[int, int] = {}
self.slot_to_finger: dict[int, int] = {}
self.slot_xy: dict[int, tuple[int, int]] = {}
self.next_tracking_id = 1
self.last_btn_touch = 0
self.last_tool_finger = 0
self.last_tool_doubletap = 0
def configure(self, info: TouchpadInfo):
self.invert_x, self.invert_y = origin_inversions(info.origin)
resolution = max(1, round(info.dpi / 25.4))
geometry = (info.x_size, info.y_size, resolution)
if self.ui is not None:
if geometry != self.geometry:
LOG.warning(
"K400 geometry changed after reconnect: was %s now %s; keeping the original",
self.geometry, geometry,
)
return
self.geometry = geometry
x_max, y_max, _ = geometry
self.ui = UInput(
{
ecodes.EV_KEY: [ecodes.BTN_TOUCH, ecodes.BTN_TOOL_FINGER, ecodes.BTN_TOOL_DOUBLETAP],
ecodes.EV_ABS: [
(ecodes.ABS_X, make_absinfo(x_max, resolution)),
(ecodes.ABS_Y, make_absinfo(y_max, resolution)),
(ecodes.ABS_MT_SLOT, make_absinfo(1)),
(ecodes.ABS_MT_TRACKING_ID, make_absinfo(65535)),
(ecodes.ABS_MT_POSITION_X, make_absinfo(x_max, resolution)),
(ecodes.ABS_MT_POSITION_Y, make_absinfo(y_max, resolution)),
],
},
name=TOUCHPAD_NAME,
# Logitech's vendor ID with a deliberately synthetic product ID
vendor=0x046D,
product=0xF400,
version=1,
bustype=ecodes.BUS_USB,
phys="k400-touchpad/input0",
# Indirect pointing device, not a touchscreen
input_props=[ecodes.INPUT_PROP_POINTER],
)
LOG.info(
"Created virtual touchpad %s, %dx%d, %d units/mm (~%.1fx%.1f mm)",
self.ui.device.path if self.ui.device else self.ui.devnode,
x_max, y_max, resolution, x_max / resolution, y_max / resolution,
)
# Give udev/libinput time to pick up the device before the first events
time.sleep(0.5)
def _xy(self, touch: Touch) -> tuple[int, int]:
x_max, y_max, _ = self.geometry
x = x_max - touch.x if self.invert_x else touch.x
y = y_max - touch.y if self.invert_y else touch.y
return max(0, min(x_max, x)), max(0, min(y_max, y))
def _new_tracking_id(self) -> int:
tid = self.next_tracking_id
self.next_tracking_id = tid + 1 if tid < 65535 else 1
return tid
def release_all(self):
with self.lock:
if self.ui is None:
return
changed = False
for slot in sorted(self.slot_to_finger):
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_SLOT, slot)
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_TRACKING_ID, -1)
changed = True
self.finger_to_slot.clear()
self.slot_to_finger.clear()
self.slot_xy.clear()
for code, attr in (
(ecodes.BTN_TOUCH, "last_btn_touch"),
(ecodes.BTN_TOOL_FINGER, "last_tool_finger"),
(ecodes.BTN_TOOL_DOUBLETAP, "last_tool_doubletap"),
):
if getattr(self, attr):
self.ui.write(ecodes.EV_KEY, code, 0)
setattr(self, attr, 0)
changed = True
if changed:
self.ui.syn()
def process(self, frame: RawFrame):
if frame.spurious:
return
# The K400 reports at most two contacts. If malformed data ever
# contains duplicate IDs, keep only the first occurrence.
current = {}
for touch in active_touches(frame):
current.setdefault(touch.finger_id, touch)
with self.lock:
if self.ui is None:
return
old_ids = set(self.finger_to_slot)
new_ids = set(current)
# Release vanished contacts first so a slot can be reused this frame
for finger_id in sorted(old_ids - new_ids):
slot = self.finger_to_slot.pop(finger_id)
self.slot_to_finger.pop(slot, None)
self.slot_xy.pop(slot, None)
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_SLOT, slot)
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_TRACKING_ID, -1)
for finger_id in sorted(new_ids - old_ids):
free = next((s for s in (0, 1) if s not in self.slot_to_finger), None)
if free is None:
LOG.warning("More contacts than MT slots; ignoring finger id %d", finger_id)
continue
self.finger_to_slot[finger_id] = free
self.slot_to_finger[free] = finger_id
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_SLOT, free)
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_TRACKING_ID, self._new_tracking_id())
# Emit every tracked contact each frame so libinput sees the raw
# sensor report cadence
for finger_id, slot in sorted(self.finger_to_slot.items(), key=lambda p: p[1]):
touch = current.get(finger_id)
if touch is None:
continue
x, y = self._xy(touch)
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_SLOT, slot)
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_POSITION_X, x)
self.ui.write(ecodes.EV_ABS, ecodes.ABS_MT_POSITION_Y, y)
self.slot_xy[slot] = (x, y)
count = len(self.slot_to_finger)
# Touchpads also need the legacy single-touch axes; mirror the
# lowest-numbered active slot
if count:
xy = self.slot_xy.get(min(self.slot_to_finger))
if xy is not None:
self.ui.write(ecodes.EV_ABS, ecodes.ABS_X, xy[0])
self.ui.write(ecodes.EV_ABS, ecodes.ABS_Y, xy[1])
for code, attr, value in (
(ecodes.BTN_TOUCH, "last_btn_touch", int(count > 0)),
(ecodes.BTN_TOOL_FINGER, "last_tool_finger", int(count == 1)),
(ecodes.BTN_TOOL_DOUBLETAP, "last_tool_doubletap", int(count >= 2)),
):
if value != getattr(self, attr):
self.ui.write(ecodes.EV_KEY, code, value)
setattr(self, attr, value)
self.ui.syn()
def close(self):
self.release_all()
if self.ui is not None:
self.ui.close()
self.ui = None
# --- Session / reconnect loop ------------------------------------------------
def run(touchpad: VirtualTouchpad, stop: threading.Event):
session = 0
while not stop.is_set():
session += 1
r = dev = events = None
feature_index = None
old_raw_state = None
raw_enabled = False
reconfigure = threading.Event()
reconfigure_failures = 0
try:
r, dev = find_k400()
feature_index = wait_for_feature(dev, FEATURE_WAIT_SECONDS)
info = parse_info(dev.feature_request(RAW_FEATURE, 0x00))
LOG.info(
"K400 raw surface: %dx%d, dpi=%d, origin=%d, max_fingers=%d",
info.x_size, info.y_size, info.dpi, info.origin, info.max_fingers,
)
touchpad.configure(info)
def callback(n):
if n.devnumber != dev.number:
return
# Receiver connection notification; the K400 forgets raw mode
# while asleep, so re-enable it on every link-up
if n.sub_id == 0x41:
flags = (n.data[0] & 0xF0) if n.data else 0x40
dev.online = not (flags & 0x40)
touchpad.release_all()
if dev.online:
LOG.debug("K400 link established; re-enabling raw mode")
reconfigure.set()
else:
LOG.debug("K400 asleep/offline")
return
if n.sub_id != feature_index or (n.address >> 4) != 0x00:
return
frame = parse_frame(n.data)
if frame is None:
LOG.warning("Short raw XY notification: %r", n.data)
return
touchpad.process(frame)
events = StartedEventsListener(r, callback)
events.start()
if not events.started_event.wait(timeout=3.0):
raise RuntimeError("Timed out starting HID++ receiver listener")
state_reply = dev.feature_request(RAW_FEATURE, 0x10)
old_raw_state = state_reply[0] if state_reply else 0x00
enable_raw_reports(dev)
raw_enabled = True
LOG.info("K400 raw touchpad active (receiver slot %d)", dev.number)
while not stop.is_set():
if not events.is_alive():
raise ConnectionError("HID++ receiver listener stopped")
if not reconfigure.wait(timeout=1.0):
continue
reconfigure.clear()
if stop.is_set():
break
touchpad.release_all()
try:
feature_index = wait_for_feature(dev, min(FEATURE_WAIT_SECONDS, 4.0))
enable_raw_reports(dev)
reconfigure_failures = 0
LOG.info("K400 raw mode re-enabled after wake")
except DeviceNotReady as exc:
reconfigure_failures = 0
LOG.debug("K400 went offline during re-enable (%s); waiting for next link-up", exc)
except Exception as exc:
reconfigure_failures += 1
if not events.is_alive() or reconfigure_failures >= 3:
raise ConnectionError("Repeated raw-mode re-enable failure") from exc
LOG.debug("Transient re-enable failure %d/3: %s", reconfigure_failures, exc)
if stop.wait(RECONNECT_DELAY_SECONDS):
break
reconfigure.set()
except DeviceNotReady as exc:
LOG.debug("K400 not ready (%s); retrying", exc)
except Exception as exc:
if stop.is_set():
break
LOG.warning(
"K400 HID++ session #%d lost (%s). Retrying in %.1f s.",
session, exc, RECONNECT_DELAY_SECONDS,
exc_info=LOG.isEnabledFor(logging.DEBUG),
)
finally:
try:
touchpad.release_all()
except Exception:
LOG.debug("Error releasing touches", exc_info=True)
if stop.is_set() and dev is not None and raw_enabled:
try:
restore = 0x00 if old_raw_state is None else old_raw_state
dev.feature_request(RAW_FEATURE, 0x20, bytes([restore]))
LOG.info("Restored HID++ raw-report state to 0x%02X", restore)
except Exception:
LOG.warning("Could not restore raw-report state during shutdown")
if events is not None:
try:
events.stop()
events.join(timeout=2.0)
except Exception:
LOG.debug("Error stopping receiver listener", exc_info=True)
if r is not None:
try:
r.close()
except Exception:
LOG.debug("Error closing receiver", exc_info=True)
if not stop.is_set():
stop.wait(RECONNECT_DELAY_SECONDS)
def main():
parser = argparse.ArgumentParser(description="Logitech K400 Plus raw touchpad bridge")
parser.add_argument("-v", "--verbose", action="count", default=0, help="-v for info, -vv for debug")
args = parser.parse_args()
# Keep Solaar's own logging at WARNING so journald isn't flooded with
# HID++ frames
logging.basicConfig(level=logging.WARNING, format="%(levelname)-8s %(name)s: %(message)s")
LOG.setLevel([logging.WARNING, logging.INFO, logging.DEBUG][min(args.verbose, 2)])
touchpad = VirtualTouchpad()
stop = threading.Event()
def on_signal(signum, _frame):
LOG.info("Received signal %s; stopping", signum)
stop.set()
signal.signal(signal.SIGINT, on_signal)
signal.signal(signal.SIGTERM, on_signal)
try:
run(touchpad, stop)
finally:
touchpad.close()
if __name__ == "__main__":
main()
+20
View File
@@ -31,6 +31,13 @@ in
Port = 1122; Port = 1122;
}; };
"pinwheel" = {
HostName = "pinwheel";
User = "alex";
IdentityFile = "/home/alex/.ssh/alex.backwards-pinwheel";
Port = 1122;
};
"git.ppp.pm" = { "git.ppp.pm" = {
HostName = "git.ppp.pm"; HostName = "git.ppp.pm";
IdentityFile = "/home/alex/.ssh/alex.backwards-git.ppp.pm"; IdentityFile = "/home/alex/.ssh/alex.backwards-git.ppp.pm";
@@ -115,6 +122,19 @@ in
group = "users"; group = "users";
}; };
"alex.backwards-pinwheel" = {
file = ../../../../secrets/backwards/alex.backwards-pinwheel.age;
path = "/home/alex/.ssh/alex.backwards-pinwheel";
owner = "alex";
group = "users";
};
"alex.backwards-pinwheel.pub" = {
file = ../../../../secrets/backwards/alex.backwards-pinwheel.pub.age;
path = "/home/alex/.ssh/alex.backwards-pinwheel.pub";
owner = "alex";
group = "users";
};
"alex.pinwheel-backwards.pub" = { "alex.pinwheel-backwards.pub" = {
file = ../../../../secrets/pinwheel/alex.pinwheel-backwards.pub.age; file = ../../../../secrets/pinwheel/alex.pinwheel-backwards.pub.age;
path = "${authorizedKeysPath}/alex.pinwheel-backwards.pub"; path = "${authorizedKeysPath}/alex.pinwheel-backwards.pub";
+42 -2
View File
@@ -1,9 +1,49 @@
{ ... }:
{ {
services.tailscale.enable = true; config,
lib,
pkgs,
...
}:
{
services.tailscale = {
enable = true;
# Required for the systray to control tailscale without root
extraSetFlags = [ "--operator=alex" ];
};
networking.firewall = { networking.firewall = {
checkReversePath = "loose"; checkReversePath = "loose";
allowedUDPPorts = [ 41641 ]; allowedUDPPorts = [ 41641 ];
}; };
home-manager.users.alex = {
# The official tailscale systray, including the node list and exit nodes
services.tailscale-systray = {
enable = true;
package = config.services.tailscale.package;
};
# The systray never retries if no tray exists when it starts, so wait for the
# AppIndicator extension to provide one. This is done in the main process,
# rather than `ExecStartPre`, to not block activation while waiting
systemd.user.services.tailscale-systray.Service.ExecStart = lib.mkForce (toString (
pkgs.writeShellScript "tailscale-systray" ''
until ${pkgs.systemd}/bin/busctl --user status org.kde.StatusNotifierWatcher >/dev/null 2>&1; do
sleep 1
done
exec ${lib.getExe config.services.tailscale.package} systray
''
));
programs.gnome-shell = {
enable = true;
extensions = [
# GNOME has no system tray without it
{ package = pkgs.gnomeExtensions.appindicator; }
];
};
};
} }
+3
View File
@@ -86,6 +86,9 @@
services.zfs.autoScrub.enable = true; services.zfs.autoScrub.enable = true;
# Cap the ARC at 4 GiB (default is ~all of RAM); leaves room for services on this low-memory host.
boot.kernelParams = [ "zfs.zfs_arc_max=${toString (4 * 1024 * 1024 * 1024)}" ];
# Don't force-import the pool if it appears in use elsewhere; safer default in 26.11+. # Don't force-import the pool if it appears in use elsewhere; safer default in 26.11+.
boot.zfs.forceImportRoot = false; boot.zfs.forceImportRoot = false;
+1 -1
View File
@@ -16,7 +16,7 @@ in
host = "0.0.0.0"; host = "0.0.0.0";
inherit port; inherit port;
openFirewall = true; openFirewall = true;
openRegistration = true; openRegistration = false;
database.createLocally = true; database.createLocally = true;
}; };
}; };
+2
View File
@@ -30,6 +30,8 @@ in
}; };
boot = { boot = {
tmp.cleanOnBoot = true;
loader = { loader = {
systemd-boot = { systemd-boot = {
enable = true; enable = true;
+1
View File
@@ -31,6 +31,7 @@ in
"puppy.ppp.pm" "puppy.ppp.pm"
"todo.ppp.pm" "todo.ppp.pm"
"schema.ppp.pm" "schema.ppp.pm"
"dagbok.ppp.pm"
] (_: hetznerCert); ] (_: hetznerCert);
}; };
+59
View File
@@ -0,0 +1,59 @@
{
inputs,
lib,
config,
...
}:
let
enabled = config.mod.dagbok.enable;
nginxEnabled = config.mod.nginx.enable;
port = 8093;
in
{
options = {
mod.dagbok = {
enable = lib.mkEnableOption "Enable dagbok module";
};
};
imports = [
inputs.dagbok.nixosModules.default
];
config = lib.mkIf enabled {
mod.homepage.services = [
{
name = "Dagbok";
port = port;
description = "Work and personal journal";
url = "https://dagbok.ppp.pm";
}
];
services.dagbok = {
enable = true;
address = "127.0.0.1";
inherit port;
secureCookies = true;
timeZone = "Europe/Stockholm";
publicUrl = "https://dagbok.ppp.pm";
tokenFile = config.age.secrets."dagbok-token".path;
};
services.nginx = lib.mkIf nginxEnabled {
virtualHosts."dagbok.ppp.pm" = {
forceSSL = true;
useACMEHost = "dagbok.ppp.pm";
extraConfig = ''
client_max_body_size 32m;
'';
locations."/" = {
proxyPass = "http://127.0.0.1:${toString port}";
};
};
};
age.secrets."dagbok-token".file = ../../../../secrets/manatee/dagbok-token.age;
};
}
+1 -1
View File
@@ -27,10 +27,10 @@ in
homepage.enable = true; homepage.enable = true;
disk-smart.enable = true; disk-smart.enable = true;
puppy-tracker.enable = true; puppy-tracker.enable = true;
solo-referee.enable = true;
todo.enable = true; todo.enable = true;
schema.enable = true; schema.enable = true;
atuin.enable = true; atuin.enable = true;
dagbok.enable = true;
}; };
}; };
} }
@@ -22,12 +22,52 @@ frontend:
themes: !include_dir_merge_named themes themes: !include_dir_merge_named themes
automation: !include automations.yaml automation: !include automations.yaml
automation nix:
# pyplejd keeps using a dead BLE client forever ("Service Discovery has not
# been performed yet") instead of reconnecting; reloading the integration fixes it
- alias: Reload Plejd when its BLE link goes stale
mode: single
triggers:
- trigger: event
event_type: system_log_event
event_data:
level: WARNING
conditions:
- "{{ 'pyplejd' in trigger.event.data.name and 'Service Discovery has not been performed yet' in (trigger.event.data.message | join(' ')) }}"
actions:
- action: homeassistant.reload_config_entry
target:
entity_id: light.takbelysning
# With mode: single, this caps it at one reload per 5 minutes
- delay: "00:05:00"
script: !include scripts.yaml script: !include scripts.yaml
scene: !include scenes.yaml scene: !include scenes.yaml
recorder: recorder:
purge_keep_days: 365 purge_keep_days: 365
# Turns logged warnings/errors into `system_log_event`s that automations can react to
system_log:
fire_event: true
notify:
# Send notifications to `phones` so they reach every phone
- platform: group
name: phones
services:
- action: mobile_app_pixel_9_pro
- action: mobile_app_iphone
template:
- binary_sensor:
- name: Galleriet too warm
unique_id: galleriet_too_warm
state: "{{ states('sensor.3rd_temp_och_fuktmatare_temperature') | float(0) > 23 }}"
availability: "{{ has_value('sensor.3rd_temp_och_fuktmatare_temperature') }}"
# Stops a temperature hovering around 23 from re-triggering the alert
delay_off: "00:15:00"
alert: alert:
fridge_door: fridge_door:
name: Fridge is open name: Fridge is open
@@ -36,6 +76,36 @@ alert:
state: "on" state: "on"
repeat: 2 repeat: 2
skip_first: true skip_first: true
notifiers:
- phones
kitchen_water_leak:
name: Water leak detected in the kitchen
done_message: Kitchen is dry again
entity_id: binary_sensor.vattenlackage_1_flood
state: "on"
repeat: 5
notifiers:
- phones
data:
ttl: 0
priority: high
# Plays on the alarm stream so it sounds even when the phone is silenced
channel: alarm_stream
# iOS equivalent: a critical alert, which bypasses silent mode and Focus
push:
sound:
name: default
critical: 1
volume: 1.0
galleriet_too_warm:
name: Galleriet is above 23°C
message: "Galleriet is {{ states('sensor.3rd_temp_och_fuktmatare_temperature') }}°C"
done_message: Galleriet is below 23°C again
entity_id: binary_sensor.galleriet_too_warm
state: "on"
repeat: 60
notifiers: notifiers:
- mobile_app_pixel_9_pro - mobile_app_pixel_9_pro
@@ -50,6 +120,7 @@ ${cfg.extraConfig}'';
pkgs.kmod pkgs.kmod
pkgs.gnugrep pkgs.gnugrep
pkgs.coreutils pkgs.coreutils
pkgs.systemd
] ]
}" }"
@@ -251,7 +322,7 @@ in
]; ];
script = '' script = ''
SUBDOMAINS="ha komga romm puppy todo schema" SUBDOMAINS="ha komga romm puppy todo schema dagbok"
INTERFACE="enp3s0" INTERFACE="enp3s0"
CURRENT_IP=$(curl -s --fail --interface "$INTERFACE" ifconfig.me) CURRENT_IP=$(curl -s --fail --interface "$INTERFACE" ifconfig.me)
+6
View File
@@ -114,6 +114,12 @@ in
libraryId = "0PNE1NEPY6995"; libraryId = "0PNE1NEPY6995";
}; };
# `libraryRoot` is bind mounted into the service's own mount namespace when it
# starts, so starting before the ZFS dataset is mounted leaves it with an empty folder
systemd.services.komga-book-manager.unitConfig.RequiresMountsFor = [
config.services.komga-book-manager.libraryRoot
];
services.komga-reading-stats = { services.komga-reading-stats = {
enable = true; enable = true;
host = "0.0.0.0"; host = "0.0.0.0";
@@ -1,4 +1,5 @@
{ {
inputs,
lib, lib,
pkgs, pkgs,
config, config,
@@ -8,6 +9,8 @@ let
navidromeEnabled = config.mod.navidrome.enable; navidromeEnabled = config.mod.navidrome.enable;
in in
{ {
imports = [ inputs.ndp.nixosModules.lbsync ];
options = { options = {
mod.navidrome = { mod.navidrome = {
enable = lib.mkEnableOption "Enable navidrome module"; enable = lib.mkEnableOption "Enable navidrome module";
@@ -35,7 +38,22 @@ in
Address = "0.0.0.0"; Address = "0.0.0.0";
MusicFolder = "/mnt/media/public/music"; MusicFolder = "/mnt/media/public/music";
}; };
lbsync = {
enable = true;
settingsFile = config.age.secrets."lbsync-config".path;
}; };
}; };
}; };
age.secrets."lbsync-config" = lib.mkIf navidromeEnabled {
file = ../../../../secrets/manatee/lbsync-config.age;
};
# `MusicFolder` is bind mounted into the service's own mount namespace when it
# starts, so starting before the ZFS dataset is mounted leaves it with an empty folder
systemd.services.navidrome = lib.mkIf navidromeEnabled {
unitConfig.RequiresMountsFor = [ config.services.navidrome.settings.MusicFolder ];
};
};
} }
+15 -6
View File
@@ -51,11 +51,14 @@ let
--exclude='__pycache__/' \ --exclude='__pycache__/' \
"$@" \ "$@" \
"$src/" "$dst/" "$src/" "$dst/"
# find -H: with DynamicUser, /var/lib/<name> is a symlink into
# /var/lib/private, and plain find stops at the link and finds no
# databases (rsync follows "$src/", but excludes them on purpose).
while IFS= read -r db; do while IFS= read -r db; do
local rel="''${db#"$src"/}" local rel="''${db#"$src"/}"
install -d -m700 "$dst/$(dirname "$rel")" install -d -m700 "$dst/$(dirname "$rel")"
sqlite3 "$db" ".backup '$dst/$rel'" sqlite3 "$db" ".backup '$dst/$rel'"
done < <(find "$src" -maxdepth 4 -type f \( -name '*.sqlite' -o -name '*.db' \)) done < <(find -H "$src" -maxdepth 4 -type f \( -name '*.sqlite' -o -name '*.db' \))
} }
# --- romm: logical MariaDB dump + user assets (saves/states/screenshots) --- # --- romm: logical MariaDB dump + user assets (saves/states/screenshots) ---
@@ -102,15 +105,21 @@ let
snapshot /var/lib/jellyfin "$STATE/jellyfin" --exclude='transcodes/' --exclude='cache/' --exclude='metadata/' --exclude='log/' --exclude='data/subtitles/' snapshot /var/lib/jellyfin "$STATE/jellyfin" --exclude='transcodes/' --exclude='cache/' --exclude='metadata/' --exclude='log/' --exclude='data/subtitles/'
snapshot /var/lib/audiobookshelf "$STATE/audiobookshelf" --exclude='metadata/' snapshot /var/lib/audiobookshelf "$STATE/audiobookshelf" --exclude='metadata/'
snapshot /var/lib/puppy-tracker "$STATE/puppy-tracker" snapshot /var/lib/puppy-tracker "$STATE/puppy-tracker"
snapshot /var/lib/solo-referee "$STATE/solo-referee"
snapshot /var/lib/todo "$STATE/todo" snapshot /var/lib/todo "$STATE/todo"
snapshot /var/lib/schema "$STATE/schema" snapshot /var/lib/schema "$STATE/schema"
snapshot /var/lib/dagbok "$STATE/dagbok"
snapshot /var/lib/komga-book-manager "$STATE/komga-book-manager" snapshot /var/lib/komga-book-manager "$STATE/komga-book-manager"
snapshot /var/lib/komga-reading-stats "$STATE/komga-reading-stats" snapshot /var/lib/komga-reading-stats "$STATE/komga-reading-stats"
echo "state-backup: dump complete" echo "state-backup: dump complete"
''; '';
# A run killed mid-way (e.g. DNS dropping during an upload) leaves its lock
# behind, and every later run then fails in the pre-start "cat config"
# check. unlock only removes stale locks; "|| true" keeps a first run
# against a not-yet-initialized repo working.
backupPrepareCommand = "${pkgs.restic}/bin/restic unlock || true";
# Retention shared by all jobs. # Retention shared by all jobs.
pruneOpts = [ pruneOpts = [
"--keep-daily 1" "--keep-daily 1"
@@ -138,7 +147,7 @@ in
OnCalendar = "*-*-* 0/12:00:00"; OnCalendar = "*-*-* 0/12:00:00";
Persistent = true; Persistent = true;
}; };
inherit pruneOpts; inherit pruneOpts backupPrepareCommand;
}; };
"sync-to-cloud" = { "sync-to-cloud" = {
@@ -151,7 +160,7 @@ in
OnCalendar = "*-*-* 0/12:00:00"; OnCalendar = "*-*-* 0/12:00:00";
Persistent = true; Persistent = true;
}; };
inherit pruneOpts; inherit pruneOpts backupPrepareCommand;
}; };
# Service state (databases etc.). No timer of their own: the state-backup # Service state (databases etc.). No timer of their own: the state-backup
@@ -163,7 +172,7 @@ in
paths = [ stateDir ]; paths = [ stateDir ];
repository = "/mnt/backup/restic"; repository = "/mnt/backup/restic";
timerConfig = null; timerConfig = null;
inherit pruneOpts; inherit pruneOpts backupPrepareCommand;
}; };
"state-to-cloud" = { "state-to-cloud" = {
@@ -173,7 +182,7 @@ in
repositoryFile = config.age.secrets.restic-cloud-sync-repository.path; repositoryFile = config.age.secrets.restic-cloud-sync-repository.path;
paths = [ stateDir ]; paths = [ stateDir ];
timerConfig = null; timerConfig = null;
inherit pruneOpts; inherit pruneOpts backupPrepareCommand;
}; };
}; };
-12
View File
@@ -39,20 +39,8 @@ in
secureCookies = true; secureCookies = true;
inviteCodeFile = config.age.secrets."schema-invite-code".path; inviteCodeFile = config.age.secrets."schema-invite-code".path;
timeZone = "Europe/Stockholm"; timeZone = "Europe/Stockholm";
# Walks and meals logged in puppy-tracker tick off dog duties here. Needs
# the integration endpoint from puppy-tracker (see below) to be deployed.
# puppyTracker = {
# url = "http://127.0.0.1:8089";
# tokenFile = config.age.secrets."schema-puppy-token".path;
# };
}; };
# The other half of the puppy-tracker link, enabled together with the
# block above once puppy-tracker with integration.tokenFile is pushed.
# services.puppy-tracker.integration.tokenFile = config.age.secrets."schema-puppy-token".path;
# age.secrets."schema-puppy-token".file = ../../../../secrets/manatee/schema-puppy-token.age;
services.nginx = lib.mkIf nginxEnabled { services.nginx = lib.mkIf nginxEnabled {
virtualHosts."schema.ppp.pm" = { virtualHosts."schema.ppp.pm" = {
forceSSL = true; forceSSL = true;
@@ -1,46 +0,0 @@
{
inputs,
lib,
config,
...
}:
let
enabled = config.mod.solo-referee.enable;
port = 8090;
in
{
options = {
mod.solo-referee = {
enable = lib.mkEnableOption "Enable solo-referee module";
};
};
imports = [
inputs.solo-referee.nixosModules.default
];
config = lib.mkIf enabled {
mod.homepage.services = [
{
name = "Solo Referee";
port = port;
description = "Solo-RPG tool with Claude as GM";
# url omitted → homepage links to http://manatee:${port}.
}
];
services.solo-referee = {
enable = true;
inherit port;
# Reachable on the LAN / Tailscale at manatee:${port}; no public vhost.
address = "0.0.0.0";
openFirewall = true;
# Anthropic API key kept out of the store; the file holds
# `ANTHROPIC_API_KEY=...`. Without it the offline stub GM runs.
apiKeyFile = config.age.secrets."solo-referee-api-key".path;
};
age.secrets."solo-referee-api-key".file =
../../../../secrets/manatee/solo-referee-api-key.age;
};
}
+20
View File
@@ -29,6 +29,13 @@ in
identityFile = "/home/alex/.ssh/alex.manatee-git.ppp.pm"; identityFile = "/home/alex/.ssh/alex.manatee-git.ppp.pm";
}; };
"tadpole" = {
hostname = "65.21.106.222";
user = "alex";
identityFile = "/home/alex/.ssh/alex.manatee-tadpole";
port = 1122;
};
"*" = { "*" = {
forwardAgent = false; forwardAgent = false;
addKeysToAgent = "no"; addKeysToAgent = "no";
@@ -115,6 +122,19 @@ in
owner = "alex"; owner = "alex";
group = "users"; group = "users";
}; };
"alex.manatee-tadpole" = {
file = ../../../../secrets/manatee/alex.manatee-tadpole.age;
path = "/home/alex/.ssh/alex.manatee-tadpole";
owner = "alex";
group = "users";
};
"alex.manatee-tadpole.pub" = {
file = ../../../../secrets/manatee/alex.manatee-tadpole.pub.age;
path = "/home/alex/.ssh/alex.manatee-tadpole.pub";
owner = "alex";
group = "users";
};
}; };
}; };
} }
-2
View File
@@ -41,8 +41,6 @@ in
# Remove date/time etc. on the right side # Remove date/time etc. on the right side
set -g status-right "" set -g status-right ""
bind r source-file ~/.config/tmux/tmux.conf \; display "Config reloaded"
# Remove accidental `suspend-client` triggers # Remove accidental `suspend-client` triggers
unbind C-z unbind C-z
@@ -52,5 +52,12 @@ in
}; };
}; };
}; };
# Both paths are bind mounted into the service's own mount namespace when it
# starts, so starting before the ZFS dataset is mounted writes to the root disk
systemd.services.transmission.unitConfig.RequiresMountsFor = [
config.services.transmission.home
config.services.transmission.settings.download-dir
];
}; };
} }
+41 -6
View File
@@ -1,4 +1,5 @@
{ {
inputs,
pkgs, pkgs,
lib, lib,
config, config,
@@ -27,11 +28,22 @@ let
inherit statusLine; inherit statusLine;
theme = "dark"; theme = "dark";
editorMode = "vim"; editorMode = "vim";
cleanupPeriodDays = 3650;
attribution = { attribution = {
commit = ""; commit = "";
pr = ""; pr = "";
}; };
hooks = { hooks = {
SessionStart = [
{
hooks = [
{
type = "command";
command = "tmux-panes claude-session";
}
];
}
];
PostToolUse = [ PostToolUse = [
{ {
matcher = "Write|Edit"; matcher = "Write|Edit";
@@ -45,6 +57,8 @@ let
]; ];
}; };
}; };
settingsFile = pkgs.writeText "claude-settings.json" settings;
in in
{ {
options = { options = {
@@ -53,11 +67,12 @@ in
}; };
}; };
config = lib.mkIf enabled { config = lib.mkMerge [
{ home-manager.sharedModules = [ inputs.ct.homeManagerModules.default ]; }
(lib.mkIf enabled {
home-manager.users.alex = { home-manager.users.alex = {
home.packages = [ home.packages = [ pkgs.claude-code ];
pkgs.claude-code
];
programs.zsh.shellAliases = { programs.zsh.shellAliases = {
claude = "pclaude"; claude = "pclaude";
@@ -65,8 +80,28 @@ in
pclaude = "CLAUDE_CONFIG_DIR=$HOME/.claude-personal command claude"; pclaude = "CLAUDE_CONFIG_DIR=$HOME/.claude-personal command claude";
}; };
home.file.".claude-work/settings.json".text = settings; home.activation.claudeSettings = {
home.file.".claude-personal/settings.json".text = settings; 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;
web.enable = true;
settings.profiles = {
work.configDir = "/home/alex/.claude-work";
personal.configDir = "/home/alex/.claude-personal";
}; };
}; };
};
})
];
} }
+9
View File
@@ -14,15 +14,24 @@ in
programs.atuin = { programs.atuin = {
enable = true; enable = true;
enableZshIntegration = true; enableZshIntegration = true;
flags = [ "--disable-up-arrow" ];
settings = { settings = {
sync_address = "http://manatee:8889"; sync_address = "http://manatee:8889";
auto_sync = true; auto_sync = true;
sync_frequency = "5m"; sync_frequency = "5m";
key_path = config.age.secrets."atuin-key".path;
ctrl_n_shortcuts = false;
}; };
}; };
programs.fzf.historyWidget.command = ""; programs.fzf.historyWidget.command = "";
}; };
age.secrets."atuin-key" = {
file = ../../../../secrets/pinwheel/atuin-key.age;
owner = "alex";
group = "users";
};
}; };
} }
+37 -4
View File
@@ -1,12 +1,45 @@
let
bar = "2c2c2c";
in
{ {
lib = { lib = {
colors = { colors = {
foreground = "bd93f9"; foreground = "ffb347";
foreground-dim = "644294"; foreground-dim = "8a5a20";
background = "1E1E2F"; background = bar;
gray = "3a3a3a"; 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
];
};
}; };
}; };
} }
+95 -4
View File
@@ -86,8 +86,24 @@
* Setup * Setup
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
#+END_SRC #+END_SRC
** Use wl-clipboard for interprocess copy/paste ** Use wl-clipboard and OSC 52 for interprocess copy/paste
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq kill-do-not-save-duplicates t)
(defun alex/osc52-copy (text)
(unless (display-graphic-p)
(send-string-to-terminal
(concat "\e]52;c;"
(base64-encode-string (encode-coding-string text 'utf-8) t)
"\a"))))
(defun alex/clipboard-copy (text)
(alex/osc52-copy text)
(when (fboundp 'wl-copy)
(wl-copy text)))
(setq interprogram-cut-function 'alex/clipboard-copy)
(setq wl-copy-process nil) (setq wl-copy-process nil)
(when (string-prefix-p "wayland" (getenv "WAYLAND_DISPLAY")) (when (string-prefix-p "wayland" (getenv "WAYLAND_DISPLAY"))
(defun wl-copy (text) (defun wl-copy (text)
@@ -103,7 +119,6 @@
nil ; should return nil if we're the current paste owner nil ; should return nil if we're the current paste owner
(shell-command-to-string "wl-paste -n | tr -d \r"))) (shell-command-to-string "wl-paste -n | tr -d \r")))
(setq interprogram-cut-function 'wl-copy)
(setq interprogram-paste-function 'wl-paste)) (setq interprogram-paste-function 'wl-paste))
#+END_SRC #+END_SRC
** Don't create backup files, don't create #autosave# files ** Don't create backup files, don't create #autosave# files
@@ -144,7 +159,7 @@
** Theme ** Theme
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package doom-themes (use-package doom-themes
:init (load-theme 'doom-dracula t)) :config (load-theme 'sodium t))
#+END_SRC #+END_SRC
** Disable the menu bar ** Disable the menu bar
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@@ -317,6 +332,41 @@ https://github.com/justbur/emacs-which-key
(setq history-length 25) (setq history-length 25)
(savehist-mode 1) (savehist-mode 1)
#+END_SRC #+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 ** Vertico
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package vertico (use-package vertico
@@ -410,6 +460,32 @@ Setup prefix for keybindings.
"t" '(:ignore t :which-key "text") "t" '(:ignore t :which-key "text")
"ts" '(hydra-text-scale/body :which-key "scale text")) "ts" '(hydra-text-scale/body :which-key "scale text"))
#+END_SRC #+END_SRC
** Copy file path with line number
#+BEGIN_SRC emacs-lisp
(defun alex/copy-path-with-line ()
"Copy /abs/path:LINE, or /abs/path:START-END when a region is active."
(interactive)
(unless buffer-file-name (user-error "Buffer is not visiting a file"))
(let* ((path (expand-file-name buffer-file-name))
(ref (if (use-region-p)
(let* ((beg (region-beginning))
(end (if (and (> (region-end) beg)
(save-excursion (goto-char (region-end)) (bolp)))
(1- (region-end))
(region-end)))
(start-line (line-number-at-pos beg))
(end-line (line-number-at-pos end)))
(if (= start-line end-line)
(format "%s:%d" path start-line)
(format "%s:%d-%d" path start-line end-line)))
(format "%s:%d" path (line-number-at-pos)))))
(kill-new ref)
(deactivate-mark)
(message "Copied %s" ref)))
(alex/keybindings
"y" '(alex/copy-path-with-line :which-key "copy path:line"))
#+END_SRC
* Browser * Browser
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
@@ -556,7 +632,7 @@ Setup prefix for keybindings.
) )
:custom :custom
(eglot-code-action-indications nil) (refactor-indications nil)
:hook ( :hook (
(eglot-managed-mode . mp-eglot-eldoc) (eglot-managed-mode . mp-eglot-eldoc)
@@ -639,6 +715,21 @@ Setup prefix for keybindings.
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package markdown-mode) (use-package markdown-mode)
#+END_SRC #+END_SRC
** Dagbok
#+BEGIN_SRC emacs-lisp
(use-package dagbok
:commands (dagbok-today dagbok-year dagbok-next-day dagbok-previous-day
dagbok-switch-journal dagbok-note dagbok-tasks dagbok-questions dagbok-search
dagbok-add-task dagbok-ask dagbok-set-status dagbok-toggle-flag
dagbok-toggle-highlight dagbok-toggle-completed dagbok-backlinks
dagbok-set-property dagbok-toggle-toc dagbok-goto-heading
dagbok-refresh dagbok-browse)
:custom
(dagbok-url "https://dagbok.ppp.pm")
(dagbok-token-file "/run/agenix/dagbok-token")
:init
(alex/keybindings "d" '(:keymap dagbok-command-map :package dagbok :which-key "dagbok")))
#+END_SRC
** Javascript ** Javascript
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(setq (setq
+11 -1
View File
@@ -8,6 +8,8 @@ let
alwaysEnsure = true; alwaysEnsure = true;
alwaysTangle = true; alwaysTangle = true;
override = inputs.dagbok.overlays.emacs;
extraEmacsPackages = epkgs: [ extraEmacsPackages = epkgs: [
epkgs.flymake-go-staticcheck epkgs.flymake-go-staticcheck
epkgs.tree-sitter-langs epkgs.tree-sitter-langs
@@ -16,7 +18,7 @@ let
}; };
e = pkgs.writeShellScriptBin "e" '' e = pkgs.writeShellScriptBin "e" ''
${emacs}/bin/emacs -nw $@ exec ${emacs}/bin/emacs -nw "$@"
''; '';
ec = pkgs.writeShellScriptBin "ec" '' ec = pkgs.writeShellScriptBin "ec" ''
@@ -33,6 +35,8 @@ in
TIG_EDITOR = "${e}/bin/e $@"; TIG_EDITOR = "${e}/bin/e $@";
}; };
home.file.".emacs.d/sodium-theme.el".source = ./sodium-theme.el;
home.packages = [ home.packages = [
e e
ec ec
@@ -43,4 +47,10 @@ in
}; };
environment.systemPackages = [ pkgs.ripgrep ]; environment.systemPackages = [ pkgs.ripgrep ];
age.secrets."dagbok-token" = {
file = ../../../../secrets/manatee/dagbok-token.age;
owner = "alex";
group = "users";
};
} }
@@ -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
+39 -13
View File
@@ -1,4 +1,4 @@
{ pkgs, ... }: { pkgs, config, ... }:
let let
wrapped = pkgs.wrapFirefox pkgs.firefox-devedition-unwrapped { wrapped = pkgs.wrapFirefox pkgs.firefox-devedition-unwrapped {
extraPolicies = { extraPolicies = {
@@ -47,10 +47,25 @@ let
''; '';
}; };
# Links opened from work checkouts (e.g. `gcloud auth login` in a work
# devshell, which ships its own `gcloud`, or `gt`) go to the work profile.
# Used both as `$BROWSER` and as the default handler for `xdg-open`.
browser = pkgs.writeShellApplication {
name = "browser";
text = ''
case "$PWD/" in
"$HOME/code/work/"*) exec ${ff-work}/bin/ff-work "$@" ;;
*) exec ${ff-alex}/bin/ff-alex "$@" ;;
esac
'';
};
sharedSettings = { sharedSettings = {
"general.smoothScroll" = true; "general.smoothScroll" = true;
"apz.gtk.kinetic_scroll.enabled" = false; "apz.gtk.kinetic_scroll.enabled" = false;
"network.dns.force_waiting_https_rr" = false; "network.dns.force_waiting_https_rr" = false;
"browser.smartwindow.enabled" = false;
"browser.smartwindow.isDefaultWindow" = false;
}; };
in in
{ {
@@ -81,11 +96,16 @@ in
settings = sharedSettings // { settings = sharedSettings // {
"toolkit.legacyUserProfileCustomizations.stylesheets" = true; "toolkit.legacyUserProfileCustomizations.stylesheets" = true;
"network.lna.skip-domains" = "music-admin-staging.soundtr.ac,api-internal.apps-us.platform.staging.internal.syb.sh";
}; };
userChrome = '' userChrome = ''
.tab-content { #navigator-toolbox,
border-top: solid #9400FF !important; #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;
} }
''; '';
}; };
@@ -100,21 +120,27 @@ in
exec = "${ff-alex}/bin/ff-alex %U"; exec = "${ff-alex}/bin/ff-alex %U";
terminal = false; terminal = false;
}; };
browser = {
name = "browser";
exec = "${browser}/bin/browser %U";
terminal = false;
};
}; };
mimeApps = { mimeApps = {
enable = true; enable = true;
defaultApplications = { defaultApplications = {
"text/html" = "ff-alex.desktop"; "text/html" = "browser.desktop";
"x-scheme-handler/http" = "ff-alex.desktop"; "x-scheme-handler/http" = "browser.desktop";
"x-scheme-handler/https" = "ff-alex.desktop"; "x-scheme-handler/https" = "browser.desktop";
"application/x-exension-htm" = "ff-alex.desktop"; "application/x-exension-htm" = "browser.desktop";
"application/x-exension-html" = "ff-alex.desktop"; "application/x-exension-html" = "browser.desktop";
"application/x-exension-shtml" = "ff-alex.desktop"; "application/x-exension-shtml" = "browser.desktop";
"application/xhtml+xml" = "ff-alex.desktop"; "application/xhtml+xml" = "browser.desktop";
"application/x-exension-xhtml" = "ff-alex.desktop"; "application/x-exension-xhtml" = "browser.desktop";
"application/x-exension-xht" = "ff-alex.desktop"; "application/x-exension-xht" = "browser.desktop";
}; };
}; };
@@ -131,6 +157,6 @@ in
environment.variables = { environment.variables = {
MOZ_ENABLE_WAYLAND = 1; MOZ_ENABLE_WAYLAND = 1;
BROWSER = "${ff-alex}/bin/ff-alex $@"; BROWSER = "${browser}/bin/browser";
}; };
} }
+14 -2
View File
@@ -8,6 +8,9 @@ let
enabled = config.mod.foot.enable; enabled = config.mod.foot.enable;
hyprlandEnabled = config.mod.hyprland.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 in
{ {
options = { options = {
@@ -24,9 +27,18 @@ in
settings = { settings = {
main = { main = {
term = "xterm-256color"; term = "xterm-256color";
font = "JetBrainsMono Nerd Font:size=15"; font = "JetBrainsMono Nerd Font:size=17";
include = "${pkgs.foot.themes}/share/foot/themes/dracula";
}; };
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 = '' home.file.".tigrc".text = ''
set main-view-line-number = yes set main-view-line-number = yes
set main-view-line-number-interval = 1 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
''; '';
}; };
+8 -1
View File
@@ -82,11 +82,18 @@ in
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pause-music}; ${dpms-lock}")'') (lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pause-music}; ${dpms-lock}")'')
]; ];
} }
{
_args = [
"switch:on:Lid Switch"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${pkgs.procps}/bin/pidof hyprlock || { ${pause-music}; ${dpms-lock}; }")'')
{ locked = true; }
];
}
{ {
_args = [ _args = [
"SUPER + SHIFT + x" "SUPER + SHIFT + x"
(lib.generators.mkLuaInline (lib.generators.mkLuaInline
''hl.dsp.exec_cmd("${pause-music}; ${pkgs.hyprlock}/bin/hyprlock & sleep 0.5; systemctl suspend")'' ''hl.dsp.exec_cmd("${pause-music}; ${pkgs.hyprlock}/bin/hyprlock & sleep 0.5; systemctl suspend-then-hibernate")''
) )
]; ];
} }
+29 -5
View File
@@ -14,8 +14,8 @@ in
settings = { settings = {
bind = bind =
let let
prev = "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify previous"; prev = "${pkgs.playerctl}/bin/playerctl -p ndp,naviterm,spotify previous";
next = "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify next"; next = "${pkgs.playerctl}/bin/playerctl -p ndp,naviterm,spotify next";
mkExec = key: cmd: { mkExec = key: cmd: {
_args = [ _args = [
@@ -27,12 +27,12 @@ in
[ [
(mkExec "XF86AudioPrev" prev) (mkExec "XF86AudioPrev" prev)
(mkExec "XF86AudioNext" next) (mkExec "XF86AudioNext" next)
(mkExec "XF86AudioPlay" "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify play-pause") (mkExec "XF86AudioPlay" "${pkgs.playerctl}/bin/playerctl -p ndp,naviterm,spotify play-pause")
(mkExec "XF86AudioPause" "${pkgs.playerctl}/bin/playerctl -p naviterm,spoitfy play-pause") (mkExec "XF86AudioPause" "${pkgs.playerctl}/bin/playerctl -p ndp,naviterm,spoitfy play-pause")
(mkExec "SUPER + ALT + LEFT" prev) (mkExec "SUPER + ALT + LEFT" prev)
(mkExec "SUPER + ALT + RIGHT" next) (mkExec "SUPER + ALT + RIGHT" next)
(mkExec "SUPER + ALT + DOWN" "${pkgs.playerctl}/bin/playerctl -p naviterm,spotify play-pause") (mkExec "SUPER + ALT + DOWN" "${pkgs.playerctl}/bin/playerctl -p ndp,naviterm,spotify play-pause")
]; ];
}; };
}; };
@@ -42,7 +42,19 @@ in
pkgs.spotify pkgs.spotify
inputs.naviterm.packages.${pkgs.stdenv.hostPlatform.system}.default inputs.naviterm.packages.${pkgs.stdenv.hostPlatform.system}.default
]; ];
programs.ndp = {
enable = true;
settings = {
server = "http://manatee:4533";
user = "navi";
passwordCommand = "cat ${config.age.secrets."navidrome-password".path}";
anthropicKeyCommand = "cat ${config.age.secrets."ndp-llm-api-key".path}";
}; };
};
};
home-manager.sharedModules = [ inputs.ndp.homeManagerModules.default ];
systemd.user.services.playerctld = { systemd.user.services.playerctld = {
unitConfig = { unitConfig = {
@@ -67,4 +79,16 @@ in
owner = "alex"; owner = "alex";
group = "users"; group = "users";
}; };
age.secrets."navidrome-password" = {
file = ../../../../secrets/pinwheel/navidrome-password.age;
owner = "alex";
group = "users";
};
age.secrets."ndp-llm-api-key" = {
file = ../../../../secrets/pinwheel/ndp-llm-api-key.age;
owner = "alex";
group = "users";
};
} }
+35
View File
@@ -0,0 +1,35 @@
{ pkgs, ... }:
let
picard = pkgs.symlinkJoin {
name = "picard";
paths = [ pkgs.picard ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/picard --set QT_SCREEN_SCALE_FACTORS 1.5
'';
};
plugins = pkgs.linkFarm "picard-plugins" {
replaygain2 = pkgs.fetchFromGitHub {
owner = "metabrainz";
repo = "picard-plugin-replaygain2";
tag = "v2.3.1";
hash = "sha256-NBn/LgjDRVCHmbI+bU4j29UhrL33ctV9jXj6CfFRBWA=";
};
};
in
{
home-manager.users.alex = { lib, ... }: {
home.packages = [
picard
pkgs.rsgain
];
home.activation.picardReplayGainPlugin = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
if ! ${pkgs.picard}/bin/picard-cli plugins info replaygain2 2>/dev/null | grep -qF "${plugins}/replaygain2"; then
run ${pkgs.picard}/bin/picard-cli --yes plugins install --no-git --reinstall "${plugins}/replaygain2" \
|| warnEcho "Failed to install Picard plugin replaygain2"
fi
'';
};
}
+23 -7
View File
@@ -27,17 +27,33 @@ in
description = "Notify low battery at this level"; description = "Notify low battery at this level";
}; };
suspendCapacity = lib.mkOption { hibernateCapacity = lib.mkOption {
default = 10; default = 10;
description = "Warn at this level and then suspend if power is not plugged in"; description = "Warn at this level and then hibernate if power is not plugged in";
}; };
}; };
}; };
config = { config = {
swapDevices = lib.mkIf enabled [
{
device = "/var/lib/swapfile";
size = 64 * 1024; # MiB
}
];
services = lib.mkIf enabled { services = lib.mkIf enabled {
upower = { upower = {
enable = true; enable = true;
criticalPowerAction = "Hibernate";
};
logind.settings.Login = {
HandleLidSwitch = "ignore";
HandleLidSwitchExternalPower = "ignore";
HandleLidSwitchDocked = "ignore";
HandleSuspendKey = "ignore";
HandleHibernateKey = "ignore";
}; };
tlp = { tlp = {
@@ -54,7 +70,7 @@ in
timers = { timers = {
"monitor-low-battery" = { "monitor-low-battery" = {
unitConfig = { unitConfig = {
Description = "monitors battery level and suspends computer if battery is low"; Description = "monitors battery level and hibernates computer if battery is low";
}; };
timerConfig = { timerConfig = {
@@ -70,7 +86,7 @@ in
services = { services = {
"monitor-low-battery" = { "monitor-low-battery" = {
unitConfig = { unitConfig = {
Description = "monitors battery level and suspends computer if battery is low"; Description = "monitors battery level and hibernates computer if battery is low";
}; };
serviceConfig = { serviceConfig = {
@@ -97,13 +113,13 @@ in
notify-send --expire-time=0 --urgency=critical "Battery Low" notify-send --expire-time=0 --urgency=critical "Battery Low"
fi fi
if [[ $BATTERY_CAPACITY -le ${builtins.toString lowbat.suspendCapacity} && $BATTERY_STATUS = "Discharging" ]]; then if [[ $BATTERY_CAPACITY -le ${builtins.toString lowbat.hibernateCapacity} && $BATTERY_STATUS = "Discharging" ]]; then
notify-send --expire-time=0 --urgency=critical "Battery Critically Low" "Suspending in 60 seconds if power is not plugged in" notify-send --expire-time=0 --urgency=critical "Battery Critically Low" "Hibernating in 60 seconds if power is not plugged in"
sleep 60s sleep 60s
BATTERY_STATUS=$(cat /sys/class/power_supply/${lowbat.battery}/status) BATTERY_STATUS=$(cat /sys/class/power_supply/${lowbat.battery}/status)
if [[ $BATTERY_STATUS = "Discharging" ]]; then if [[ $BATTERY_STATUS = "Discharging" ]]; then
${pause-music}; ${pkgs.hyprlock}/bin/hyprlock & sleep 0.5; systemctl suspend ${pause-music}; ${pkgs.hyprlock}/bin/hyprlock & sleep 0.5; systemctl hibernate
fi fi
fi fi
''; '';
+26 -15
View File
@@ -9,28 +9,39 @@ let
hyprlandEnabled = config.mod.hyprland.enable; hyprlandEnabled = config.mod.hyprland.enable;
grimblast = inputs.hyprland-contrib.packages.${pkgs.stdenv.hostPlatform.system}.grimblast; grimblast = inputs.hyprland-contrib.packages.${pkgs.stdenv.hostPlatform.system}.grimblast;
area = "${pkgs.libnotify}/bin/notify-send 'ps: selected area' && ${grimblast}/bin/grimblast copy area"; satty = "${pkgs.satty}/bin/satty --filename - --copy-command ${pkgs.wl-clipboard}/bin/wl-copy --initial-tool brush --actions-on-enter save-to-clipboard,exit --early-exit copy";
screen = "${pkgs.libnotify}/bin/notify-send 'ps: selected screen' &&${grimblast}/bin/grimblast copy output";
# Short timeout so the notification is gone before the capture happens.
# Output captures are instant, so they wait for it to disappear.
notify = msg: "${pkgs.libnotify}/bin/notify-send -t 500 'ps: ${msg}'";
waitForNotify = "${pkgs.coreutils}/bin/sleep 0.6";
area = "${notify "selected area"} && ${grimblast}/bin/grimblast copy area";
screen = "${notify "selected screen"} && ${waitForNotify} && ${grimblast}/bin/grimblast copy output";
annotateArea = "${notify "annotate area"} && ${grimblast}/bin/grimblast save area - | ${satty}";
annotateScreen = "${notify "annotate screen"} && ${waitForNotify} && ${grimblast}/bin/grimblast save output - | ${satty}";
bind = keys: cmd: {
_args = [
keys
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${cmd}")'')
];
};
in in
{ {
home-manager.users.alex = { home-manager.users.alex = {
home.packages = [ grimblast ]; home.packages = [
grimblast
pkgs.satty
];
wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled { wayland.windowManager.hyprland = lib.mkIf hyprlandEnabled {
settings = { settings = {
bind = [ bind = [
{ (bind "SUPER + Print" area)
_args = [ (bind "SUPER + CTRL + Print" screen)
"SUPER + Print" (bind "SUPER + SHIFT + Print" annotateArea)
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${area}")'') (bind "SUPER + CTRL + SHIFT + Print" annotateScreen)
];
}
{
_args = [
"SUPER + CTRL + Print"
(lib.generators.mkLuaInline ''hl.dsp.exec_cmd("${screen}")'')
];
}
]; ];
}; };
}; };
+21
View File
@@ -1,4 +1,7 @@
{ pkgs, ... }: { pkgs, ... }:
let
authorizedKeysPath = "/home/alex/.ssh/authorized-keys";
in
{ {
# Enable gnome-keyring at system level for PAM integration # Enable gnome-keyring at system level for PAM integration
services.gnome.gnome-keyring.enable = true; services.gnome.gnome-keyring.enable = true;
@@ -154,6 +157,21 @@
owner = "alex"; owner = "alex";
group = "users"; group = "users";
}; };
"alex.backwards-pinwheel.pub" = {
file = ../../../../secrets/backwards/alex.backwards-pinwheel.pub.age;
path = "${authorizedKeysPath}/alex.backwards-pinwheel.pub";
};
};
environment.etc."ssh/authorized_keys_command" = {
mode = "0755";
text = ''
#!${pkgs.bash}/bin/bash
for file in ${authorizedKeysPath}/*; do
${pkgs.coreutils}/bin/cat "$file"
done
'';
}; };
services.openssh = { services.openssh = {
@@ -166,5 +184,8 @@
type = "ed25519"; type = "ed25519";
} }
]; ];
authorizedKeysCommand = "/etc/ssh/authorized_keys_command";
authorizedKeysCommandUser = "root";
}; };
} }
+1 -17
View File
@@ -1,24 +1,8 @@
{ pkgs, ... }: { ... }:
{ {
services.tailscale.enable = true; services.tailscale.enable = true;
services.tailscale.extraSetFlags = [ "--operator=alex" ]; services.tailscale.extraSetFlags = [ "--operator=alex" ];
# Pinned to 1.96.5. 1.98.0 regressed split-DNS handling under work-vpn: the
# netmap's "resolve <tailnet>.ts.net locally via MagicDNS" hint is dropped
# when translated into systemd-resolved config, so *.ts.net queries get sent
# to a public resolver (199.247.155.53) that the corporate VPN's port-53
# egress filter blocks.
services.tailscale.package = pkgs.tailscale.overrideAttrs (_: rec {
version = "1.96.5";
src = pkgs.fetchFromGitHub {
owner = "tailscale";
repo = "tailscale";
tag = "v${version}";
hash = "sha256-vYYb+2OtuXftjGGG0zWJesHccrClB8YZpclv9KzNN/c=";
};
vendorHash = "sha256-rhuWEEN+CtumVxOw6Dy/IRxWIrZ2x6RJb6ULYwXCQc4=";
});
networking.firewall = { networking.firewall = {
checkReversePath = "loose"; checkReversePath = "loose";
allowedUDPPorts = [ 41641 ]; allowedUDPPorts = [ 41641 ];
+46 -12
View File
@@ -1,6 +1,21 @@
{ pkgs, config, ... }: { 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-manager.users.alex = {
home.packages = [ tmuxPanes ];
programs.tmux = { programs.tmux = {
enable = true; enable = true;
@@ -10,7 +25,27 @@
# Allow vi mode to be enabled instantly # Allow vi mode to be enabled instantly
escapeTime = 0; 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 = '' extraConfig = ''
set -g renumber-windows on set -g renumber-windows on
@@ -23,23 +58,22 @@
set-option -g allow-rename off set-option -g allow-rename off
# Status line colors set -s extended-keys on
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 set-clipboard on
set -g status-right ""
# Status line colors
set -g status-fg '#${colors.foreground}'
set -g status-bg '#${colors.status}'
# Status window colors # Status window colors
set -g window-status-current-style bg='#${config.lib.colors.background}',fg='#${config.lib.colors.foreground}' set -g window-status-current-style bg='#${colors.status}',fg='#${colors.cursor}'
set -g window-status-style bg='#${config.lib.colors.background}',fg='#${config.lib.colors.foreground-dim}' set -g window-status-style bg='#${colors.status}',fg='#${dim}'
set -g pane-border-style fg='#${config.lib.colors.background}' set -g pane-border-style fg='#${dim}'
set -g pane-active-border-style fg='#${config.lib.colors.background}' set -g pane-active-border-style fg='#${dim}'
set -g pane-border-lines "heavy" set -g pane-border-lines "heavy"
bind r source-file ~/.config/tmux/tmux.conf \; display "Config reloaded"
# Remove accidental `suspend-client` triggers # Remove accidental `suspend-client` triggers
unbind C-z unbind C-z
+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
+48 -25
View File
@@ -8,13 +8,13 @@ let
hyprlandEnabled = config.mod.hyprland.enable; hyprlandEnabled = config.mod.hyprland.enable;
music-status = pkgs.writeShellScript "music-status" '' music-status = pkgs.writeShellScript "music-status" ''
STATUS=$(${pkgs.playerctl}/bin/playerctl -p naviterm,spotify status 2>&1) STATUS=$(${pkgs.playerctl}/bin/playerctl -p ndp,naviterm,spotify status 2>&1)
if [ "$STATUS" = "No players found" ]; then if [ "$STATUS" = "No players found" ]; then
echo "" echo ""
else else
FORMAT="{{markup_escape(xesam:title)}} - {{markup_escape(xesam:artist)}}" FORMAT="{{markup_escape(xesam:title)}} - {{markup_escape(xesam:artist)}}"
OUTPUT=$(${pkgs.playerctl}/bin/playerctl -p naviterm,spotify metadata --format "$FORMAT") OUTPUT=$(${pkgs.playerctl}/bin/playerctl -p ndp,naviterm,spotify metadata --format "$FORMAT")
case "$STATUS" in case "$STATUS" in
"Playing") "Playing")
echo "<span font='14' rise='-3000'></span> $OUTPUT" echo "<span font='14' rise='-3000'></span> $OUTPUT"
@@ -22,6 +22,9 @@ let
"Paused") "Paused")
echo "<span font='14' rise='-3000'></span> $OUTPUT" echo "<span font='14' rise='-3000'></span> $OUTPUT"
;; ;;
"Stopped")
echo ""
;;
*) *)
echo "Unknown status: $STATUS" echo "Unknown status: $STATUS"
;; ;;
@@ -72,7 +75,12 @@ let
if [ "$EXIT_NODE_ONLINE" == "true" ]; then if [ "$EXIT_NODE_ONLINE" == "true" ]; then
tailscale set --exit-node="" && ${pkgs.libnotify}/bin/notify-send "Disconnected from Exit Node" tailscale set --exit-node="" && ${pkgs.libnotify}/bin/notify-send "Disconnected from Exit Node"
else else
tailscale set --exit-node=$PREFERRED_EXIT_NODE && ${pkgs.libnotify}/bin/notify-send "Connected to Exit Node" tailscale set --exit-node=$PREFERRED_EXIT_NODE || exit 1
EXIT_NODE_NAME=$(tailscale status --json | ${pkgs.jq}/bin/jq -r '
.Peer.[] | select(.ExitNode)
| .HostName + (if .Location then " (\(.Location.City), \(.Location.Country))" else "" end)')
${pkgs.libnotify}/bin/notify-send "Connected to Exit Node" "$EXIT_NODE_NAME"
fi fi
} }
@@ -84,26 +92,33 @@ let
esac esac
''; '';
work-vpn-status = pkgs.writeShellScript "work-vpn-status" '' work-vpn = pkgs.writeShellScript "work-vpn" ''
ACTIVE_ENVS="" connected() {
systemctl is-active --quiet openvpn-work-staging.service openvpn-work-production.service
}
STAGING_STATUS=$(systemctl is-active openvpn-work-staging.service) output() {
if [ "$STAGING_STATUS" == "active" ]; then if connected; then
ACTIVE_ENVS="S" echo '{ "text": "WORK-VPN ON", "class": "connected" }'
fi
PRODUCTION_STATUS=$(systemctl is-active openvpn-work-production.service)
if [ "$PRODUCTION_STATUS" == "active" ]; then
if [ -n "$ACTIVE_ENVS" ]; then
ACTIVE_ENVS="$ACTIVE_ENVS&amp;P"
else else
ACTIVE_ENVS="P" echo "{ \"text\": \"<span font='16' rise='-3000'>󰖂</span>\", \"tooltip\": \"Work VPN off\", \"class\": \"disconnected\" }"
fi
fi fi
}
if [ -n "$ACTIVE_ENVS" ]; then toggle() {
echo "WORK-VPN $ACTIVE_ENVS ON" if connected; then
systemctl stop work-vpn.target && ${pkgs.libnotify}/bin/notify-send "Disconnected from work VPN"
else
systemctl start work-vpn.target && ${pkgs.libnotify}/bin/notify-send "Connected to work VPN"
fi fi
}
case $1 in
--toggle)
toggle ;;
--output)
output ;;
esac
''; '';
toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" '' toggle-bt-power = pkgs.writeShellScript "toggle-bt-power" ''
@@ -139,20 +154,22 @@ in
modules-left = lib.mkIf hyprlandEnabled [ "hyprland/workspaces" ]; modules-left = lib.mkIf hyprlandEnabled [ "hyprland/workspaces" ];
modules-right = [ modules-right = [
"custom/work-vpn-status"
"custom/music" "custom/music"
"custom/container-status" "custom/container-status"
"custom/dunst" "custom/dunst"
"bluetooth" "bluetooth"
"wireplumber" "wireplumber"
"custom/work-vpn"
"custom/tailscale" "custom/tailscale"
"network" "network"
"battery" "battery"
"clock" "clock"
]; ];
"custom/work-vpn-status" = { "custom/work-vpn" = {
exec = "${work-vpn-status}"; exec = "${work-vpn} --output";
return-type = "json";
on-click-right = "${work-vpn} --toggle";
interval = 2; interval = 2;
}; };
@@ -244,12 +261,14 @@ in
modules-left = lib.mkIf hyprlandEnabled [ "hyprland/workspaces" ]; modules-left = lib.mkIf hyprlandEnabled [ "hyprland/workspaces" ];
modules-right = [ modules-right = [
"custom/work-vpn-status" "custom/work-vpn"
"clock" "clock"
]; ];
"custom/work-vpn-status" = { "custom/work-vpn" = {
exec = "${work-vpn-status}"; exec = "${work-vpn} --output";
return-type = "json";
on-click-right = "${work-vpn} --toggle";
interval = 2; interval = 2;
}; };
@@ -303,10 +322,14 @@ in
color: #${config.lib.colors.warning}; color: #${config.lib.colors.warning};
} }
#custom-work-vpn-status { #custom-work-vpn.connected {
color: #${config.lib.colors.warning}; color: #${config.lib.colors.warning};
} }
#custom-work-vpn.disconnected {
color: #${config.lib.colors.foreground-dim};
}
#custom-container-status.running { #custom-container-status.running {
color: #${config.lib.colors.warning}; color: #${config.lib.colors.warning};
font-size: 30px; font-size: 30px;
+106 -2
View File
@@ -1,4 +1,86 @@
{ ... }: {
config,
lib,
pkgs,
...
}:
let
inherit (config.boot.kernelPackages) kernel kernelModuleMakeFlags;
mkPatchedModules =
{
pname,
srcPaths,
dir,
patches,
postPatch,
}:
pkgs.stdenv.mkDerivation {
inherit pname patches postPatch;
inherit (kernel) version;
__structuredAttrs = true;
nativeBuildInputs = kernel.moduleBuildDependencies;
unpackPhase = ''
tar -xf ${kernel.src} --strip-components=1 --wildcards \
${lib.escapeShellArgs (map (path: "*/${path}") srcPaths)}
'';
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)/${dir} "''${makeFlags[@]}"
runHook postBuild
'';
installPhase = ''
runHook preInstall
make -C ${kernel.dev}/lib/modules/${kernel.modDirVersion}/build \
M=$(pwd)/${dir} modules_install \
"''${makeFlags[@]}" "''${installFlags[@]}"
runHook postInstall
'';
};
ipu6-isys = mkPatchedModules {
pname = "ipu6-isys";
srcPaths = [ "drivers/media/pci/intel/ipu6/*" ];
dir = "drivers/media/pci/intel/ipu6";
patches = [ ./ipu6-isys-runtime-pm-null-check.patch ];
postPatch = ''
sed -i '/+= intel-ipu6\.o/d' drivers/media/pci/intel/ipu6/Makefile
'';
};
usbio = mkPatchedModules {
pname = "usbio";
srcPaths = [
"drivers/usb/misc/usbio.c"
"drivers/gpio/gpio-usbio.c"
"include/linux/usb/usbio.h"
];
dir = "usbio";
patches = [ ./usbio-reset-resume.patch ];
postPatch = ''
mkdir -p usbio/include/linux/usb
cp drivers/usb/misc/usbio.c drivers/gpio/gpio-usbio.c usbio/
cp include/linux/usb/usbio.h usbio/include/linux/usb/
echo 'LINUXINCLUDE := -I$(src)/include $(LINUXINCLUDE)' > usbio/Kbuild
echo 'obj-m += usbio.o gpio-usbio.o' >> usbio/Kbuild
'';
};
in
{ {
nixpkgs.overlays = [ nixpkgs.overlays = [
(final: prev: { (final: prev: {
@@ -11,7 +93,8 @@
}); });
gst_all_1 = prev.gst_all_1 // { gst_all_1 = prev.gst_all_1 // {
icamerasrc-ipu6epmtl = (prev.gst_all_1.icamerasrc-ipu6epmtl.override { icamerasrc-ipu6epmtl =
(prev.gst_all_1.icamerasrc-ipu6epmtl.override {
ipu6-camera-hal = final.ipu6epmtl-camera-hal; ipu6-camera-hal = final.ipu6epmtl-camera-hal;
}).overrideAttrs }).overrideAttrs
(old: { (old: {
@@ -27,8 +110,29 @@
}) })
]; ];
boot.extraModulePackages = [
ipu6-isys
usbio
];
hardware.ipu6 = { hardware.ipu6 = {
enable = true; enable = true;
platform = "ipu6epmtl"; platform = "ipu6epmtl";
}; };
services.v4l2-relayd.instances.ipu6.input = {
pipeline = lib.mkForce "icamerasrc buffer-count=10";
width = 1920;
height = 1080;
};
systemd.services.v4l2-relayd-ipu6 = {
preStart = lib.mkOverride 40 ''
mkdir -p "$(dirname "$V4L2_DEVICE_FILE")"
${config.boot.kernelPackages.v4l2loopback.bin}/bin/v4l2loopback-ctl \
add --name "Intel MIPI Camera" --exclusive-caps=1 --buffers 8 \
${toString config.hardware.ipu6.videoDeviceNumber} || [ $? -eq 17 ]
echo /dev/video${toString config.hardware.ipu6.videoDeviceNumber} > "$V4L2_DEVICE_FILE"
'';
};
} }
@@ -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);
@@ -0,0 +1,320 @@
--- a/drivers/usb/misc/usbio.c
+++ b/drivers/usb/misc/usbio.c
@@ -83,6 +83,7 @@
* @gpios: GPIO bank descriptors
* @nr_gpio_banks: Number of I2C busses
* @gpios: I2C bank descriptors
+ * @reset_count: Number of times the bridge was reset while bound
*/
struct usbio_device {
struct device *dev;
@@ -115,6 +116,8 @@
unsigned int nr_i2c_buses;
struct usbio_i2c_bus_desc i2cs[USBIO_MAX_I2CBUSES];
+
+ unsigned int reset_count;
};
/**
@@ -428,6 +431,21 @@
}
EXPORT_SYMBOL_NS_GPL(usbio_get_quirks, "USBIO");
+unsigned int usbio_get_reset_count(struct auxiliary_device *adev)
+{
+ struct usbio_client *client = adev_to_client(adev);
+ struct usbio_device *usbio;
+
+ guard(mutex)(&client->mutex);
+
+ usbio = client->bridge;
+ if (!usbio)
+ return 0; /* Disconnected */
+
+ return usbio->reset_count;
+}
+EXPORT_SYMBOL_NS_GPL(usbio_get_reset_count, "USBIO");
+
static void usbio_auxdev_release(struct device *dev)
{
struct auxiliary_device *adev = to_auxiliary_dev(dev);
@@ -503,6 +521,47 @@
return 0;
}
+static int usbio_init_bridge(struct usbio_device *usbio)
+{
+ struct usbio_protver protver;
+ struct usbio_fwver fwver;
+ int ret;
+
+ guard(mutex)(&usbio->ctrl_mutex);
+
+ ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_HS, NULL, 0, NULL, 0);
+ if (ret < 0)
+ return ret;
+
+ ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_PROTVER, NULL, 0,
+ &protver, sizeof(protver));
+ if (ret < 0)
+ return ret;
+
+ ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_FWVER, NULL, 0,
+ &fwver, sizeof(fwver));
+ if (ret < 0)
+ return ret;
+
+ ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_ENUMGPIO, NULL, 0,
+ usbio->gpios, sizeof(usbio->gpios));
+ if (ret < 0 || ret % sizeof(struct usbio_gpio_bank_desc))
+ return (ret < 0) ? ret : -EPROTO;
+ usbio->nr_gpio_banks = ret / sizeof(struct usbio_gpio_bank_desc);
+
+ ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_ENUMI2C, NULL, 0,
+ usbio->i2cs, sizeof(usbio->i2cs));
+ if (ret < 0 || ret % sizeof(struct usbio_i2c_bus_desc))
+ return (ret < 0) ? ret : -EPROTO;
+ usbio->nr_i2c_buses = ret / sizeof(struct usbio_i2c_bus_desc);
+
+ dev_dbg(usbio->dev, "ProtVer(BCD): %02x FwVer: %d.%d.%d.%d\n",
+ protver.ver, fwver.major, fwver.minor,
+ le16_to_cpu(fwver.patch), le16_to_cpu(fwver.build));
+
+ return 0;
+}
+
static int usbio_suspend(struct usb_interface *intf, pm_message_t msg)
{
struct usbio_device *usbio = usb_get_intfdata(intf);
@@ -519,6 +578,26 @@
return usb_submit_urb(usbio->urb, GFP_KERNEL);
}
+static int usbio_reset_resume(struct usb_interface *intf)
+{
+ struct usbio_device *usbio = usb_get_intfdata(intf);
+ int ret;
+
+ ret = usb_submit_urb(usbio->urb, GFP_KERNEL);
+ if (ret)
+ return ret;
+
+ ret = usbio_init_bridge(usbio);
+ if (ret) {
+ usb_kill_urb(usbio->urb);
+ return ret;
+ }
+
+ usbio->reset_count++;
+
+ return 0;
+}
+
static void usbio_disconnect(struct usb_interface *intf)
{
struct usbio_device *usbio = usb_get_intfdata(intf);
@@ -550,9 +629,7 @@
struct usb_device *udev = interface_to_usbdev(intf);
struct usb_endpoint_descriptor *ep_in, *ep_out;
struct device *dev = &intf->dev;
- struct usbio_protver protver;
struct usbio_device *usbio;
- struct usbio_fwver fwver;
int ret;
usbio = devm_kzalloc(dev, sizeof(*usbio), GFP_KERNEL);
@@ -623,51 +700,16 @@
goto err_free_urb;
}
- mutex_lock(&usbio->ctrl_mutex);
-
- ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_HS, NULL, 0, NULL, 0);
- if (ret < 0)
- goto err_unlock;
-
- ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_PROTVER, NULL, 0,
- &protver, sizeof(protver));
- if (ret < 0)
- goto err_unlock;
-
- ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_FWVER, NULL, 0,
- &fwver, sizeof(fwver));
- if (ret < 0)
- goto err_unlock;
-
- ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_ENUMGPIO, NULL, 0,
- usbio->gpios, sizeof(usbio->gpios));
- if (ret < 0 || ret % sizeof(struct usbio_gpio_bank_desc)) {
- ret = (ret < 0) ? ret : -EPROTO;
- goto err_unlock;
- }
- usbio->nr_gpio_banks = ret / sizeof(struct usbio_gpio_bank_desc);
-
- ret = usbio_ctrl_msg(usbio, USBIO_PKTTYPE_CTRL, USBIO_CTRLCMD_ENUMI2C, NULL, 0,
- usbio->i2cs, sizeof(usbio->i2cs));
- if (ret < 0 || ret % sizeof(struct usbio_i2c_bus_desc)) {
- ret = (ret < 0) ? ret : -EPROTO;
- goto err_unlock;
- }
- usbio->nr_i2c_buses = ret / sizeof(struct usbio_i2c_bus_desc);
-
- mutex_unlock(&usbio->ctrl_mutex);
-
- dev_dbg(dev, "ProtVer(BCD): %02x FwVer: %d.%d.%d.%d\n",
- protver.ver, fwver.major, fwver.minor,
- le16_to_cpu(fwver.patch), le16_to_cpu(fwver.build));
+ ret = usbio_init_bridge(usbio);
+ if (ret)
+ goto err_kill_urb;
usbio_enum_gpios(usbio);
usbio_enum_i2cs(usbio);
return 0;
-err_unlock:
- mutex_unlock(&usbio->ctrl_mutex);
+err_kill_urb:
usb_kill_urb(usbio->urb);
err_free_urb:
usb_free_urb(usbio->urb);
@@ -694,6 +736,7 @@
.disconnect = usbio_disconnect,
.suspend = usbio_suspend,
.resume = usbio_resume,
+ .reset_resume = usbio_reset_resume,
.id_table = usbio_table,
.supports_autosuspend = 1,
};
--- a/drivers/gpio/gpio-usbio.c
+++ b/drivers/gpio/gpio-usbio.c
@@ -15,14 +15,16 @@
struct usbio_gpio_bank {
u8 config[USBIO_GPIOSPERBANK];
+ u32 value;
u32 bitmap;
};
struct usbio_gpio {
- struct mutex config_mutex; /* Protects banks[x].config */
+ struct mutex config_mutex; /* Protects banks[x].config and banks[x].value */
struct usbio_gpio_bank banks[USBIO_MAX_GPIOBANKS];
struct gpio_chip gc;
struct auxiliary_device *adev;
+ unsigned int reset_count;
};
static const struct acpi_device_id usbio_gpio_acpi_hids[] = {
@@ -101,6 +103,13 @@
usbio_gpio_get_bank_and_pin(gc, offset, &bank, &pin);
+ scoped_guard(mutex, &gpio->config_mutex) {
+ if (value)
+ bank->value |= BIT(pin);
+ else
+ bank->value &= ~BIT(pin);
+ }
+
gbuf.bankid = offset / USBIO_GPIOSPERBANK;
gbuf.pincount = 1;
gbuf.pin = pin;
@@ -178,6 +187,66 @@
return usbio_gpio_update_config(gc, offset, USBIO_GPIO_PINCFG_MASK, value);
}
+static int usbio_gpio_restore(struct usbio_gpio *gpio)
+{
+ struct usbio_gpio_init ginit;
+ struct usbio_gpio_rw gbuf;
+ int ret;
+
+ guard(mutex)(&gpio->config_mutex);
+
+ for (unsigned int b = 0; b < USBIO_MAX_GPIOBANKS; b++) {
+ struct usbio_gpio_bank *bank = &gpio->banks[b];
+
+ for (unsigned int pin = 0; pin < USBIO_GPIOSPERBANK; pin++) {
+ u8 mode = bank->config[pin] & USBIO_GPIO_PINMOD_MASK;
+
+ if (mode == USBIO_GPIO_PINMOD_INVAL)
+ continue;
+
+ ginit.bankid = b;
+ ginit.config = bank->config[pin];
+ ginit.pincount = 1;
+ ginit.pin = pin;
+
+ ret = usbio_control_msg(gpio->adev, USBIO_PKTTYPE_GPIO, USBIO_GPIOCMD_INIT,
+ &ginit, sizeof(ginit), NULL, 0);
+ if (ret)
+ return ret;
+
+ if (mode != USBIO_GPIO_PINMOD_OUTPUT)
+ continue;
+
+ gbuf.bankid = b;
+ gbuf.pincount = 1;
+ gbuf.pin = pin;
+ gbuf.value = cpu_to_le32(bank->value & BIT(pin));
+
+ ret = usbio_control_msg(gpio->adev, USBIO_PKTTYPE_GPIO, USBIO_GPIOCMD_WRITE,
+ &gbuf, sizeof(gbuf), NULL, 0);
+ if (ret)
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
+static int usbio_gpio_resume(struct device *dev)
+{
+ struct usbio_gpio *gpio = dev_get_drvdata(dev);
+ unsigned int reset_count = usbio_get_reset_count(gpio->adev);
+
+ if (reset_count == gpio->reset_count)
+ return 0;
+
+ gpio->reset_count = reset_count;
+
+ return usbio_gpio_restore(gpio);
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(usbio_gpio_pm_ops, NULL, usbio_gpio_resume);
+
static int usbio_gpio_probe(struct auxiliary_device *adev,
const struct auxiliary_device_id *adev_id)
{
@@ -199,6 +268,8 @@
return ret;
gpio->adev = adev;
+ gpio->reset_count = usbio_get_reset_count(adev);
+ dev_set_drvdata(dev, gpio);
usbio_acpi_bind(gpio->adev, usbio_gpio_acpi_hids);
@@ -238,7 +309,8 @@
static struct auxiliary_driver usbio_gpio_driver = {
.name = USBIO_GPIO_CLIENT,
.probe = usbio_gpio_probe,
- .id_table = usbio_gpio_id_table
+ .id_table = usbio_gpio_id_table,
+ .driver.pm = pm_sleep_ptr(&usbio_gpio_pm_ops),
};
module_auxiliary_driver(usbio_gpio_driver);
--- a/include/linux/usb/usbio.h
+++ b/include/linux/usb/usbio.h
@@ -172,6 +172,7 @@
void usbio_release(struct auxiliary_device *adev);
void usbio_get_txrxbuf_len(struct auxiliary_device *adev, u16 *txbuf_len, u16 *rxbuf_len);
unsigned long usbio_get_quirks(struct auxiliary_device *adev);
+unsigned int usbio_get_reset_count(struct auxiliary_device *adev);
void usbio_acpi_bind(struct auxiliary_device *adev, const struct acpi_device_id *hids);
#endif
+14 -1
View File
@@ -8,6 +8,9 @@ let
enabled = config.mod.wezterm.enable; enabled = config.mod.wezterm.enable;
hyprlandEnabled = config.mod.hyprland.enable; hyprlandEnabled = config.mod.hyprland.enable;
colors = config.lib.colors.terminal;
luaList = list: "{ " + lib.concatMapStringsSep ", " (c: "'#${c}'") list + " }";
in in
{ {
options = { options = {
@@ -27,7 +30,17 @@ in
local config = wezterm.config_builder() 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' config.font = wezterm.font 'JetBrainsMono Nerd Font'
-- to get "perfect" scaling to the right -- to get "perfect" scaling to the right
+31 -15
View File
@@ -9,18 +9,6 @@ let
gitEnabled = config.mod.git.enable; gitEnabled = config.mod.git.enable;
goEnabled = config.mod.go.enable; goEnabled = config.mod.go.enable;
openvpnEnabled = config.mod.openvpn.enable; openvpnEnabled = config.mod.openvpn.enable;
xdg-open-work = pkgs.writeShellScriptBin "xdg-open" ''
exec ff-work "$@"
'';
graphite-cli = pkgs.symlinkJoin {
name = "graphite-cli";
paths = [ pkgs.graphite-cli ];
nativeBuildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/gt --prefix PATH : ${xdg-open-work}/bin
'';
};
in in
{ {
home-manager.users.alex = { home-manager.users.alex = {
@@ -89,7 +77,7 @@ EOF
pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin pkgs.google-cloud-sdk.components.gke-gcloud-auth-plugin
]) ])
graphite-cli pkgs.graphite-cli
pkgs.postman pkgs.postman
pkgs.grpcurl pkgs.grpcurl
@@ -103,10 +91,10 @@ EOF
(pkgs.writeShellScriptBin "work-vpn" '' (pkgs.writeShellScriptBin "work-vpn" ''
case $1 in case $1 in
up) up)
sudo sh -c "systemctl start openvpn-work-staging.service; systemctl start openvpn-work-production.service" systemctl start work-vpn.target
;; ;;
down) down)
sudo sh -c "systemctl stop openvpn-work-staging.service; systemctl stop openvpn-work-production.service" systemctl stop work-vpn.target
;; ;;
esac esac
'') '')
@@ -154,6 +142,34 @@ EOF
}; };
}; };
systemd.targets.work-vpn = lib.mkIf openvpnEnabled {
description = "Work VPN";
requires = [
"openvpn-work-staging.service"
"openvpn-work-production.service"
];
after = [
"openvpn-work-staging.service"
"openvpn-work-production.service"
];
};
systemd.services = lib.mkIf openvpnEnabled {
openvpn-work-staging.partOf = [ "work-vpn.target" ];
openvpn-work-production.partOf = [ "work-vpn.target" ];
};
security.polkit.extraConfig = lib.mkIf openvpnEnabled ''
polkit.addRule(function(action, subject) {
if (action.id == "org.freedesktop.systemd1.manage-units" &&
subject.user == "alex" &&
action.lookup("unit") == "work-vpn.target" &&
["start", "stop", "restart"].indexOf(action.lookup("verb")) >= 0) {
return polkit.Result.YES;
}
});
'';
age.secrets = { age.secrets = {
"work-gitconfig" = lib.mkIf gitEnabled { "work-gitconfig" = lib.mkIf gitEnabled {
file = ../../../../secrets/pinwheel/work-gitconfig.age; file = ../../../../secrets/pinwheel/work-gitconfig.age;
+2
View File
@@ -30,6 +30,8 @@ in
}; };
boot = { boot = {
tmp.cleanOnBoot = true;
loader = { loader = {
grub = { grub = {
enable = true; enable = true;
+10
View File
@@ -32,6 +32,16 @@
webroot = "/var/lib/acme/acme-challenge/"; webroot = "/var/lib/acme/acme-challenge/";
group = "nginx"; group = "nginx";
}; };
"heldtenkelt.se" = {
webroot = "/var/lib/acme/acme-challenge/";
group = "nginx";
};
"www.heldtenkelt.se" = {
webroot = "/var/lib/acme/acme-challenge/";
group = "nginx";
};
}; };
}; };
} }
+1
View File
@@ -22,6 +22,7 @@ in
}; };
pppdotpm-site.enable = true; pppdotpm-site.enable = true;
heldtenkeltdotse-site.enable = true;
whib-backend.enable = true; whib-backend.enable = true;
whib-frontend.enable = true; whib-frontend.enable = true;
}; };
-1
View File
@@ -60,7 +60,6 @@ in
}; };
server = { server = {
DOMAIN = gitDomain;
ROOT_URL = "https://${gitDomain}"; ROOT_URL = "https://${gitDomain}";
SSH_PORT = 1122; # see `ssh` module SSH_PORT = 1122; # see `ssh` module
@@ -0,0 +1,39 @@
{
inputs,
lib,
config,
...
}:
let
enabled = config.mod.heldtenkeltdotse-site.enable;
in
{
imports = [ inputs.heldtenkeltdotse-site.nixosModules.default ];
options = {
mod.heldtenkeltdotse-site = {
enable = lib.mkEnableOption "enable heldtenkelt.se site";
};
};
config = lib.mkIf enabled {
assertions = [
{
assertion = config.services.nginx.enable;
message = "Option 'config.services.nginx' must be enabled";
}
];
services.heldtenkeltdotse-site = {
enable = true;
domain = "heldtenkelt.se";
useACMEHost = "heldtenkelt.se";
};
services.nginx.virtualHosts."www.heldtenkelt.se" = {
forceSSL = true;
useACMEHost = "www.heldtenkelt.se";
globalRedirect = "heldtenkelt.se";
};
};
}
+5
View File
@@ -99,6 +99,11 @@ in
path = "${authorizedKeysPath}/alex.pinwheel-tadpole.pub"; path = "${authorizedKeysPath}/alex.pinwheel-tadpole.pub";
}; };
"alex.manatee-tadpole.pub" = {
file = ../../../../secrets/manatee/alex.manatee-tadpole.pub.age;
path = "${authorizedKeysPath}/alex.manatee-tadpole.pub";
};
"alex.tadpole-git.ppp.pm" = { "alex.tadpole-git.ppp.pm" = {
file = ../../../../secrets/tadpole/alex.tadpole-git.ppp.pm.age; file = ../../../../secrets/tadpole/alex.tadpole-git.ppp.pm.age;
path = "/home/alex/.ssh/alex.tadpole-git.ppp.pm"; path = "/home/alex/.ssh/alex.tadpole-git.ppp.pm";
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,11 @@
age-encryption.org/v1
-> ssh-ed25519 wkRvNA pXi4XchE55ln/NTlJ7eFjFQsCPRrDS5OgmtkzWkvsFc
x1jaKGTnSatUbcQ6Ri4xQmMMnViQYRcI8MI1Q+IefcI
-> ssh-ed25519 5R7G9A +eANLwMlwd8KDMIiE9osNx+i/NiQGm69iEujoZH5JXA
e0TrimEfuN/FjTXGMgq+/QWCI6lOzKPodzmSZakWQCw
-> ssh-ed25519 +oNaHQ 2ZmUXEfEy5QHHjb2eJ9nqsKRtqlAm1+RYyeW9AJgNWI
WCcCeyor1fxql2yAuHt8CE5NmCBMq7bKu7bRXwm8MJQ
--- neV8fS41zGCp2Ez+J3VQG0tSTeo6VbaNo6o8X/uePTo
IKþ.rí`%‹É[¿Wõ6h4Ky¬ò°Q‚9ãv!ĘUo‚3%ö³1ó™wŸÔhÚk§@¨ÒÔý<ÝD¼ñ#äiȈí2±làGU§„phÕý8(J
ÔÉ�%R\eW~‘Ý©Â6"9
¯W&‹Î Ýc÷sè·/=¦Î£ü«‡&7ŸáÑú©&ë
+9
View File
@@ -0,0 +1,9 @@
age-encryption.org/v1
-> ssh-ed25519 wkRvNA HUrz7xanuOlXVzDIUTX9ekLPWJUu2FzVf3ZY/XbtqSA
7qKwaUNsHRtz7uNmk2FeBealiW8S3bAWcKJCFwhDhQ4
-> ssh-ed25519 vxPbZg HimT6C2qLyhitFXIad6wFBuwEljg8ER1TtE9FRvFHmM
9NcXChDz8Hma33umDRZkg8kWsG+8LDZKhT1/TSGcbMQ
-> ssh-ed25519 +oNaHQ ZrUo9uKv/edXs4tYAsgM5BgAbFAyPBlYkQ/yoMpj2Q8
71Q0DtYxwzzHjlbixWsJN4kzq432cS1cvltC/sTe4C8
--- +w7cxzo0KoG4wzfzrEcG0GB7XuBUlhyyunyObRn4TyQ
±ª'z¬¸»—}Ä�.ïVo¼wŽ�õ¼eJZ /žÈßXµ•0-R([Û9d'ô6ŠÒÏ•b�Z–öÊ.[�§~ÀtpÈvß)ÐÁ,=[:
+7
View File
@@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 wkRvNA XHbiGPFSh8koUQa7yuAEOIW3gwEe5WzpHMQcisr/P1k
TCfgoOzWDlxS6Hw++pQT7UjSGfWQ7CoKpFqOAFox+NU
-> ssh-ed25519 +oNaHQ BuxdeRlgH1Q94cChu9YDGAoQBtTANmeYD438ROk/oCQ
IPfIM7d/aTbV42AGBRztFxFOA27vlUQGH465e5kbNCQ
--- QpuFv/6MiwHDygBZflT1rDfF+65O346k8be5i0A0zNI
~-è˜L¢‘p�-¹¨CøHÁÕ¡5Ö0ŸY1–Sg×ÂlÆõ¸)zïÉBÅÄi#Åéú lÇâ�`ŠÛGÔìz¹>†Ô¸—à2)½§æà@çÕM5*9çf¾V-õ-i�ï=7[å,!Ë-ÈV
-7
View File
@@ -1,7 +0,0 @@
age-encryption.org/v1
-> ssh-ed25519 wkRvNA Bd21tyO+Rh+Zhb56/xzRCHAfkdggoRUp36E1e8eK+kk
hDd0ZJ8XQyN+Py9QxSP+4jXKa2MzWSM7OkU2huLNDDI
-> ssh-ed25519 +oNaHQ HaMjqDzPBUDwMDH0190pVxColLLVO4FTq0hZk9atiWE
WZvpvJ+IU9GV0n+fE0DN1gmLBfkBE65s2e0g1/yjTa8
--- ARKUYPu8vtFDOvtGVKzWlBskrxGoh+6muz3eA6tptMQ
$ÙÔ8ÃÃ!!Ül|wÌöiø½Ç ºdaõeE&ˆÈ\w¢¢ÿ–TåÞµ_‚zÛš€q“«)rZŸk/E—9¹]Eq8ºfEî�ã�úA` tÉ%Æ>Á:Â1
Binary file not shown.
+8
View File
@@ -0,0 +1,8 @@
age-encryption.org/v1
-> ssh-ed25519 vxPbZg xeVuL1SvyRUrFnPP6g6yehkR0xgGcyYHvsnLzvqITkw
bxIdf5rSV+Own8tJmB2eqmLh9yYwSdNA1aJgSQzG0+M
-> ssh-ed25519 +oNaHQ GPTODXfrzGkwYrCYtV9lbLkFwa472drSzK979Lpte2k
2l/iJiEiLpRMwJWs+G57mMw+WsQN2qZZVdLSN/f3IIk
--- gHFKxNTWsresoYz5IGZICql5G88TTko6XVfzOo5oO84
ôÄÑ£6Í%ûo�‰}¦µ>«ÀË ì›;„vÿ7Ôû¬¯X–4™ÒôLÍSÇÖÒ0ÞµôwƒU¡<Ö¹…ªöVŠúi~io«#NÀ•fUò9Äi„©âZw¾ymG¥Ìn<“*
:A
+7
View File
@@ -0,0 +1,7 @@
age-encryption.org/v1
-> ssh-ed25519 vxPbZg ttoakxifzTWW4eb4kIwoYPgM6BxVnWVyMvXPTBCs5mc
unb1JLUqlGEBv+hbg+6el2LnCMEPpEOnKKfkqb3P0M8
-> ssh-ed25519 +oNaHQ 4LyRWLbyqbfQxvOt8ac0DWT/c6adVI5cCvh5j9My+A0
qxtYamHiRi7YBWdOFWMdYQb1gqF7P+eqdk2nBI/CqzI
--- kLLYhfMnWuTjR8Zign8N7G82Qfxtq5BNS9SF+lBxo/w
ñ”m¢³d§»°4qü"{äDùåÉåñòÒn§c¿ó"
Binary file not shown.
+9 -2
View File
@@ -27,11 +27,16 @@ in {
"pinwheel/work-staging-ovpn.age".publicKeys = [ pinwheel alex ]; "pinwheel/work-staging-ovpn.age".publicKeys = [ pinwheel alex ];
"pinwheel/work-production-ovpn.age".publicKeys = [ pinwheel alex ]; "pinwheel/work-production-ovpn.age".publicKeys = [ pinwheel alex ];
"pinwheel/naviterm-config.age".publicKeys = [ pinwheel alex ]; "pinwheel/naviterm-config.age".publicKeys = [ pinwheel alex ];
"pinwheel/navidrome-password.age".publicKeys = [ pinwheel alex ];
"pinwheel/ndp-llm-api-key.age".publicKeys = [ pinwheel alex ];
"pinwheel/atuin-key.age".publicKeys = [ pinwheel alex ];
"manatee/root.manatee.age".publicKeys = [ manatee alex ]; "manatee/root.manatee.age".publicKeys = [ manatee alex ];
"manatee/root.manatee.pub.age".publicKeys = [ manatee alex ]; "manatee/root.manatee.pub.age".publicKeys = [ manatee alex ];
"manatee/alex.manatee-git.ppp.pm.age".publicKeys = [ manatee alex ]; "manatee/alex.manatee-git.ppp.pm.age".publicKeys = [ manatee alex ];
"manatee/alex.manatee-git.ppp.pm.pub.age".publicKeys = [ manatee alex ]; "manatee/alex.manatee-git.ppp.pm.pub.age".publicKeys = [ manatee alex ];
"manatee/alex.manatee-tadpole.age".publicKeys = [ manatee alex ];
"manatee/alex.manatee-tadpole.pub.age".publicKeys = [ manatee tadpole alex ];
"manatee/syncthing-cert.age".publicKeys = [ manatee alex ]; "manatee/syncthing-cert.age".publicKeys = [ manatee alex ];
"manatee/syncthing-key.age".publicKeys = [ manatee alex ]; "manatee/syncthing-key.age".publicKeys = [ manatee alex ];
"manatee/hetzner-dns.age".publicKeys = [ manatee alex ]; "manatee/hetzner-dns.age".publicKeys = [ manatee alex ];
@@ -43,18 +48,20 @@ in {
"manatee/romm-db-password.age".publicKeys = [ manatee alex ]; "manatee/romm-db-password.age".publicKeys = [ manatee alex ];
"manatee/romm-metadata-api-keys.age".publicKeys = [ manatee alex ]; "manatee/romm-metadata-api-keys.age".publicKeys = [ manatee alex ];
"manatee/puppy-tracker-invite-code.age".publicKeys = [ manatee alex ]; "manatee/puppy-tracker-invite-code.age".publicKeys = [ manatee alex ];
"manatee/solo-referee-api-key.age".publicKeys = [ manatee alex ];
"manatee/todo-token.age".publicKeys = [ manatee alex ]; "manatee/todo-token.age".publicKeys = [ manatee alex ];
"manatee/dagbok-token.age".publicKeys = [ manatee pinwheel alex ];
"manatee/schema-invite-code.age".publicKeys = [ manatee alex ]; "manatee/schema-invite-code.age".publicKeys = [ manatee alex ];
"manatee/schema-puppy-token.age".publicKeys = [ manatee alex ];
"manatee/restic-password.age".publicKeys = [ manatee alex ]; "manatee/restic-password.age".publicKeys = [ manatee alex ];
"manatee/restic-cloud-sync-key.age".publicKeys = [ manatee alex ]; "manatee/restic-cloud-sync-key.age".publicKeys = [ manatee alex ];
"manatee/restic-cloud-sync-repository.age".publicKeys = [ manatee alex ]; "manatee/restic-cloud-sync-repository.age".publicKeys = [ manatee alex ];
"manatee/lbsync-config.age".publicKeys = [ manatee alex ];
"backwards/root.backwards.age".publicKeys = [ backwards alex ]; "backwards/root.backwards.age".publicKeys = [ backwards alex ];
"backwards/root.backwards.pub.age".publicKeys = [ backwards alex ]; "backwards/root.backwards.pub.age".publicKeys = [ backwards alex ];
"backwards/alex.backwards-manatee.age".publicKeys = [ backwards alex ]; "backwards/alex.backwards-manatee.age".publicKeys = [ backwards alex ];
"backwards/alex.backwards-manatee.pub.age".publicKeys = [ backwards manatee alex ]; "backwards/alex.backwards-manatee.pub.age".publicKeys = [ backwards manatee alex ];
"backwards/alex.backwards-pinwheel.age".publicKeys = [ backwards alex ];
"backwards/alex.backwards-pinwheel.pub.age".publicKeys = [ backwards pinwheel alex ];
"backwards/alex.backwards-git.ppp.pm.age".publicKeys = [ backwards alex ]; "backwards/alex.backwards-git.ppp.pm.age".publicKeys = [ backwards alex ];
"backwards/alex.backwards-git.ppp.pm.pub.age".publicKeys = [ backwards alex ]; "backwards/alex.backwards-git.ppp.pm.pub.age".publicKeys = [ backwards alex ];
"backwards/wireless-network-secrets.age".publicKeys = [ backwards alex ]; "backwards/wireless-network-secrets.age".publicKeys = [ backwards alex ];