January 2026
Wow new year! Should review all these notes at some ponit for a bit of reflection on the year.
Feels like problem after problem I'm solving in pursuit of the "perfect system" but it will never be perfect lol
Anyway....
Revisiting lsof
So gemini came up with this, using lsof to listen to open files to find processes that are listening and finding ports. Context is i wanted to find the port that sabnzbd was listening on!
Can see above its 8080
NixOS Module System - Auto-injected Args
In flake.nix I explicitly create pkgs-unstable:
But in modules like nixos-base.nix, I use { pkgs, pkgs-unstable, ... } - where does pkgs come from?
pkgs is automatically provided by nixpkgs.lib.nixosSystem. When you call it, NixOS evaluates nixpkgs for your system and injects pkgs into all modules.
specialArgs is only for extra args NixOS doesn't know about (like pkgs-unstable).
Other auto-injected module args: config, lib, options, modulesPath
Docs: https://nixos.org/manual/nixos/stable/#sec-writing-modules
Inherit in nixos
Brief refresher on inherit (i always forget)
Bash piping args
Well I'm finally getting round to trying to get my head round -s and -- in bash!
So.... -s is to take commands from stdinput. so with piping, can see without this it expects a file
ahhhh, not this didn't work as -s expects from STDIN but i passed them as arguments! so it just opens a shell
here is a proper working example:
Now, as we know in bash double quotations "" expand args, so below will try to expand $1, and find nothing!
Whereas this works! as $1 is NOT expanded before piping
So, interestingly then, by default bash takes first param as script path to run and then $2, $3 etc as positional args to pass to the script.
I.e. bash testie.sh 'hiya' runs testie.sh with $1 as 'hiya'
BUT, if -s is passed the first one from stdin is the script and then all args following are positionals to the script taken from stdin
Finally, when we see -- it just means to not treat -some_opt stuff as options. Like this where -apples I guess bash thinks is an option (although interesting it didn't complain or throw an error)
lsof & ss deep dive (socket files)
lsof columns (man page):
FD suffixes (docs):
u= read+writer= read onlyw= write onlycwd= current working dirtxt= program text (code)mem= memory-mapped file
COMMAND column: Yes, systemd means the process named "systemd" (PID 1, the init system). It holds the socket FD because systemd created it via socket activation.
ss columns (man page):
users field: users:(("dockerd",pid=1879,fd=3),("systemd",pid=1,fd=595))
- List of processes with this socket open
- Format:
("command",pid=PID,fd=FD_NUMBER) - Multiple entries = multiple processes sharing the socket (socket activation)
Why 2 entries for docker.sock? Systemd creates the socket (socket activation), then passes FDs to dockerd. Both hold references.
Docs:
- lsof: https://man7.org/linux/man-pages/man8/lsof.8.html
- ss: https://man7.org/linux/man-pages/man8/ss.8.html
API/HTTP requests client
So having used postman in the past and wanting to move to a vim based giga-chad πͺ TUI will review the options:
- atac: crashed on importing cloudflare openAPI schema (it is large but not great....)
- posting: more promising but cloudflare uses openapi spec
3.0.3and posting based offopenapi-pydanticpackage which likes3.1.x - resto: 281 stars... last release 2022
- resterm: lets go: still struggling with errors trying to import metabase openAPI json (which IS a valid openapi
3.1so I assume same problem as the others, not updated for latest) - openapi-tui:
- atac (UPDATE): trying v0.22.1 from unstable nix packages: same issue with metabase API....
- resterm (UPDATE): trying v0.21.3 from unstable nix packages: same problem
- openapi-tui: DOES work for
v.3.1openapi BUT i try the:sendcommand and nothing happens....
Ok, this seems to be a common theme... found a link here that explains exclusiveMinimum which seems to be plaguing these TUIs
So... lets try a down-converter for openapi?
Nixarr setup
Decided to go with nixarr (lets give it a try).
At some point i would like to review using configarr or whatever its called to sync config files...
Because i keep forgetting (and they changed the ports)... its:
- radarr: 7878
- prowlarr: 9696
- sabnzbd: 6336 (changed from 8080)
- Step 1 * so go to sabnzbd:6336 to setup.
Newshosting is the ... download server?
Then just add host new.newhosting.com - (then get username and pass - saved in bitwarden, can login to dashboard here: https://controlpanel.newshosting.com/customer/)
important to note that on the newhosting dash here it states 30 max connections so in the server config i set the connections to 30
- Step 2 * Using nzbgeek as the ... indexer?>
Just have to go to prowlarr and add indexer...
Can get API key from here on nzbgeek but i think its the same as the password?
-
Step 3 * Have added in prowlarr apps here radarr so that radarr can pull the indexer from prowlarr (i.e. just nzbgeek at the moment)
-
Step 4 * Go to radarr download client and add sabnzbd
Recyclarr
So this is not in true NixOS style but its nice to have a tool to configure trash guides that is NOT through the UI.
Configarr worth looking at after for a more "complete" declarative option
Radarr/Sonarr Quality System (Claude)
The quality system can be confusing. Here's how it all fits together:
1. Quality Profile Structure:
2. Quality Groups (expand a ranking):
3. Custom Formats:
4. How matching works:
The Hierarchy:
The Big Picture - How It All Fits Together:
1. Source = WHERE did the video come from?
Bluray IS a source - it means "ripped from a Bluray disc"
NF/AMZN are service tags - they tell you WHICH streaming service, but the source is still "WEB"
2. Remux = a FLAG, not a source
Remux only applies to disc sources. WEB-DL is already "not re-encoded" but we don't call it remux.
3. How Radarr builds a "Quality":
A "Quality" is just Source + Resolution combined. Radarr has ~30 built-in qualities.
4. The Full Tree:
Quality Groups explained:
A group bundles multiple qualities as EQUAL rank. Inside a group, no upgrades happen between members.
5. Where do Custom Formats come from?
Custom Formats are just pattern matchers YOU define (or import). They scan release names and add/subtract scores.
6. NF: Source vs Custom Format - what's the difference?
"NF" in the filename is just text. The Custom Format "NF" is a rule that DETECTS that text and adds score.
Jargon Summary Table:
Filename example decoded:
Scoring Example:
In your quality profile, custom formats get scores:
When a release matches multiple formats, scores ADD UP. Higher total = preferred.
Cutoff vs Upgrade:
Why Groups?
Quality groups treat multiple sources as equivalent. E.g., "WEB 1080p" group:
- WEBDL-1080p (Netflix direct)
- WEBRip-1080p (screen capture)
- AMZN WEB-DL
All ranked the SAME. Won't upgrade WEBRipβWEBDL, but custom format scores can still prefer one.
Docs: https://wiki.servarr.com/radarr/settings#quality-profiles
Quality profiles (my notes)
Well.... what claude wrote is... verbose....
Will try to simplify my best i can do
Git diffs
So have played around with diffs in neovim but nevery really understood how it worked....
Got ChatGPT to outline a super simple repo to play around with the DiffView extension.
I think I understand now that
Where theirs e.g. is when we pop a stash (i.e. what the stash "wants")
BASE is a bit misleading... it's in most cases (I can see) the starting point of a stash (i.e. what it was before the stash was done). But that is NOT the same as the prior commit to OURS! I guess its more the last time that OURS and THEIRS was the same? (makes more sense below)
This is the example
(I have added a prefix for the git stuff so it doesnt think theres a conflict here)
And as ChatGPT puts it...
Wincmd?
So apparently :tabdo executes for each tab?
Nice! so like
Goes and prints bufname for each tab (active buffer)
Ahhhh
:wincmd = is the same as C-W = a window command...
Interestingly, the reason the the outline escapes from this when its called (and graciously so, wouldn't want the outline taking up half the page horizontally...)
It is the winfixwidth property that forces the win to stay constant (when C-w = is called)

