Compare commits
210
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ea400be53 | ||
|
|
6d3de29291 | ||
|
|
955b6640c3 | ||
|
|
ea791df4aa | ||
|
|
a587f0ab71 | ||
|
|
93f1b191c8 | ||
|
|
a51ed76119 | ||
|
|
5bca7e176a | ||
|
|
684d3f5a75 | ||
|
|
99fca0f746 | ||
|
|
9b1e2fb447 | ||
|
|
9d2379bb3e | ||
|
|
7a650dc7cc | ||
|
|
bb613ac803 | ||
|
|
47362090c3 | ||
|
|
8c5773447e | ||
|
|
ae44982c65 | ||
|
|
c82c1bef9c | ||
|
|
39b2b1d24b | ||
|
|
0022a152e3 | ||
|
|
d9db12c4a5 | ||
|
|
4ac9d1108b | ||
|
|
0c151943de | ||
|
|
dcb8a5e66a | ||
|
|
bdb21a6d50 | ||
|
|
1da34d6232 | ||
|
|
19e0b7f13f | ||
|
|
39434b3929 | ||
|
|
1ff333a896 | ||
|
|
9d199bc087 | ||
|
|
c7adcccbb3 | ||
|
|
dcc13f94e0 | ||
|
|
d30d8f9892 | ||
|
|
dfafac8de9 | ||
|
|
d9464009f0 | ||
|
|
d654eac1e2 | ||
|
|
d4e7475db9 | ||
|
|
0f7fb7f78a | ||
|
|
0d13581896 | ||
|
|
526e6a08e2 | ||
|
|
9e749cce2b | ||
|
|
1766fb7b3f | ||
|
|
dba73e1199 | ||
|
|
e9835372cd | ||
|
|
bd613ef07f | ||
|
|
c5b41ba6fd | ||
|
|
7041dfebfa | ||
|
|
4d6ad47837 | ||
|
|
f471d226e0 | ||
|
|
10f713103c | ||
|
|
cc6cb24c78 | ||
|
|
240facdbbb | ||
|
|
c1456decaf | ||
|
|
e06495ae69 | ||
|
|
6868182ef5 | ||
|
|
90a57ab73b | ||
|
|
75f4e22624 | ||
|
|
cf96fec63e | ||
|
|
3cdf4d4e54 | ||
|
|
f61a206977 | ||
|
|
1d5a5adbcc | ||
|
|
4029866ed4 | ||
|
|
66b27517ba | ||
|
|
6b43e76457 | ||
|
|
cbf2fdac42 | ||
|
|
1fdd048eed | ||
|
|
9b72a81d43 | ||
|
|
2f0302d66e | ||
|
|
256a9a9745 | ||
|
|
b746d58812 | ||
|
|
67963ed0e0 | ||
|
|
7bcc5feb35 | ||
|
|
9759cb70cf | ||
|
|
4d27b29233 | ||
|
|
dbc30b4b0e | ||
|
|
86ef677f2f | ||
|
|
a65771ccac | ||
|
|
89e55f4365 | ||
|
|
fee2f66385 | ||
|
|
72770a4ddb | ||
|
|
6d9e4443e1 | ||
|
|
7d504e68be | ||
|
|
432a00fb35 | ||
|
|
2125dd7aac | ||
|
|
0ff75654ce | ||
|
|
51df3473ca | ||
|
|
6ea5183f0e | ||
|
|
00ad68a5be | ||
|
|
bd309f38a2 | ||
|
|
50e2b68a23 | ||
|
|
e0fc1021ea | ||
|
|
10c64c77f1 | ||
|
|
0dbf33d476 | ||
|
|
677cefdb52 | ||
|
|
0e47006bdb | ||
|
|
cf8ec786bd | ||
|
|
f6d379efcc | ||
|
|
474c5436c8 | ||
|
|
d62a23680a | ||
|
|
734be2a727 | ||
|
|
ad12062cde | ||
|
|
e72d007a7d | ||
|
|
8d016a546a | ||
|
|
a93ca2c04d | ||
|
|
dcd6fa6be3 | ||
|
|
f4a9e638a5 | ||
|
|
4fd26b1662 | ||
|
|
665703fbe6 | ||
|
|
ad6dac634e | ||
|
|
9b7a9fa9b9 | ||
|
|
33278d9ed2 | ||
|
|
40aef99289 | ||
|
|
b191d8883c | ||
|
|
1df7bec2d7 | ||
|
|
87318cd04d | ||
|
|
ad9decdf47 | ||
|
|
819633260e | ||
|
|
610d5d8b28 | ||
|
|
58c0004f20 | ||
|
|
f57d6ab1f9 | ||
|
|
574773de73 | ||
|
|
a857365cc3 | ||
|
|
c06a57f249 | ||
|
|
128deca2e3 | ||
|
|
906fae7e7b | ||
|
|
1230e39aac | ||
|
|
9ad8567bdf | ||
|
|
bcabfd49bb | ||
|
|
eef7203621 | ||
|
|
6064a5a1a7 | ||
|
|
df7747f876 | ||
|
|
1e0485efde | ||
|
|
fce75e9f4c | ||
|
|
e6e280cc73 | ||
|
|
44245d16a2 | ||
|
|
123032aff9 | ||
|
|
94b0b33338 | ||
|
|
d84b35c5ce | ||
|
|
6f3801621f | ||
|
|
1e49af53e7 | ||
|
|
efa9aa93da | ||
|
|
277dfa4251 | ||
|
|
3470751c3e | ||
|
|
b56641aaee | ||
|
|
108f7b9528 | ||
|
|
1cb8371775 | ||
|
|
2fc39a5f15 | ||
|
|
5f4fd8d74e | ||
|
|
d8c4f6bb0b | ||
|
|
8c3b101a14 | ||
|
|
2b69485107 | ||
|
|
886ac4eb36 | ||
|
|
ffedf769a0 | ||
|
|
eec713e886 | ||
|
|
e995283363 | ||
|
|
a753355c0f | ||
|
|
e125296015 | ||
|
|
e0b3eb2393 | ||
|
|
35c3b08862 | ||
|
|
6730efa3ce | ||
|
|
fc459ddb1b | ||
|
|
052b95c00e | ||
|
|
783754bda2 | ||
|
|
dc08522bab | ||
|
|
a40558d35e | ||
|
|
18c1e10f13 | ||
|
|
0c6d6ac167 | ||
|
|
ee319d2d3e | ||
|
|
a97b433a7b | ||
|
|
184a09ad71 | ||
|
|
6ee8852c3b | ||
|
|
3e5a0958ab | ||
|
|
972b8f4c60 | ||
|
|
89850b37ce | ||
|
|
8c058632ef | ||
|
|
318c64a371 | ||
|
|
5dd14a8e68 | ||
|
|
ef0fc9a5c5 | ||
|
|
2836ea1150 | ||
|
|
d172157101 | ||
|
|
93571386bd | ||
|
|
bdfc27cf93 | ||
|
|
9a095abd5c | ||
|
|
c7f2f5503b | ||
|
|
fa6f747467 | ||
|
|
55bce14bf3 | ||
|
|
b8f09ed9ea | ||
|
|
88a23937ba | ||
|
|
63ca392537 | ||
|
|
f41879710c | ||
|
|
6a0d3680fd | ||
|
|
f029c1cf67 | ||
|
|
2bdca1c469 | ||
|
|
4ca136f2b4 | ||
|
|
af3cfe4b9a | ||
|
|
af8ee1609b | ||
|
|
26807cdb55 | ||
|
|
2013bffcb1 | ||
|
|
11a08c8b98 | ||
|
|
8284a03f57 | ||
|
|
14ec441479 | ||
|
|
2b3725e0fb | ||
|
|
860d4ccaa9 | ||
|
|
27fc7ae6d3 | ||
|
|
327c363232 | ||
|
|
8001d89c58 | ||
|
|
52e5a0ba5c | ||
|
|
8e57c37ac0 | ||
|
|
5f4b16d64e | ||
|
|
b11e99d850 |
@@ -0,0 +1,13 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = true
|
||||
|
||||
# Markdown uses trailing whitespace for hard line breaks.
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
+73
-14
@@ -1,43 +1,99 @@
|
||||
# Flake CI: formatting gate + evaluation of every host configuration.
|
||||
# Flake CI. Formatting (treefmt) runs on *every* PR; the heavier Nix work
|
||||
# (deadnix/statix/pre-commit lints + per-host evaluation) runs only when the
|
||||
# change can affect it.
|
||||
name: CI
|
||||
|
||||
# Deliberately no `paths:` filter. This job is a required status check on main,
|
||||
# and a path-filtered workflow is *skipped* (never runs) for PRs that touch no
|
||||
# matching file -- which leaves the required check pending forever and blocks the
|
||||
# merge (e.g. a .renovaterc.json-only change). So the workflow always runs and
|
||||
# always reports.
|
||||
#
|
||||
# Two tiers of checks:
|
||||
# * Formatting always runs. treefmt covers Markdown, YAML, and JSON as well as
|
||||
# Nix and shell, so a docs- or config-only PR must be format-checked too. It
|
||||
# is cheap (no host evaluation).
|
||||
# * The heavy steps (full `nix flake check` + host evals) run only when a .nix
|
||||
# file, flake.lock, or this workflow changed; otherwise they skip and the job
|
||||
# still passes, keeping the required check green-reportable.
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "**.nix"
|
||||
- "flake.lock"
|
||||
- ".gitea/workflows/ci.yaml"
|
||||
pull_request:
|
||||
paths:
|
||||
- "**.nix"
|
||||
- "flake.lock"
|
||||
- ".gitea/workflows/ci.yaml"
|
||||
|
||||
jobs:
|
||||
flake:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
|
||||
with:
|
||||
# Full history so the detect step can diff the PR against its base.
|
||||
fetch-depth: 0
|
||||
|
||||
# Decide whether the *heavy* Nix steps need to run. On a pull_request, diff
|
||||
# against the base for files that can affect them: any .nix, the lockfile,
|
||||
# or this workflow. On any other event (push to main) always run. The
|
||||
# formatting step below is unaffected -- it always runs.
|
||||
- name: Detect Nix-relevant changes
|
||||
id: detect
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ "${{ github.event_name }}" != "pull_request" ]; then
|
||||
echo "Event ${{ github.event_name }}: running full checks."
|
||||
echo "run=true" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
base='${{ github.event.pull_request.base.sha }}'
|
||||
head='${{ github.event.pull_request.head.sha }}'
|
||||
changed=$(git diff --name-only "$base...$head")
|
||||
echo "Changed files:"
|
||||
echo "$changed"
|
||||
if echo "$changed" | grep -Eq '(\.nix$|^flake\.lock$|^\.gitea/workflows/ci\.yaml$)'; then
|
||||
echo "Nix-relevant changes found: running heavy checks."
|
||||
echo "run=true" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
echo "No Nix-relevant changes: heavy checks skip (formatting still runs)."
|
||||
echo "run=false" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
|
||||
# Nix drives the formatting check, so install it unconditionally.
|
||||
- name: Install Nix
|
||||
uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31
|
||||
uses: cachix/install-nix-action@13d8dd58da0234aa297dedd986986ccb8e7f3e24 # v31
|
||||
with:
|
||||
extra_nix_config: |
|
||||
experimental-features = nix-command flakes
|
||||
accept-flake-config = true
|
||||
substituters = https://cache.nixos.org https://nix-community.cachix.org
|
||||
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
|
||||
|
||||
- name: Check formatting
|
||||
# Always run: treefmt formats Markdown/YAML/JSON (docs + config) as well as
|
||||
# Nix and shell, so documentation-only PRs are format-checked too. This is
|
||||
# the cheap gate (no host evaluation) and pre-builds the `formatting`
|
||||
# derivation that the flake check below reuses from cache.
|
||||
- name: Formatting check
|
||||
run: nix build --print-build-logs '.#checks.x86_64-linux.formatting'
|
||||
|
||||
# Runs every flake check: treefmt formatting, deadnix, statix, and the
|
||||
# pre-commit hooks (so a --no-verify commit can't ship unlinted).
|
||||
- name: Flake check
|
||||
if: steps.detect.outputs.run == 'true'
|
||||
run: nix flake check --print-build-logs
|
||||
|
||||
# Evaluate (not build) each host's toplevel so eval errors fail CI cheaply.
|
||||
# aarch64 / darwin hosts evaluate fine on an x86_64 runner; only building
|
||||
# would need emulation, which we deliberately avoid here.
|
||||
#
|
||||
# Host lists are discovered from the flake (attrNames of
|
||||
# nixos/darwinConfigurations) rather than hard-coded, so adding or removing
|
||||
# a host needs no change to this workflow.
|
||||
- name: Evaluate NixOS host configurations
|
||||
if: steps.detect.outputs.run == 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
for host in lyrathorpe-mbp lyrathorpe-x1c emmathorpe-edaas; do
|
||||
hosts=$(nix eval --raw '.#nixosConfigurations' \
|
||||
--apply 'cfgs: builtins.concatStringsSep "\n" (builtins.attrNames cfgs)')
|
||||
for host in $hosts; do
|
||||
echo "::group::eval $host"
|
||||
nix eval --raw ".#nixosConfigurations.$host.config.system.build.toplevel.drvPath"
|
||||
echo
|
||||
@@ -45,9 +101,12 @@ jobs:
|
||||
done
|
||||
|
||||
- name: Evaluate Darwin host configurations
|
||||
if: steps.detect.outputs.run == 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
for host in lyrathorpe-mac; do
|
||||
hosts=$(nix eval --raw '.#darwinConfigurations' \
|
||||
--apply 'cfgs: builtins.concatStringsSep "\n" (builtins.attrNames cfgs)')
|
||||
for host in $hosts; do
|
||||
echo "::group::eval $host"
|
||||
nix eval --raw ".#darwinConfigurations.$host.config.system.build.toplevel.drvPath"
|
||||
echo
|
||||
|
||||
+4
-1
@@ -1,4 +1,7 @@
|
||||
system/modules/firmware/*
|
||||
modules/firmware/*
|
||||
|
||||
# vim swap files
|
||||
*.swp
|
||||
|
||||
# Local scratch project, not part of this flake.
|
||||
tf-inspect/
|
||||
|
||||
+3
-6
@@ -1,16 +1,13 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended",
|
||||
":dependencyDashboard",
|
||||
":semanticCommits"
|
||||
],
|
||||
"extends": ["config:recommended", ":dependencyDashboard", ":semanticCommits"],
|
||||
"nix": {
|
||||
"enabled": true
|
||||
},
|
||||
"lockFileMaintenance": {
|
||||
"enabled": true,
|
||||
"schedule": ["before 6am on monday"]
|
||||
"schedule": ["before 6am on monday"],
|
||||
"automerge": true
|
||||
},
|
||||
"git-submodules": {
|
||||
"enabled": false
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
# Working on this flake
|
||||
|
||||
Project notes for changes to this repository. Persona and memory rules live in
|
||||
the user-global config; this file is about the flake's checks and conventions.
|
||||
|
||||
## Before you commit: run the formatter
|
||||
|
||||
Formatting and linting are driven by the flake. CI (`.gitea/workflows/ci.yaml`)
|
||||
runs `nix flake check`, which fails the build if any file is unformatted or trips
|
||||
a lint. From the repo root:
|
||||
|
||||
- `nix fmt` — format the whole tree (writes changes).
|
||||
- `nix flake check` — run every check read-only (what CI runs).
|
||||
- `nix develop` — dev shell; its `shellHook` installs the git pre-commit hooks so
|
||||
the same gates run on `git commit`.
|
||||
|
||||
Never commit with `--no-verify`. A bypassed commit ships unformatted content and
|
||||
turns CI red on the next push to `main` (see "Docs are checked too").
|
||||
|
||||
## What gets checked
|
||||
|
||||
Defined in `flake.nix` (the `treefmt`, `pre-commit`, and `checks` blocks) and
|
||||
`statix.toml`:
|
||||
|
||||
| Check | Tool | Covers |
|
||||
| ------------ | --------------------------------- | ------------------------------------------------------- |
|
||||
| `formatting` | treefmt → `nixfmt` | all `*.nix` |
|
||||
| `formatting` | treefmt → `shfmt` | shell scripts |
|
||||
| `formatting` | treefmt → `prettier` | **Markdown, YAML, JSON** (incl. `README.md`, this file) |
|
||||
| `deadnix` | deadnix | dead Nix bindings (`--no-lambda-pattern-names`) |
|
||||
| `statix` | statix | Nix antipatterns (config in `statix.toml`) |
|
||||
| pre-commit | nixfmt-rfc-style, deadnix, statix | the same gates, run on commit |
|
||||
|
||||
Excluded from formatting: `*/hardware-configuration.nix` (generated by
|
||||
`nixos-generate-config`) and `flake.lock`. Editor defaults (indent, EOL, final
|
||||
newline) are in `.editorconfig`; note Markdown keeps trailing whitespace, which
|
||||
encodes hard line breaks.
|
||||
|
||||
## Docs are checked too
|
||||
|
||||
prettier formats `*.md`, so **documentation edits must be run through `nix fmt`**
|
||||
exactly like code. prettier re-aligns Markdown tables in particular; hand-editing
|
||||
a table almost always leaves it non-conformant and fails the `formatting` check.
|
||||
|
||||
Prose documentation lives in `docs/` and is **published** to
|
||||
<https://docs.lyrapup.pet/nixfiles/> by the separate `docs-site` repo, which
|
||||
clones this one at build time. Two consequences when editing docs:
|
||||
|
||||
- A markdown file outside `docs/` (other than the root `README.md`) is not
|
||||
synced and will never appear on the site. Put new prose in `docs/`.
|
||||
- Links must follow the rules in the README's "Documentation" section: absolute
|
||||
Gitea URLs to source files, relative links between `docs/` pages, and
|
||||
absolute `docs.lyrapup.pet` URLs from the root README into `docs/`. The site
|
||||
builds non-strict, so a broken link is silent.
|
||||
|
||||
The CI `formatting` step runs on **every** PR — including docs- and config-only
|
||||
changes — so a Markdown/YAML/JSON edit is format-checked before merge, not just
|
||||
after it lands on `main`. (The heavier `deadnix`/`statix`/`pre-commit` lints and
|
||||
the per-host evaluation still run only when a `.nix` file, `flake.lock`, or the
|
||||
workflow changed; see `.gitea/workflows/ci.yaml`.) Run `nix fmt` before you
|
||||
commit and the formatting check stays green.
|
||||
|
||||
## Host evaluation
|
||||
|
||||
CI also evaluates every `nixosConfigurations` / `darwinConfigurations` host's
|
||||
toplevel (eval only, no build) on an x86_64 runner, so eval errors fail cheaply.
|
||||
Reproduce locally:
|
||||
|
||||
```sh
|
||||
nix eval --raw ".#nixosConfigurations.<host>.config.system.build.toplevel.drvPath"
|
||||
```
|
||||
|
||||
Host lists are discovered from the flake, so adding or removing a host needs no
|
||||
change to the workflow.
|
||||
@@ -5,19 +5,139 @@ single flake.
|
||||
|
||||
## Hosts
|
||||
|
||||
Defined in the host table in [`flake.nix`](./flake.nix):
|
||||
Defined in the host table in [`flake.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/flake.nix):
|
||||
|
||||
| Configuration | System | Machine |
|
||||
| ------------------- | --------------- | ---------------------------------------- |
|
||||
| `lyrathorpe-mbp` | `aarch64-linux` | MacBook Pro (Apple Silicon, Asahi) |
|
||||
| `lyrathorpe-t400` | `x86_64-linux` | ThinkPad T400 — [install notes](./system/machine/T400/README.md) |
|
||||
| `lyrathorpe-macpro31` | `x86_64-linux` | Mac Pro 3,1, desktop — [install notes](./system/machine/MacPro31/README.md) |
|
||||
| `emmathorpe-edaas` | `x86_64-linux` | Work WSL box (NixOS-WSL) |
|
||||
| `lyrathorpe-mac` | `aarch64-darwin` | macOS (nix-darwin) |
|
||||
| Configuration | System | Machine |
|
||||
| --------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `lyrathorpe-mbp` | `aarch64-linux` | MacBook Pro (Apple Silicon, Asahi) |
|
||||
| `lyrathorpe-t400` | `x86_64-linux` | ThinkPad T400 — [install notes](https://docs.lyrapup.pet/nixfiles/hosts/t400/) |
|
||||
| `lyrathorpe-macpro31` | `x86_64-linux` | Mac Pro 3,1, desktop — [install notes](https://docs.lyrapup.pet/nixfiles/hosts/macpro31/) |
|
||||
| `lyrathorpe-console` | `x86_64-linux` | Living-room games machine (Haswell i7 + GTX 1070) on a television — [install notes](https://docs.lyrapup.pet/nixfiles/hosts/console/) |
|
||||
| `emmathorpe-edaas` | `x86_64-linux` | Work WSL box (NixOS-WSL) — [notes](https://docs.lyrapup.pet/nixfiles/hosts/edaas/) |
|
||||
| `lyrathorpe-rpi5` | `aarch64-linux` | Raspberry Pi 5 headless server: Docker host + nginx reverse proxy — [install notes](https://docs.lyrapup.pet/nixfiles/hosts/rpi5/) |
|
||||
| `lyrathorpe-mac` | `aarch64-darwin` | macOS (nix-darwin) — [notes](https://docs.lyrapup.pet/nixfiles/hosts/darwin/) |
|
||||
|
||||
Shared layers: `lyrathorpe/home` (home-manager: shell, git, editor),
|
||||
`system/modules/common-nixos.nix` (all NixOS hosts), and
|
||||
`system/modules/laptop.nix` (the physical laptops).
|
||||
Shared layers: `home` (home-manager: shell, git, editor),
|
||||
`modules/common-nixos.nix` (all NixOS hosts: fonts, nix-ld, caches),
|
||||
`modules/workstation.nix` (physical graphical hosts: audio, thermald,
|
||||
earlyoom, fwupd), `modules/laptop.nix` (laptops: Wi-Fi, Bluetooth, power,
|
||||
lid), `modules/desktop.nix` (wired desktops: NetworkManager), and
|
||||
`modules/ssh.nix` (key-only sshd). The x86 hosts also pull `nixos-hardware`
|
||||
profiles. The full module catalogue is below.
|
||||
|
||||
## Repository layout
|
||||
|
||||
```
|
||||
flake.nix # inputs, mkHost/mkDarwinHost, the host tables, dev shell + checks
|
||||
flake.lock # pinned input revisions (Renovate keeps this fresh)
|
||||
modules/ # reusable NixOS system modules (see "Module catalogue")
|
||||
home/ # home-manager profile: shell, git, editor, claude, secret-service, desktop, sway
|
||||
docs/ # all prose documentation; published to docs.lyrapup.pet (see "Documentation")
|
||||
users/ # identity registry + per-user home extras (see "Users")
|
||||
hosts/<Name>/ # per-machine config: configuration.nix + hardware-configuration.nix
|
||||
lib/ # small pure helpers (currently the Catppuccin Mocha palette)
|
||||
.gitea/workflows/ # CI (nix flake check + per-host eval)
|
||||
statix.toml # lint config (house-style lints disabled)
|
||||
.editorconfig # base whitespace style
|
||||
tf-inspect/ # UNRELATED scratch project (gitignored, its own git repo);
|
||||
# RouterOS / home-services Terraform, not part of this flake
|
||||
```
|
||||
|
||||
Each `nixosConfiguration` / `darwinConfiguration` is assembled in `flake.nix`
|
||||
from three layers: the shared `baseModules` (or `darwinBaseModules`), the
|
||||
per-form-factor and `nixos-hardware` modules listed in the host table, and the
|
||||
per-machine `hosts/<Name>/configuration.nix`. Home-manager is wired in as a
|
||||
system module; each user's home is composed from the `homeModules` list in that
|
||||
host's table entry.
|
||||
|
||||
## Module catalogue
|
||||
|
||||
Reusable NixOS modules under [`modules/`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/modules). "Imported by" says how a
|
||||
module reaches a host: **baseModules** (every NixOS host, via `flake.nix`),
|
||||
**host table** (listed explicitly per host in `flake.nix`), or **transitively**
|
||||
(pulled in by another module's `imports`).
|
||||
|
||||
| Module | Imported by | What it does / when to use it |
|
||||
| ------------------ | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `common-nixos.nix` | baseModules (all NixOS) | Timezone/locale, store hygiene (auto-optimise, big download buffer, **no** auto-GC), the nix-community binary cache, `nix-ld`, **sudo-rs** in place of sudo, base CLI (`git`, `fastfetch`), and the fleet-wide font stack. |
|
||||
| `users.nix` | baseModules (all NixOS) | Builds `users.users` from the registry for the host's `hostUsers`; enables zsh; enables Firefox + Thunderbird **only** when `features.swayDesktop.enable` is on. Applies per-user `linger`. |
|
||||
| `features.nix` | baseModules (all NixOS) | Declares the feature-flag options (`features.swayDesktop.enable`, `features.claudeCode.enable`) so any host can read/set them without importing the heavy implementation module, plus the CPU capability fact they derive from (`features.cpu.microarchLevel`) and the assertion that guards it. See "CPU capability gating". |
|
||||
| `workstation.nix` | transitively (via laptop/desktop) | Form-factor-agnostic base for physical graphical hosts: turns on `swayDesktop`, Dvorak console, PipeWire, firewall (default-deny), fstrim, earlyoom, fwupd, thermald (x86), redistributable fw. |
|
||||
| `laptop.nix` | host table (MBP, T400) | `imports` workstation.nix, then adds the portable bits: iwd Wi-Fi, lid suspend/lock, Bluetooth + blueman. |
|
||||
| `desktop.nix` | host table (Mac Pro) | `imports` workstation.nix, then swaps Wi-Fi for wired NetworkManager. Pair with `portable = false` in the host table. |
|
||||
| `sway.nix` | host table (graphical hosts) | Implementation of `features.swayDesktop`: the system Sway package, the greetd/ReGreet (cage) greeter forced to Dvorak, xdg-portal, Wayland utility packages. Home-side Sway config is in `home/sway.nix`. |
|
||||
| `ssh.nix` | host table (T400, Mac Pro, RPi5) | Enables sshd, opens port 22, enforces a key-only policy (no password / keyboard-interactive, no root). Authorized keys come from the registry via `users.nix`. |
|
||||
| `firmware/` | referenced by MBP host config | Committed Apple peripheral firmware blobs for the Asahi MBP (see "MacBook (Asahi) firmware"). |
|
||||
|
||||
Form-factor decision: a **laptop** imports `laptop.nix` (default
|
||||
`portable = true`); a **wired desktop** imports `desktop.nix` and sets
|
||||
`portable = false`; a **headless server** imports neither (leaves
|
||||
`features.swayDesktop.enable` at its default `false`) and adds only what it
|
||||
serves. `portable` is threaded through to `home/sway.nix`, which drops the
|
||||
battery block and brightness keys on desktops.
|
||||
|
||||
## CPU capability gating
|
||||
|
||||
Not every host can run everything the fleet installs. Nix cannot probe the CPU
|
||||
(evaluation is pure, and a host may be built elsewhere), so each machine
|
||||
declares what it is and the shared modules derive from that:
|
||||
|
||||
- `features.cpu.microarchLevel` — the x86-64 psABI level the CPU implements
|
||||
(1 = baseline, 2 = SSE4.2/POPCNT, 3 = AVX2, 4 = AVX-512). Defaults to **2**;
|
||||
only a host older than that sets it (the Mac Pro 3,1's 2008 Harpertown Xeons
|
||||
are level 1). Ignored on non-x86_64 hosts.
|
||||
- `features.claudeCode.enable` — derived: on unless the host is below
|
||||
x86-64-v2, because Claude Code's Node runtime needs SSE4.2/POPCNT.
|
||||
[`home/claude.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/claude.nix) reads it through home-manager's
|
||||
`osConfig` and installs nothing (CLI, `CLAUDE.md`, output style, memory
|
||||
symlink) when it is off. Hosts with no such option — the Darwin host and the
|
||||
standalone `homeConfigurations` — fall back to enabled.
|
||||
- An assertion in `features.nix` fails evaluation if a host force-enables a
|
||||
flag its declared CPU level cannot support, so the mistake surfaces in
|
||||
`nix flake check`/CI rather than as an illegal-instruction crash on the box.
|
||||
|
||||
Adding another CPU-sensitive tool means deriving one more flag there, not
|
||||
editing every host.
|
||||
|
||||
## Users
|
||||
|
||||
Identity is data, kept separate from the reusable modules:
|
||||
|
||||
- [`users/registry.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/registry.nix) — one entry per user (display
|
||||
name, email, supplementary groups, authorized + signing keys). This is the
|
||||
single source of identity; no user data is hardcoded in the modules.
|
||||
- Each host's table entry declares a `users` set keyed by username; every entry
|
||||
lists that user's home-module composition (the shared `./home` bundle plus any
|
||||
per-user modules, e.g. [`users/emmathorpe/work.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/emmathorpe/work.nix))
|
||||
and optional per-host-user system bits such as `linger`.
|
||||
- `mkHost` builds each account from the registry and injects the matching
|
||||
identity into that user's home config as the `identity` module arg. A host can
|
||||
therefore declare any number of users.
|
||||
|
||||
Per-user home extras live under `users/<name>/`:
|
||||
|
||||
- [`users/lyrathorpe/home.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/lyrathorpe/home.nix) — personal extras
|
||||
(an ssh host shortcut, gammastep coordinates); imported on Lyra's hosts.
|
||||
- [`users/emmathorpe/work.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/emmathorpe/work.nix) — the work
|
||||
toolchain (kubectl/helm/az/etc.), work-only LSP servers, the corporate ssh
|
||||
handling, and the headless Secret Service that gcx needs for its keychain
|
||||
tokens (see [`home/secret-service.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/secret-service.nix)); imports
|
||||
[`users/emmathorpe/renovate-review.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/emmathorpe/renovate-review.nix),
|
||||
the daily headless Renovate-PR review timer (EDaaS only).
|
||||
|
||||
### Portable home (off-NixOS / external consumers)
|
||||
|
||||
The home config is also exposed for use beyond these hosts:
|
||||
|
||||
- `homeConfigurations."<user>@<system>"` — a standalone home-manager profile
|
||||
(the portable subset: shell + git + editor + claude) that can be activated on a
|
||||
machine this flake does **not** manage:
|
||||
`home-manager switch --flake .#"lyrathorpe@x86_64-linux"`. The desktop/sway
|
||||
modules are intentionally excluded (they rely on a NixOS-provided Sway/Firefox
|
||||
binary).
|
||||
- `homeModules` — the reusable modules exported so another flake can import them
|
||||
(`inputs.<this>.homeModules.default`). Consumers must supply the module args
|
||||
these expect: `inputs` always, `identity` for git/desktop, `portable` for sway.
|
||||
|
||||
## Applying
|
||||
|
||||
@@ -28,36 +148,122 @@ sudo nixos-rebuild switch --flake .#<configuration>
|
||||
darwin-rebuild switch --flake .#lyrathorpe-mac
|
||||
```
|
||||
|
||||
On a host whose `networking.hostName` matches its flake attribute (the WSL box
|
||||
and the Pi are set up this way), `nh os switch` resolves the configuration from
|
||||
the hostname with no `--flake`/`-H` flag.
|
||||
|
||||
## Adding a new host
|
||||
|
||||
1. **Create `hosts/<Name>/`.** Add `configuration.nix` with the host-specific
|
||||
bits only: `networking.hostName`, bootloader (firmware-specific — it is
|
||||
deliberately not set in the shared modules), and any per-machine hardware
|
||||
quirks. Keep anything reusable in `modules/` instead.
|
||||
2. **Hardware config.** Generate `hardware-configuration.nix` on the real
|
||||
machine with `nixos-generate-config` and commit it. If the machine does not
|
||||
exist yet, commit a clearly-labelled placeholder so the host still evaluates
|
||||
in CI (see the existing T400 / RPi5 placeholders), and replace it at install.
|
||||
These files are excluded from the formatter and linters.
|
||||
3. **Add a host-table entry in `flake.nix`.** Under `hosts` (NixOS) or
|
||||
`darwinHosts` (macOS), set `system`, the `modules` list (host config + form
|
||||
factor + any `nixos-hardware` profiles), and the `users` map (each user's
|
||||
`homeModules`). Choose the form factor per the decision note above; a headless
|
||||
host imports neither `laptop.nix` nor `desktop.nix`.
|
||||
4. **Users.** If the host introduces a new person, add them to
|
||||
`users/registry.nix` first; otherwise reference an existing username.
|
||||
5. **Verify.** `nix flake check` formats, lints, and evaluates every host —
|
||||
including the new one — so a broken entry fails locally before CI. Then
|
||||
`sudo nixos-rebuild switch --flake .#<configuration>` on the machine.
|
||||
|
||||
No change to CI is needed: the host-eval step discovers hosts from the flake
|
||||
(`attrNames` of the configuration sets), so a new entry is picked up
|
||||
automatically.
|
||||
|
||||
## Shell environment & keybindings
|
||||
|
||||
- Interactive shell features (zsh, tmux, git, ssh, CLI tools, auto-tmux):
|
||||
[`lyrathorpe/home/README.md`](./lyrathorpe/home/README.md).
|
||||
[`docs/shell.md`](https://docs.lyrapup.pet/nixfiles/shell/).
|
||||
- Which classic utilities are shadowed by modern replacements, and the flag
|
||||
differences that will bite:
|
||||
[`docs/shell.md` → "Replacing the classics"](https://docs.lyrapup.pet/nixfiles/shell/#replacing-the-classics).
|
||||
- All Sway / tmux / foot / zsh keyboard shortcuts:
|
||||
[`lyrathorpe/home/KEYBINDINGS.md`](./lyrathorpe/home/KEYBINDINGS.md).
|
||||
[`docs/keybindings.md`](https://docs.lyrapup.pet/nixfiles/keybindings/).
|
||||
|
||||
## Login / greeter
|
||||
|
||||
Graphical (Sway) hosts log in through a Wayland greeter — `greetd` running
|
||||
ReGreet inside the `cage` kiosk compositor — configured centrally in
|
||||
[`lyrathorpe/swaywm.nix`](./lyrathorpe/swaywm.nix), gated on
|
||||
`features.swayDesktop.enable`. The greeter is forced to Dvorak to match the
|
||||
console and Sway session. Hosts with `features.swayDesktop.enable = false` (the
|
||||
WSL work box) keep plain TTY login. The target account needs a password
|
||||
ReGreet inside the `cage` kiosk compositor — implemented in
|
||||
[`modules/sway.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/modules/sway.nix), gated on
|
||||
`features.swayDesktop.enable` (the option is declared in
|
||||
[`modules/features.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/modules/features.nix), so headless hosts
|
||||
can leave it off without importing `modules/sway.nix`). The greeter is forced to Dvorak
|
||||
to match the console and Sway session. Headless hosts (the WSL work box and the
|
||||
Raspberry Pi server) keep plain TTY login. The target account needs a password
|
||||
(`passwd <user>`) before it can log in.
|
||||
|
||||
## MacBook (Asahi) firmware
|
||||
|
||||
The MBP host references `system/modules/firmware/` for Apple peripheral
|
||||
firmware (Wi-Fi/Bluetooth). Those blobs are **not** redistributable, so the
|
||||
directory is gitignored and a clean checkout will not build `lyrathorpe-mbp`
|
||||
until it is populated out-of-band.
|
||||
The MBP host references `modules/firmware/` for Apple peripheral
|
||||
firmware (Wi-Fi/Bluetooth). These blobs are **committed** (tracked) even though
|
||||
`.gitignore` lists the directory: the flake is `git+file`, so it only sees
|
||||
tracked files — untracking them breaks `lyrathorpe-mbp` evaluation (and the CI
|
||||
host-eval) because the config can't find the firmware. They are not
|
||||
redistributable; the repo is private.
|
||||
|
||||
Copy the firmware extracted during the Asahi install (from
|
||||
`/etc/nixos/firmware` on the freshly-installed machine, or re-extract per the
|
||||
To refresh them, copy the firmware extracted during the Asahi install (from
|
||||
`/etc/nixos/firmware`, or re-extract per the
|
||||
[Asahi NixOS docs](https://github.com/tpwrules/nixos-apple-silicon)) into
|
||||
`system/modules/firmware/` before rebuilding that host.
|
||||
`modules/firmware/` and commit with `git add -f`.
|
||||
|
||||
## Documentation
|
||||
|
||||
All prose documentation lives in [`docs/`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/docs); this README is the overview. The pages are
|
||||
published to **<https://docs.lyrapup.pet/nixfiles/>** by the
|
||||
[`docs-site`](https://code.emmathe.dev/lyrathorpe/docs-site) repository, which clones this repo on
|
||||
every build (on its own push, nightly, or on demand) and assembles the tree:
|
||||
|
||||
```
|
||||
README.md -> docs/nixfiles/index.md # this file becomes the section landing page
|
||||
docs/ -> docs/nixfiles/ # everything here, ordering from docs/.pages
|
||||
```
|
||||
|
||||
Nothing is pushed from this side and there is no build step here — editing a
|
||||
page and merging is all that is required. Files outside `docs/` (bar this
|
||||
README) are **not** synced, so a doc kept next to the code it describes will
|
||||
never appear on the site.
|
||||
|
||||
### Linking rules
|
||||
|
||||
The site has no copy of the source tree, and this README is republished at a
|
||||
different depth from the rest of `docs/`. Both facts break naive relative
|
||||
links, so:
|
||||
|
||||
| Link from | To | Use |
|
||||
| ----------------- | ----------------------- | ---------------------------------------------------------------- |
|
||||
| anywhere | a source file or dir | absolute `https://code.emmathe.dev/.../src/branch/main/…` |
|
||||
| a page in `docs/` | another page in `docs/` | relative (`./keybindings.md`) — correct in Gitea and on the site |
|
||||
| this README | a page in `docs/` | absolute `https://docs.lyrapup.pet/nixfiles/…` |
|
||||
|
||||
`mkdocs build` runs non-strict on the docs-site side, so a broken link fails
|
||||
silently rather than failing the build. Check links by hand when moving a page.
|
||||
|
||||
## Development
|
||||
|
||||
A dev shell and a formatting/lint gate are wired through the flake:
|
||||
|
||||
- `nix develop` — shell with `deadnix`, `statix`, `treefmt`, and the git
|
||||
`pre-commit` hooks (installed automatically on first entry).
|
||||
- `nix fmt` — formats the tree via `treefmt` (nixfmt + shfmt + prettier;
|
||||
generated files and `flake.lock` are excluded).
|
||||
- `nix flake check` — runs formatting, `deadnix`, `statix`, the pre-commit
|
||||
hooks, and evaluates every host. `.editorconfig` carries the base style;
|
||||
`statix.toml` disables the two house-style lints (`repeated_keys`,
|
||||
`empty_pattern`).
|
||||
|
||||
## CI
|
||||
|
||||
[`.gitea/workflows/ci.yaml`](./.gitea/workflows/ci.yaml) gates `nixfmt`
|
||||
formatting and evaluates every NixOS and Darwin host configuration on push/PR.
|
||||
[`.gitea/workflows/ci.yaml`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/.gitea/workflows/ci.yaml) runs `nix flake check`
|
||||
(formatting, `deadnix`, `statix`, the pre-commit hooks) and evaluates every
|
||||
NixOS and Darwin host configuration on push/PR. It always runs (no `paths:`
|
||||
filter) so the required check never hangs pending; the heavy Nix steps are
|
||||
skipped when a PR touches no `.nix`/lockfile/workflow file, and the job still
|
||||
reports green.
|
||||
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
# Section title and ordering for the MkDocs awesome-pages plugin on
|
||||
# docs.lyrapup.pet.
|
||||
#
|
||||
# The title is set explicitly: with no entry in the site's nav, MkDocs derives
|
||||
# the section name from the directory and renders it title-cased as "Nixfiles".
|
||||
title: nixfiles
|
||||
|
||||
# `index.md` is this repository's root README, copied in by the docs-site build
|
||||
# before this directory is synced over the top. The trailing `...` picks up any
|
||||
# page added later, so a new file needs no edit here.
|
||||
nav:
|
||||
- index.md
|
||||
- shell.md
|
||||
- keybindings.md
|
||||
- hosts
|
||||
- ...
|
||||
@@ -0,0 +1 @@
|
||||
title: Hosts
|
||||
@@ -0,0 +1,340 @@
|
||||
# Console — living-room games machine
|
||||
|
||||
Flake host: `lyrathorpe-console`. Desktop (`portable = false`, imports
|
||||
`../../modules/desktop.nix`). Files: `configuration.nix`, `nvidia.nix`,
|
||||
`gaming.nix`, `hardware-configuration.nix`.
|
||||
|
||||
A 4th-generation Core i7 (Haswell) on a UEFI board with an NVIDIA GeForce GTX
|
||||
1070 8 GB, wired to a television. It boots straight into Steam Big Picture and
|
||||
is driven from the sofa with a Bluetooth controller; keyboard and mouse are
|
||||
supported but secondary.
|
||||
|
||||
## Not installed yet
|
||||
|
||||
`hardware-configuration.nix` in this host directory is a **placeholder**, not a
|
||||
hardware scan. It exists so the flake evaluates in CI and assumes the install
|
||||
labels its partitions `nixos` (root, ext4) and `BOOT` (ESP, vfat). Replace the
|
||||
whole file with the output of `nixos-generate-config` run on the machine and
|
||||
commit that. If the labels do not match, the boot fails on a missing device
|
||||
rather than touching the wrong disk.
|
||||
|
||||
Partition the disk GPT with an ESP (vfat, 512 MB is comfortable). Nothing else
|
||||
in the host config depends on the disk layout.
|
||||
|
||||
## Bootloader
|
||||
|
||||
Ordinary PC UEFI firmware, so **systemd-boot** with
|
||||
`canTouchEfiVariables = true` — unlike the Mac Pro, this board is trusted with
|
||||
`efibootmgr` NVRAM writes.
|
||||
|
||||
`boot.loader.timeout = 0`: the boot menu is unreadable from a sofa and unusable
|
||||
without a keyboard, so the default entry boots immediately. **Hold space at
|
||||
power-on** to get the menu back and pick an older generation.
|
||||
`configurationLimit = 10` stops the ESP filling up.
|
||||
|
||||
## Graphics — GTX 1070
|
||||
|
||||
Everything driver-related is in [`nvidia.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/hosts/Console/nvidia.nix).
|
||||
The GTX 1070 is Pascal (GP104), so it is under the same driver constraint as the
|
||||
Mac Pro's Quadro P400:
|
||||
|
||||
- **Driver branch 580** (`nvidiaPackages.legacy_580`), _not_ the nixpkgs default
|
||||
(`production`, currently 595.x). 580 is the last branch supporting
|
||||
Maxwell/Pascal/Volta, maintained as an LTS branch until Aug 2028; a newer
|
||||
branch does not drive this card at all.
|
||||
- `modesetting.enable = true` — mandatory for Wayland. Without
|
||||
`nvidia-drm.modeset=1` neither gamescope nor wlroots gets a usable GBM device,
|
||||
and both the Steam session and Sway fail to start.
|
||||
- `open = false` — the open kernel modules require Turing or later.
|
||||
- Sway runs with `--unsupported-gpu`; wlroots refuses the proprietary driver
|
||||
otherwise. gamescope and cage/ReGreet need no such flag.
|
||||
- `hardware.graphics.enable32Bit` pulls in the lib32 NVIDIA userspace that
|
||||
32-bit Steam titles and Proton's 32-bit prefixes link against.
|
||||
|
||||
The driver is unfree, so it is **not in the binary cache**: the kernel module is
|
||||
compiled on the machine. On a Haswell i7 that is a few minutes, not the Mac
|
||||
Pro's ordeal, but it recurs on every kernel bump. The package names are
|
||||
allowlisted in `unfreePackages` in [`flake.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/flake.nix).
|
||||
|
||||
Verify after a rebuild:
|
||||
|
||||
```sh
|
||||
nvidia-smi
|
||||
lsmod | grep nvidia # nvidia, nvidia_modeset, nvidia_drm
|
||||
```
|
||||
|
||||
## Session model — autologin into Steam
|
||||
|
||||
[`gaming.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/hosts/Console/gaming.nix)
|
||||
sets `programs.steam.gamescopeSession.enable`, which registers a `steam.desktop`
|
||||
Wayland session (gamescope wrapping Steam in tenfoot mode) and installs a
|
||||
`steam-gamescope` launcher. greetd — already present on every Sway host for
|
||||
ReGreet, see [`../../modules/sway.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/modules/sway.nix)
|
||||
— gets an `initial_session` pointing at that launcher:
|
||||
|
||||
```
|
||||
boot
|
||||
└─ greetd initial_session (autologin as lyrathorpe)
|
||||
└─ gamescope --steam -- steam -tenfoot -pipewire-dmabuf
|
||||
├─ Steam library / Proton titles
|
||||
├─ [non-Steam] RetroArch
|
||||
└─ [non-Steam] Clone Hero
|
||||
|
||||
quit Steam → greetd default_session → ReGreet → pick Sway (keyboard + mouse)
|
||||
```
|
||||
|
||||
So there is no greeter at boot and no keyboard needed. Quitting Steam drops back
|
||||
to ReGreet, where the ordinary Sway session is available for everything else.
|
||||
`services.greetd.restart` defaults to `false` once `initial_session` is set,
|
||||
which is what stops a logout looping straight back into autologin.
|
||||
|
||||
Two details worth knowing:
|
||||
|
||||
- The launcher is referenced as `/run/current-system/sw/bin/steam-gamescope`.
|
||||
The steam module builds that script privately and only adds it to
|
||||
`environment.systemPackages`, so there is no package attribute to point at.
|
||||
- `programs.gamescope.capSysNice = true` installs gamescope as a setcap wrapper
|
||||
in `/run/wrappers/bin` instead of the system profile. That path precedes the
|
||||
system profile on `PATH`, so `steam-gamescope` still resolves it.
|
||||
|
||||
The greeter is **Dvorak**, like every other host here (`modules/sway.nix` forces
|
||||
`XKB_DEFAULT_VARIANT=dvorak` on cage). Only relevant if someone else has to type
|
||||
a password.
|
||||
|
||||
### Adding RetroArch and Clone Hero to Big Picture
|
||||
|
||||
Both are installed system-wide but are not Steam titles. Add each once, from a
|
||||
Sway session, via Steam's **Games → Add a Non-Steam Game**; they then appear in
|
||||
Big Picture and inherit Steam Input, so the controller works in them without
|
||||
further configuration.
|
||||
|
||||
## Emulation — RetroArch
|
||||
|
||||
`gaming.nix` builds RetroArch through `pkgs.retroarch-bare.wrapper`, which wires
|
||||
up the packaged assets, core info and joypad autoconfig profiles. Cores:
|
||||
|
||||
| System | Core |
|
||||
| -------------------------------------- | ------------------------ |
|
||||
| NES | `nestopia` |
|
||||
| SNES | `snes9x` |
|
||||
| Game Boy / Color | `gambatte` |
|
||||
| Game Boy Advance | `mgba` |
|
||||
| Nintendo 64 | `mupen64plus` |
|
||||
| Nintendo DS | `melonds` |
|
||||
| GameCube / Wii | `dolphin` |
|
||||
| Master System / Game Gear / Mega Drive | `genesis-plus-gx` |
|
||||
| 32X / Mega CD | `picodrive` |
|
||||
| Saturn | `beetle-saturn` |
|
||||
| Dreamcast / NAOMI | `flycast` |
|
||||
| PlayStation | `beetle-psx-hw` |
|
||||
| PlayStation 2 | `pcsx2` (LRPS2) |
|
||||
| PSP | `ppsspp` |
|
||||
| Arcade | `fbneo`, `mame2003-plus` |
|
||||
| DOS | `dosbox-pure` |
|
||||
|
||||
A handful of settings are applied on every launch via `--appendconfig`, so they
|
||||
are fixed policy rather than saved preferences — changing them in the UI will
|
||||
not stick. Everything else stays user-editable as normal.
|
||||
|
||||
- `menu_driver = ozone` — the controller-navigable menu.
|
||||
- `video_fullscreen = true`.
|
||||
- `input_menu_toggle_gamepad_combo = 2` — **L3+R3 opens the RetroArch menu**
|
||||
from inside a running core. Without a pad combo there is no way to exit a game
|
||||
without a keyboard. No retro system emulated here has L3/R3 on its own
|
||||
controller, so the binding cannot collide with a game.
|
||||
- `system_directory`, `savefile_directory`, `savestate_directory`,
|
||||
`playlist_directory`, `screenshot_directory`, `thumbnails_directory` and
|
||||
`rgui_browser_directory` — all pointed at the shared library described below,
|
||||
rather than scattered through `~/.config/retroarch`.
|
||||
|
||||
An unrecognised key in an appended config is ignored **silently**, so those key
|
||||
names are worth keeping in step with upstream if RetroArch is ever bumped
|
||||
across a major version.
|
||||
|
||||
### BIOS files and expectations
|
||||
|
||||
Several cores need BIOS or firmware images that are not redistributable and are
|
||||
therefore not packaged. Drop them in `/srv/games/bios`, which is RetroArch's
|
||||
system directory on this host:
|
||||
|
||||
- **PlayStation 2** (`pcsx2`) — a PS2 BIOS dump. The core will not boot anything
|
||||
without one.
|
||||
- **Saturn** (`beetle-saturn`) — region BIOS images.
|
||||
- **Dreamcast** (`flycast`) — `dc_boot.bin` / `dc_flash.bin` for most titles.
|
||||
- **Nintendo DS** (`melonds`) — optional, but DSi mode and some titles want the
|
||||
real BIOS/firmware.
|
||||
|
||||
Be honest about the two heaviest cores. `dolphin` and `pcsx2` are libretro ports
|
||||
of emulators whose upstream effort goes into their **standalone** builds; the
|
||||
cores lag on compatibility and are the first place to look when a GameCube, Wii
|
||||
or PS2 title misbehaves. If a game does not cooperate, add the standalone
|
||||
emulators to `environment.systemPackages` in `gaming.nix`:
|
||||
|
||||
```nix
|
||||
pkgs.dolphin-emu # GameCube / Wii
|
||||
pkgs.pcsx2 # PlayStation 2
|
||||
```
|
||||
|
||||
Both are controller-driven and can be added to Big Picture the same way as
|
||||
RetroArch. The hardware is not the limit here — a GTX 1070 and a Haswell i7 run
|
||||
PS2 and Wii comfortably.
|
||||
|
||||
Five cores (`snes9x`, `genesis-plus-gx`, `picodrive`, `fbneo`,
|
||||
`mame2003-plus`) carry upstream licences with non-commercial or
|
||||
no-redistribution-for-profit clauses, so their derivation names are in
|
||||
`unfreePackages` in `flake.nix`. Nothing else in the core set needs it.
|
||||
|
||||
## Games library layout
|
||||
|
||||
Content lives under `/srv/games`, deliberately outside any home directory: it is
|
||||
bulky, it is the thing most likely to move to its own disk, and it is shared
|
||||
between Steam, RetroArch and Clone Hero rather than owned by one of them.
|
||||
Mounting a second drive at `/srv/games` is the only change that move needs.
|
||||
|
||||
`gaming.nix` creates the tree with `systemd.tmpfiles.rules` at every boot:
|
||||
|
||||
```
|
||||
/srv/games/
|
||||
├── roms/ # RetroArch content browser opens here
|
||||
│ ├── nes/ snes/ gb/ gbc/ gba/ n64/ nds/ gc/ wii/
|
||||
│ ├── mastersystem/ gamegear/ megadrive/ sega32x/ segacd/
|
||||
│ ├── saturn/ dreamcast/
|
||||
│ ├── psx/ ps2/ psp/
|
||||
│ └── arcade/ dos/
|
||||
├── bios/ # RetroArch system dir: BIOS and firmware
|
||||
├── saves/ # in-game saves
|
||||
├── states/ # save states
|
||||
├── playlists/
|
||||
├── screenshots/
|
||||
├── thumbnails/
|
||||
├── steam/ # second Steam library folder
|
||||
└── clonehero/
|
||||
├── songs/
|
||||
└── backgrounds/
|
||||
```
|
||||
|
||||
Directory names under `roms/` follow the libretro/ES-DE convention, so a scraper
|
||||
or a second frontend recognises them without anything being renamed.
|
||||
|
||||
Everything is `lyrathorpe:users` mode **2775**. The setgid bit matters: the
|
||||
owning group is carried onto anything created inside, so a second account — or
|
||||
an `rsync` from another machine — does not leave behind files the TV user cannot
|
||||
write. The rules create directories if missing and otherwise leave them alone;
|
||||
nothing here removes or rewrites content.
|
||||
|
||||
RetroArch is pointed at these paths declaratively. The other two have to be told
|
||||
once, in their own UIs:
|
||||
|
||||
- **Steam** — Settings → Storage → the `+` control → add `/srv/games/steam` as a
|
||||
library folder. Games installed there survive a reinstall of the OS.
|
||||
- **Clone Hero** — set the song library path to `/srv/games/clonehero/songs` from
|
||||
its settings screen. Clone Hero keeps its own config in `~/.clonehero`.
|
||||
|
||||
## Steam and Proton
|
||||
|
||||
`programs.steam.enable` already arranges most of what Proton needs, and it is
|
||||
worth recording so it is not re-litigated:
|
||||
|
||||
- `hardware.graphics` with `enable32Bit` — the 32-bit GL/Vulkan userspace
|
||||
Proton's 32-bit prefixes link against.
|
||||
- Steam's udev rules (`hardware.steam-hardware.enable`) — controller and
|
||||
hidraw access, which is also what lets `dualsensectl` talk to a DualSense.
|
||||
- 32-bit PipeWire ALSA (`services.pipewire.alsa.support32Bit`), derived from
|
||||
`alsa.enable`, which `gaming.nix` turns on for the older native titles that
|
||||
talk to ALSA directly rather than through the Pulse shim.
|
||||
- Wine's fonts — Liberation, DejaVu, FreeFont and the Noto set arrive with
|
||||
`fonts.enableDefaultPackages` plus `modules/common-nixos.nix`. Liberation is
|
||||
metric-compatible with the Microsoft core fonts, so text lays out correctly
|
||||
without shipping unfree `corefonts`.
|
||||
- `vm.max_map_count` is **1048576** in the nixpkgs default sysctls, above what
|
||||
DX12 and Unreal titles need. No override required — this is the one people
|
||||
usually copy from Arch wiki posts and it is already handled.
|
||||
|
||||
What is **not** covered by default, and is set explicitly in `gaming.nix`:
|
||||
|
||||
- `systemd.settings.Manager.DefaultLimitNOFILE = "1024:1048576"`. esync opens
|
||||
one eventfd per Wine synchronisation object and runs out against systemd's
|
||||
default 524288 hard limit in the heaviest titles. Only the hard limit is
|
||||
raised; the soft limit stays at 1024, because lifting that breaks
|
||||
`select()`-based programs elsewhere on the system.
|
||||
- `extraCompatPackages = [ pkgs.proton-ge-bin ]`. The module puts its
|
||||
`steamcompattool` output on `STEAM_EXTRA_COMPAT_TOOLS_PATHS`, which is what
|
||||
makes **GE-Proton** appear in the client's compatibility list.
|
||||
- `protontricks.enable` — winetricks against a Proton prefix, the standard
|
||||
repair when a title needs a runtime (dotnet, vcrun, Media Foundation) Proton
|
||||
does not ship.
|
||||
- `programs.gamemode.enable` — applies the performance CPU governor around games
|
||||
that request it.
|
||||
|
||||
One thing is **not declarative**: Steam Play must be switched on in the client,
|
||||
once, per account — **Settings → Compatibility → Enable Steam Play for all other
|
||||
titles**. Nix cannot set this; it lives in Steam's own config.
|
||||
|
||||
Verify the Proton side after installing:
|
||||
|
||||
```sh
|
||||
vulkaninfo --summary # 64-bit ICD
|
||||
nvidia-smi # driver up
|
||||
ulimit -Hn # expect 1048576
|
||||
# in a game's launch options, to confirm esync/fsync are active:
|
||||
# PROTON_LOG=1 %command% → ~/steam-<appid>.log
|
||||
```
|
||||
|
||||
## Controllers
|
||||
|
||||
- **Xbox One / Series over Bluetooth** — `hardware.xpadneo.enable`. The
|
||||
out-of-tree driver; the in-kernel `xpad` handles these badly over Bluetooth
|
||||
(wrong button mapping, no rumble). The module enables bluez itself.
|
||||
- **Xbox 360, wired** — in-kernel `xpad`, autoloaded by udev on plug-in.
|
||||
Nothing to configure. The kernel is built with `CONFIG_JOYSTICK_XPAD=m`,
|
||||
`CONFIG_JOYSTICK_XPAD_FF=y` (rumble) and `CONFIG_JOYSTICK_XPAD_LEDS=y`. The
|
||||
360 wireless PC receiver uses the same driver and works the same way.
|
||||
- **DualSense / DualShock 4** — in-kernel `hid-playstation`, over both USB and
|
||||
Bluetooth. No driver config. `dualsensectl` is installed for LED, battery and
|
||||
microphone control; it works because Steam's udev rules grant hidraw access.
|
||||
- **Clone Hero guitars** — plain USB HID gamepads, handled in-kernel. Nothing to
|
||||
configure.
|
||||
|
||||
`hardware.bluetooth.powerOnBoot` is set so the adapter is up before the Steam
|
||||
session starts and a pad can reconnect unattended.
|
||||
`settings.General.Experimental = true` is what enables battery level reporting
|
||||
for Bluetooth gamepads — it is still behind bluez's experimental flag.
|
||||
|
||||
Pair a new controller from Big Picture (**Settings → Controller**), or from a
|
||||
Sway session with `bluetoothctl`. If a pad connects but no input arrives, check
|
||||
`journalctl -b -u bluetooth` and confirm `hid_xpadneo` is loaded
|
||||
(`lsmod | grep xpadneo`).
|
||||
|
||||
The Xbox One / Series USB **wireless dongle** is deliberately not configured. It
|
||||
needs `hardware.xone.enable`, which **blacklists `xpad`** — that would break the
|
||||
wired 360 pads — as well as `mt76x2u`, and pulls in proprietary dongle firmware.
|
||||
Not worth the side effects unless that dongle is actually in use, and if it ever
|
||||
is, the 360 pads have to be re-tested.
|
||||
|
||||
## Untested claims
|
||||
|
||||
This host has not been built or booted yet. Two things are worth watching on
|
||||
first boot:
|
||||
|
||||
- **gamescope on the proprietary NVIDIA driver.** `gaming.nix` sets
|
||||
`GBM_BACKEND=nvidia-drm` and `__GLX_VENDOR_LIBRARY_NAME=nvidia` for the
|
||||
session, which is the standard fix, but the combination has a history of
|
||||
needing tweaks. If the session dies at startup, switch the greeter back to
|
||||
interactive by commenting out `services.greetd.settings.initial_session`, log
|
||||
into Sway, and read `journalctl --user -b`.
|
||||
- **Television resolution and refresh.** gamescope takes the output's native
|
||||
mode by default. Add `gamescopeSession.args = [ "-W" "3840" "-H" "2160" "-r"
|
||||
"60" ]` if a specific mode is wanted.
|
||||
|
||||
There is no HDMI-CEC configuration here, so the TV remote will not drive the
|
||||
box; that needs a Pulse-Eight adapter or a working CEC bridge on the board.
|
||||
Nothing boots to a splash screen either — Plymouth was left out deliberately, as
|
||||
early KMS with the proprietary driver makes it unreliable.
|
||||
|
||||
## Networking
|
||||
|
||||
Wired NetworkManager from `../../modules/desktop.nix`; `modules/ssh.nix` adds
|
||||
key-only sshd, which is the practical way to administer a machine with no
|
||||
keyboard attached. The firewall is default-deny (`modules/workstation.nix`);
|
||||
Steam Remote Play and local network game transfers open their own ports through
|
||||
`programs.steam`.
|
||||
@@ -0,0 +1,51 @@
|
||||
# macOS (nix-darwin) — `lyrathorpe-mac`
|
||||
|
||||
Flake host: `lyrathorpe-mac` (`aarch64-darwin`). Apple Silicon Mac managed by
|
||||
**nix-darwin** from this same flake. Built via `mkDarwinHost` (single-user —
|
||||
macOS owns the account; identity still comes from the registry). Files:
|
||||
`configuration.nix`.
|
||||
|
||||
## What this host is
|
||||
|
||||
A macOS workstation. The interactive user environment (shell, git, editor,
|
||||
Claude) is the **shared `../../home` bundle** — the same modules the Linux hosts
|
||||
use — so the terminal experience matches. The Linux-only `desktop.nix`/`sway.nix`
|
||||
are intentionally left out. This host config covers the macOS-specific layer:
|
||||
system packages, Homebrew, and macOS UI defaults.
|
||||
|
||||
## Package sourcing
|
||||
|
||||
- **nixpkgs** (`environment.systemPackages`) for CLI tooling and libraries.
|
||||
- **Homebrew**, owned declaratively by `nix-homebrew` (Rosetta enabled for
|
||||
x86_64 formulae). The `brews`/`casks` lists are **authoritative**:
|
||||
`onActivation.cleanup = "zap"` uninstalls anything not declared. GUI apps are
|
||||
casks (nixpkgs darwin GUI support is unreliable); a few version-pinned
|
||||
toolchains and the PWA host stay on brew for continuity.
|
||||
- **Mac App Store** apps are **not** declarative: nix-darwin 26.05 runs
|
||||
activation as root, and `mas` cannot reach the App Store session from root.
|
||||
Install them by hand with `mas install <id>` from a GUI Terminal (the `mas`
|
||||
CLI is in `environment.systemPackages`).
|
||||
|
||||
## macOS integration
|
||||
|
||||
- `security.pam.services.sudo_local` — **Touch ID for sudo** (and
|
||||
`darwin-rebuild`'s sudo prompt), kept in `sudo_local` so it survives OS
|
||||
updates. `reattach` pulls in `pam_reattach` so Touch ID works inside tmux
|
||||
(which the terminals auto-start).
|
||||
- `system.defaults` — declarative dock / finder / global / trackpad preferences,
|
||||
applied on activation and reversible. This is the main reason to run nix-darwin
|
||||
beyond package management.
|
||||
- The JetBrainsMono Nerd Font is installed to `/Library/Fonts`; set it in
|
||||
iTerm2 (Settings → Profiles → Text → Font) so the tmux statusline glyphs
|
||||
render.
|
||||
|
||||
## stateVersion
|
||||
|
||||
`system.stateVersion = 5` (the nix-darwin state version, an integer — not a
|
||||
NixOS release string). Read `darwin-rebuild changelog` before changing it.
|
||||
|
||||
## Apply
|
||||
|
||||
```sh
|
||||
darwin-rebuild switch --flake .#lyrathorpe-mac
|
||||
```
|
||||
@@ -0,0 +1,87 @@
|
||||
# Work WSL box — `emmathorpe-edaas`
|
||||
|
||||
Flake host: `emmathorpe-edaas` (`x86_64-linux`). NixOS running under
|
||||
**NixOS-WSL** on the corporate Windows machine. Headless: no Sway desktop
|
||||
(`features.swayDesktop.enable = false`), plain WSL shell login. Files:
|
||||
`configuration.nix`.
|
||||
|
||||
## What this host is
|
||||
|
||||
The day-to-day work environment. It layers the corporate Kubernetes / Helm /
|
||||
Terraform / cloud toolchain and a couple of work-only editor language servers on
|
||||
top of the shared home profile. The system config here is thin — it is mostly
|
||||
WSL plumbing; the user-facing tooling lives in
|
||||
[`../../users/emmathorpe/work.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/emmathorpe/work.nix).
|
||||
|
||||
## WSL specifics
|
||||
|
||||
- `wsl.enable`, default user `emmathorpe`, Windows PATH interop and start-menu
|
||||
launchers on. `/etc/hosts` generation is off (`generateHosts = false`).
|
||||
- **Docker Desktop integration**, not the native daemon as the primary path:
|
||||
`wsl.extraBin` shims the coreutils/`groupadd`/`usermod` binaries Docker
|
||||
Desktop's `wsl-distro-proxy` expects, and `docker-desktop-proxy.script` is
|
||||
patched to the real proxy path. The native `virtualisation.docker` is also
|
||||
enabled (with `enableOnBoot` + `autoPrune`).
|
||||
- `programs.ssh.systemd-ssh-proxy.enable = false` — the NixOS-WSL store is a
|
||||
read-only VHD owned by `nobody`, and OpenSSH rejects the generated
|
||||
`ssh-proxy` Include as "Bad owner or permissions", which would break ssh/git
|
||||
for every command. The vsock proxy it provides is unused under WSL.
|
||||
- `networking.hostName = "emmathorpe-edaas"` matches the flake attribute so
|
||||
`nh os switch` resolves without `-H`.
|
||||
|
||||
## Renovate review timer
|
||||
|
||||
The host-table entry sets `users.emmathorpe.linger = true` so the user's
|
||||
`systemd --user` instance stays alive without an open login session. That keeps
|
||||
the daily headless **Renovate PR review** timer firing — defined in
|
||||
[`../../users/emmathorpe/renovate-review.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/emmathorpe/renovate-review.nix)
|
||||
(imported only from `work.nix`, so it exists on this machine alone). See that
|
||||
file's header for the auth (Vertex AI ADC), triage policy, and caveats.
|
||||
|
||||
## Secret Service (keychain)
|
||||
|
||||
`work.nix` sets `services.headlessSecretService.enable = true`, which runs
|
||||
`gnome-keyring` as a `systemd --user` service owning `org.freedesktop.secrets`
|
||||
on the session bus, with the login keyring unlocked at start.
|
||||
|
||||
This exists for **gcx**, the Grafana Cloud CLI. gcx stores its OAuth access and
|
||||
refresh tokens in the keychain unconditionally (its config keeps only opaque
|
||||
`keychain:gcx:v2:...` handles) and has no plaintext fallback, so without a
|
||||
Secret Service `gcx login` authenticates and then fails to persist with "The
|
||||
name is not activatable".
|
||||
|
||||
Home-manager's own `services.gnome-keyring` does not work here: it is
|
||||
`WantedBy=graphical-session-pre.target`, which never activates on this headless
|
||||
box, and it cannot unlock the keyring. See
|
||||
[`../../home/secret-service.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/secret-service.nix) for the full
|
||||
rationale and the security trade-off of an auto-unlocked keyring.
|
||||
|
||||
Only the `secrets` component is started. The `ssh` component is deliberately off
|
||||
— it would claim `SSH_AUTH_SOCK` and displace `services.ssh-agent`, breaking SSH
|
||||
auth and signed commits.
|
||||
|
||||
Checking it:
|
||||
|
||||
```sh
|
||||
systemctl --user status headless-secret-service
|
||||
busctl --user list | grep secrets # expect org.freedesktop.secrets
|
||||
secret-tool search --all service gcx # inspect what gcx stored
|
||||
gcx config check # end-to-end
|
||||
```
|
||||
|
||||
If the keyring password is ever lost or changed, the login keyring cannot be
|
||||
unlocked: delete `~/.local/share/keyrings` and re-run `gcx login`.
|
||||
|
||||
## stateVersion
|
||||
|
||||
`system.stateVersion = "24.11"` — the release this box was first installed on.
|
||||
Leave it; it freezes stateful defaults and is not meant to track the current
|
||||
nixpkgs.
|
||||
|
||||
## Apply
|
||||
|
||||
```sh
|
||||
sudo nixos-rebuild switch --flake .#emmathorpe-edaas
|
||||
# or, since the hostname matches the attribute:
|
||||
nh os switch
|
||||
```
|
||||
@@ -0,0 +1,138 @@
|
||||
# Mac Pro 3,1 (Early 2008) — install notes
|
||||
|
||||
Flake host: `lyrathorpe-macpro31`. Desktop (`portable = false`, imports
|
||||
`../../modules/desktop.nix`). Files: `configuration.nix`, `nvidia.nix`,
|
||||
`hardware-configuration.nix`.
|
||||
|
||||
## Hardware configuration
|
||||
|
||||
`hardware-configuration.nix` here is the real config generated by
|
||||
`nixos-generate-config` on the machine. Root is an **LVM** logical volume
|
||||
(`/dev/mapper/MacPro-Root`, ext4); the ESP (vfat) and swap are referenced by
|
||||
UUID. The initrd carries `dm-snapshot` for the LVM root. Regenerate and commit
|
||||
if the disk layout changes.
|
||||
|
||||
## Bootloader
|
||||
|
||||
The Mac Pro 3,1 has **64-bit EFI**, so it uses **systemd-boot** (no GRUB/CSM
|
||||
shim). `canTouchEfiVariables = false` because Apple's firmware does not reliably
|
||||
accept `efibootmgr` NVRAM writes.
|
||||
|
||||
Apple-EFI quirk: if the firmware boot picker does not show NixOS after install,
|
||||
either
|
||||
|
||||
- uncomment `boot.loader.efi.efiInstallAsRemovable = true;` in
|
||||
`configuration.nix` (installs the fallback `\EFI\BOOT\BOOTX64.EFI`), and/or
|
||||
- "bless" the ESP from macOS.
|
||||
|
||||
Partition the disk GPT with an ESP (vfat).
|
||||
|
||||
## Graphics — NVIDIA Quadro P400
|
||||
|
||||
The stock card (**ATI Radeon HD 2600 XT** or **NVIDIA GeForce 8800 GT**,
|
||||
depending on the unit) has been replaced with an **NVIDIA Quadro P400** (Pascal,
|
||||
GP108). Everything driver-related lives in [`nvidia.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/hosts/MacPro31/nvidia.nix):
|
||||
|
||||
- **Driver branch 580** (`nvidiaPackages.legacy_580`), _not_ the nixpkgs default
|
||||
(`production`, currently 595.x). 580 is the last branch that supports
|
||||
Maxwell/Pascal/Volta and is maintained as an LTS branch until Aug 2028; a
|
||||
newer branch does not drive this card at all.
|
||||
- `modesetting.enable = true` — mandatory for Wayland (sets
|
||||
`nvidia-drm.modeset=1`); without it wlroots gets no GBM device and both Sway
|
||||
and the greeter fail to start.
|
||||
- `open = false` — the open kernel modules require Turing or later.
|
||||
- Sway runs with `--unsupported-gpu` (`programs.sway.extraOptions`); wlroots
|
||||
refuses the proprietary driver otherwise. `cage`/ReGreet needs no such flag.
|
||||
- nouveau and `nvidiafb` are blacklisted automatically by the NVIDIA module.
|
||||
|
||||
The driver is unfree, so it is **not in the binary cache**: the kernel module is
|
||||
compiled on the machine, which on these 2008 Xeons is slow — budget for a long
|
||||
first rebuild and again after every kernel bump. The package names are
|
||||
allowlisted in `unfreePackages` in [`flake.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/flake.nix).
|
||||
|
||||
Note the Mac Pro shows no EFI boot screen with a stock PC card (no Apple EFI
|
||||
ROM): the machine boots blind until KMS brings the display up. That is expected,
|
||||
not a fault.
|
||||
|
||||
Verify after a rebuild:
|
||||
|
||||
```sh
|
||||
nvidia-smi
|
||||
```
|
||||
|
||||
## Docker with CUDA
|
||||
|
||||
`nvidia.nix` also enables Docker and gives containers GPU access via **CDI**
|
||||
(`hardware.nvidia-container-toolkit.enable`), which generates device specs from
|
||||
the host driver at boot (regenerated by a udev rule when the `nvidia` device
|
||||
appears) and turns on the daemon's CDI feature:
|
||||
|
||||
```sh
|
||||
docker run --rm --device=nvidia.com/gpu=all nvidia/cuda:12.9.1-base-ubuntu24.04 nvidia-smi
|
||||
```
|
||||
|
||||
- Use the `--device=nvidia.com/gpu=all` form. `--gpus all` is the legacy
|
||||
runtime-wrapper path (`virtualisation.docker.enableNvidia`), which is
|
||||
deprecated upstream and deliberately not enabled here.
|
||||
- **CUDA version matters.** The P400 is compute capability 6.1 (`sm_61`); CUDA
|
||||
13 dropped Maxwell/Pascal/Volta, so container images must ship a **CUDA 12.x
|
||||
or older** runtime. The 580 driver itself is happy with either.
|
||||
- 2 GB of VRAM, 256 CUDA cores — fine for encode/decode and small models, not
|
||||
for training anything serious.
|
||||
- Docker socket is local-only (no TCP listener, unlike the Pi). Users need the
|
||||
`docker` group; the registry already grants it.
|
||||
|
||||
### "Driver Not Loaded" from the CDI generator
|
||||
|
||||
`nvidia-container-toolkit-cdi-generator.service` fails with
|
||||
`failed to initialize NVML: Driver Not Loaded` whenever the `nvidia` kernel
|
||||
module is not loaded in the **running** kernel. After a kernel bump that is
|
||||
unavoidable — the rebuilt module cannot load until reboot — so the unit is
|
||||
guarded with `ConditionPathExists=/proc/driver/nvidia/version` and skips
|
||||
instead of failing. Without that guard it also takes `docker.service`
|
||||
(`requiredBy`) with it and makes `nixos-rebuild switch` exit non-zero.
|
||||
|
||||
**Reboot after a rebuild that touches the driver or the kernel.** The toolkit's
|
||||
udev rule restarts the generator when the GPU device appears, so the CDI specs
|
||||
are written on the next boot. To check the state:
|
||||
|
||||
```sh
|
||||
lsmod | grep nvidia # nvidia, nvidia_modeset, nvidia_drm, nvidia_uvm
|
||||
cat /proc/driver/nvidia/version
|
||||
nvidia-smi
|
||||
systemctl status nvidia-container-toolkit-cdi-generator.service
|
||||
ls /var/run/cdi # the generated spec
|
||||
```
|
||||
|
||||
If the module is genuinely absent after a reboot, check `dmesg | grep -i
|
||||
nvidia` (build/version mismatch, or nouveau still bound — the module blacklists
|
||||
it, so that should not happen).
|
||||
|
||||
## Claude Code — not installed here
|
||||
|
||||
The dual Harpertown Xeons are **x86-64-v1** (SSE4.1, but no SSE4.2/POPCNT) and
|
||||
the Node runtime Claude Code ships on requires x86-64-v2. `configuration.nix`
|
||||
declares `features.cpu.microarchLevel = 1`, which switches the tool off through
|
||||
the fleet-wide gate in [`../../modules/features.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/modules/features.nix)
|
||||
— see the root README. Forcing `features.claudeCode.enable` on here is an
|
||||
evaluation error, not a broken install.
|
||||
|
||||
## Networking
|
||||
|
||||
Wired Ethernet via NetworkManager (from `desktop.nix`) — the Mac Pro has two
|
||||
gigabit ports.
|
||||
|
||||
## Login
|
||||
|
||||
Graphical login via a Wayland greeter — `greetd` running ReGreet inside the
|
||||
`cage` kiosk compositor — configured centrally in `../../modules/sway.nix` for
|
||||
every Sway host (gated on `features.swayDesktop.enable`). The greeter is forced
|
||||
to the Dvorak layout to match the console and Sway session. Set the user
|
||||
password (`passwd lyrathorpe`) after install, or the greeter cannot
|
||||
authenticate. Requires working KMS (NVIDIA modesetting — see Graphics).
|
||||
|
||||
## Apply
|
||||
|
||||
```sh
|
||||
sudo nixos-rebuild switch --flake .#lyrathorpe-macpro31
|
||||
```
|
||||
@@ -0,0 +1,69 @@
|
||||
# Raspberry Pi 5 (`lyrathorpe-rpi5`)
|
||||
|
||||
Headless `aarch64-linux` server with two roles:
|
||||
|
||||
- **Docker host** — daemon exposed over the network (`docker.nix`).
|
||||
- **nginx reverse proxy** — declarative `virtualHosts` (`reverse-proxy.nix`).
|
||||
|
||||
## Install
|
||||
|
||||
1. Flash a NixOS `aarch64` SD image (or USB) and boot the Pi. The
|
||||
`raspberry-pi-5` profile from `nixos-hardware` (wired in the flake host table)
|
||||
supplies the kernel, firmware and device tree; boot is U-Boot + extlinux.
|
||||
2. Partition/mount the target, then **regenerate the hardware config on the
|
||||
device** and replace the committed placeholder:
|
||||
```sh
|
||||
nixos-generate-config --root /mnt
|
||||
# copy /mnt/etc/nixos/hardware-configuration.nix over
|
||||
# hosts/RPi5/hardware-configuration.nix in this repo, then commit
|
||||
```
|
||||
`hardware-configuration.nix` in this directory is a **placeholder** committed
|
||||
only so the host evaluates in CI. The machine will not boot correctly until it
|
||||
is replaced with the generated one.
|
||||
3. Set the host name to match the flake attribute (already done in
|
||||
`configuration.nix`: `lyrathorpe-rpi5`) and build:
|
||||
```sh
|
||||
sudo nixos-rebuild switch --flake .#lyrathorpe-rpi5
|
||||
# or, once the hostname is live:
|
||||
nh os switch
|
||||
```
|
||||
4. Give the login user a password (`passwd lyrathorpe`) and confirm the key in
|
||||
the user registry (`../../users/registry.nix`, applied by
|
||||
`../../modules/ssh.nix`) is the one you will connect with.
|
||||
|
||||
## Docker socket (security)
|
||||
|
||||
The daemon listens on **plain TCP `2375`, no TLS, no auth**. Access is
|
||||
root-equivalent on this host. The only protection is the nftables rule in
|
||||
`docker.nix`, which accepts `2375` **only** from the trusted LAN subnet
|
||||
(`10.187.1.0/24` by default — change it to match your network). Do not widen
|
||||
that subnet to anything untrusted.
|
||||
|
||||
From a LAN client:
|
||||
|
||||
```sh
|
||||
export DOCKER_HOST=tcp://lyrathorpe-rpi5:2375
|
||||
docker info
|
||||
```
|
||||
|
||||
The secure upgrade path is mutual TLS on `2376` (`--tlsverify` with a CA and
|
||||
client certs); it needs out-of-band cert provisioning and is intentionally not
|
||||
wired here.
|
||||
|
||||
## Adding a reverse-proxy site
|
||||
|
||||
Each proxied service is a Nix entry in `reverse-proxy.nix`:
|
||||
|
||||
```nix
|
||||
services.nginx.virtualHosts."app.example.lan" = {
|
||||
# enableACME = true; forceSSL = true; # once a DNS name + cert exist
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8080"; # e.g. a local container
|
||||
proxyWebsockets = true;
|
||||
};
|
||||
};
|
||||
```
|
||||
|
||||
The example vhost is HTTP-only by design. Turn on `enableACME`/`forceSSL`
|
||||
per-vhost once the host has a real DNS name and the ACME challenge can be met;
|
||||
`443` is already open in the firewall.
|
||||
@@ -0,0 +1,48 @@
|
||||
# ThinkPad T400 — install notes
|
||||
|
||||
Flake host: `lyrathorpe-t400`. Files: `configuration.nix`, the `boot-*.nix`
|
||||
variants, and `hardware-configuration.nix`.
|
||||
|
||||
## Hardware configuration
|
||||
|
||||
`hardware-configuration.nix` here is a hand-written **placeholder**. On the real
|
||||
machine, run `nixos-generate-config`, replace the file, and commit it. It assumes
|
||||
by-label partitions — root `nixos` (ext4) and `swap` — so either label them at
|
||||
install time or swap in the generated UUIDs.
|
||||
|
||||
## Bootloader — import the module matching the flashed firmware
|
||||
|
||||
`configuration.nix` imports exactly one boot module. Default is `boot-bios.nix`;
|
||||
switch by commenting it out and uncommenting the relevant alternative.
|
||||
|
||||
| Firmware | Module | Notes |
|
||||
| ---------------------------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Stock Lenovo BIOS, or coreboot + **SeaBIOS** payload | `boot-bios.nix` | GRUB on the MBR. Set `device` to the real install disk (`/dev/sda` by default). MBR/legacy layout. |
|
||||
| coreboot + **GRUB** payload | `boot-coreboot-grub.nix` | GRUB is config-only (`device = "nodev"`); NixOS does **not** write to a disk. Your coreboot `grub.cfg` (in the flash chip) must `search` for and `configfile` the on-disk `/boot/grub/grub.cfg`, or chainload the disk's GRUB. |
|
||||
| coreboot + **Tianocore/edk2 (UEFI)** payload | `boot-coreboot-uefi.nix` | systemd-boot. `canTouchEfiVariables = true` (coreboot honours NVRAM writes). The module **declares its own ESP** (`/boot` vfat, label `ESP`) — when you regenerate `hardware-configuration.nix`, do **not** let it also define `/boot`. Create + label an `ESP` vfat partition (GPT). |
|
||||
|
||||
## Graphics
|
||||
|
||||
This unit has the optional **discrete ATI Mobility Radeon HD 3470 (RV620)**. The
|
||||
open `radeon` KMS driver is loaded in the initrd for early modesetting; firmware
|
||||
comes from `enableRedistributableFirmware`.
|
||||
|
||||
The T400 has switchable graphics (discrete ATI + Intel GMA 4500MHD). Select
|
||||
**Discrete** in the firmware's graphics setting so only the ATI is live. If you
|
||||
run **Integrated** instead, the Intel `i915` driver takes over with no config
|
||||
change and `radeon` stays idle.
|
||||
|
||||
## Login
|
||||
|
||||
Graphical login via a Wayland greeter — `greetd` running ReGreet inside the
|
||||
`cage` kiosk compositor — configured centrally in `../../modules/sway.nix` for
|
||||
every Sway host (gated on `features.swayDesktop.enable`). The greeter is forced
|
||||
to the Dvorak layout to match the console and Sway session. Set the user
|
||||
password (`passwd lyrathorpe`) after install, or the greeter cannot
|
||||
authenticate. Requires working radeon/i915 KMS (see Graphics).
|
||||
|
||||
## Apply
|
||||
|
||||
```sh
|
||||
sudo nixos-rebuild switch --flake .#lyrathorpe-t400
|
||||
```
|
||||
@@ -0,0 +1,217 @@
|
||||
# Keybindings reference
|
||||
|
||||
Every keyboard shortcut configured across this desktop, and where it is defined.
|
||||
Everything here is managed declaratively through Nix — edit the listed file and
|
||||
rebuild, never the generated dotfiles.
|
||||
|
||||
| Area | Defined in |
|
||||
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Sway (compositor) | [`sway.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/sway.nix) `config.keybindings` + `config.modes`, plus the home-manager Sway module's built-in defaults |
|
||||
| tmux | [`shell.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/shell.nix) `programs.tmux` |
|
||||
| zsh line editor | [`shell.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/shell.nix) `programs.zsh.historySubstringSearch` |
|
||||
| Neovim | [`editor.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/editor.nix) `programs.nixvim` |
|
||||
| foot (terminal) | foot package defaults — only colours are themed (in `sway.nix`) |
|
||||
|
||||
**Conventions**
|
||||
|
||||
- **Super** is the `Mod4` / logo (Windows/Command) key; **Alt** is `Mod1`.
|
||||
- Letter keys are **keysyms** (the character produced), not physical positions.
|
||||
The keyboard is **Dvorak** (`us`/`dvorak`), so e.g. "Super+s" is whatever key
|
||||
types `s` in Dvorak.
|
||||
- Shortcuts apply to every Sway host (MBP, T400, Mac Pro); brightness keys are
|
||||
laptop-only, as noted.
|
||||
|
||||
---
|
||||
|
||||
## Sway
|
||||
|
||||
### Applications & session
|
||||
|
||||
| Shortcut | Action |
|
||||
| ------------------- | ------------------------------------------------------- |
|
||||
| `Super`+`Return` | Open a terminal (foot) |
|
||||
| `Super`+`Space` | App launcher (sway-launcher-desktop in a floating foot) |
|
||||
| `Super`+`d` | App launcher (same as above; module default) |
|
||||
| `Super`+`e` | File manager (nemo) |
|
||||
| `Super`+`c` | Clipboard history picker (clipman → fuzzel) |
|
||||
| `Super`+`l` | Lock screen (swaylock) |
|
||||
| `Super`+`Shift`+`q` | Close the focused window |
|
||||
| `Super`+`Shift`+`c` | Reload the Sway config |
|
||||
| `Super`+`Shift`+`e` | Exit Sway (asks for confirmation) |
|
||||
|
||||
### Focus
|
||||
|
||||
| Shortcut | Action |
|
||||
| ----------------------- | ---------------------------------------- |
|
||||
| `Super`+`←`/`↓`/`↑`/`→` | Move focus by direction |
|
||||
| `Super`+`h`/`j`/`k` | Move focus left / down / up (vim-style) |
|
||||
| `Super`+`a` | Focus the parent container |
|
||||
| `Super`+`Alt`+`Space` | Toggle focus between tiling and floating |
|
||||
|
||||
> Note: vim focus-right would be `Super`+`l`, but that is bound to **lock** here;
|
||||
> use `Super`+`→`.
|
||||
|
||||
### Moving windows
|
||||
|
||||
| Shortcut | Action |
|
||||
| ------------------------------- | ---------------------------------------- |
|
||||
| `Super`+`Shift`+`←`/`↓`/`↑`/`→` | Move the window by direction |
|
||||
| `Super`+`Shift`+`h`/`j`/`k`/`l` | Move the window left / down / up / right |
|
||||
| `Super`+`Shift`+`Space` | Toggle the window floating |
|
||||
|
||||
Mouse (with `Super` held): left-drag moves a window, right-drag resizes it.
|
||||
|
||||
### Layout
|
||||
|
||||
| Shortcut | Action |
|
||||
| ----------- | -------------------------------------------------------------------------------------- |
|
||||
| `Super`+`b` | Split horizontally |
|
||||
| `Super`+`v` | Split vertically |
|
||||
| `Super`+`s` | Stacking layout |
|
||||
| `Super`+`w` | Tabbed layout |
|
||||
| `Super`+`f` | Toggle fullscreen |
|
||||
| `Super`+`y` | **Layout submenu**: `s` stacking · `w` tabbed · `e` toggle split · `Return`/`Esc` exit |
|
||||
|
||||
> The layout submenu's `e` (toggle split) is the home for that action since
|
||||
> `Super`+`e` now opens the file manager.
|
||||
|
||||
### Workspaces
|
||||
|
||||
| Shortcut | Action |
|
||||
| ----------------------- | --------------------------------- |
|
||||
| `Super`+`1`…`0` | Switch to workspace 1…10 |
|
||||
| `Super`+`Shift`+`1`…`0` | Move the window to workspace 1…10 |
|
||||
| `Super`+`z` | Previous workspace |
|
||||
| `Super`+`x` | Next workspace |
|
||||
|
||||
### Scratchpad
|
||||
|
||||
| Shortcut | Action |
|
||||
| ------------------- | --------------------------------- |
|
||||
| `Super`+`Shift`+`-` | Move the window to the scratchpad |
|
||||
| `Super`+`-` | Show / cycle the scratchpad |
|
||||
|
||||
### Modes (submenus)
|
||||
|
||||
| Shortcut | Action |
|
||||
| ------------------- | ------------------------------------------------------------------------------------------------------------ |
|
||||
| `Super`+`r` | **Resize mode**: arrow keys resize; `Return`/`Esc` exit |
|
||||
| `Super`+`y` | **Layout mode** (see Layout above) |
|
||||
| `Super`+`Shift`+`x` | **Power menu**: `l` lock · `e` log out · `s` sleep · `r` reboot · `Shift`+`s` shutdown · `Return`/`Esc` exit |
|
||||
|
||||
### Screenshots
|
||||
|
||||
| Shortcut | Action |
|
||||
| --------------- | ---------------------------------------- |
|
||||
| `Print` | Select a region → swappy (annotate/save) |
|
||||
| `Shift`+`Print` | Focused window → swappy |
|
||||
|
||||
### Audio & media
|
||||
|
||||
| Shortcut | Action |
|
||||
| ----------------------------------------------- | ---------------------- |
|
||||
| `XF86AudioRaiseVolume` / `XF86AudioLowerVolume` | Volume ±5% (wpctl) |
|
||||
| `XF86AudioMute` | Toggle output mute |
|
||||
| `XF86AudioMicMute` | Toggle microphone mute |
|
||||
| `XF86AudioPlay` | Play/pause (playerctl) |
|
||||
| `XF86AudioNext` / `XF86AudioPrev` | Next / previous track |
|
||||
|
||||
### Brightness — laptops only
|
||||
|
||||
| Shortcut | Action |
|
||||
| ----------------------------------------------- | ----------------------------- |
|
||||
| `XF86MonBrightnessUp` / `XF86MonBrightnessDown` | Backlight ±5% (brightnessctl) |
|
||||
|
||||
Present only on portable hosts (T400, MBP); desktops have no internal backlight.
|
||||
|
||||
---
|
||||
|
||||
## tmux
|
||||
|
||||
Prefix is **`Ctrl`+`b`** (default). Copy mode uses **vi** keys.
|
||||
|
||||
| Shortcut | Action |
|
||||
| --------------------------------------- | -------------------------------------------------------------------------------------------- |
|
||||
| `Ctrl`+`b` then `v` | Split into left/right panes |
|
||||
| `Ctrl`+`b` then `s` | Split into top/bottom panes |
|
||||
| `Ctrl`+`h`/`j`/`k`/`l` | Move between panes — and into/out of vim splits — seamlessly (vim-tmux-navigator, no prefix) |
|
||||
| `Alt`+`←`/`→`/`↑`/`↓` | Switch pane by direction (no prefix needed) |
|
||||
| `Ctrl`+`b` then `[` | Enter copy mode (then vi motions; `Space`/`Enter` to select/copy) |
|
||||
| `Ctrl`+`b` then `z` | Zoom / unzoom the focused pane |
|
||||
| `Ctrl`+`b` then `c` | New window |
|
||||
| `Ctrl`+`b` then `n` / `p` | Next / previous window |
|
||||
| `Ctrl`+`b` then `d` | Detach |
|
||||
| `Ctrl`+`b` then `Ctrl`+`s` / `Ctrl`+`r` | Save / restore the session (resurrect; continuum also auto-saves and restores on start) |
|
||||
| Mouse | Enabled — click to focus, drag borders, scroll, select |
|
||||
|
||||
> The stock split keys `%` and `"` are unbound; use `v` / `s` above. `Ctrl`+`b`
|
||||
> then `s` is therefore a split, not the session tree.
|
||||
>
|
||||
> Sessions persist across reboots (resurrect + continuum). Terminals auto-start
|
||||
> tmux; `NO_TMUX=1 <terminal>` opens a bare shell instead.
|
||||
|
||||
---
|
||||
|
||||
## foot (terminal)
|
||||
|
||||
Only colours are themed; these are foot's default key bindings.
|
||||
|
||||
| Shortcut | Action |
|
||||
| --------------------------------------- | ----------------------------- |
|
||||
| `Ctrl`+`Shift`+`c` / `Ctrl`+`Shift`+`v` | Copy / paste (clipboard) |
|
||||
| `Shift`+`Insert` | Paste primary selection |
|
||||
| `Ctrl`+`Shift`+`r` | Search scrollback |
|
||||
| `Ctrl`+`+` / `Ctrl`+`-` / `Ctrl`+`0` | Font larger / smaller / reset |
|
||||
| `Ctrl`+`Shift`+`u` | URL mode (jump to/open links) |
|
||||
| `Ctrl`+`Shift`+`n` | Spawn a new terminal |
|
||||
| `Shift`+`PageUp` / `Shift`+`PageDown` | Scroll back / forward |
|
||||
|
||||
---
|
||||
|
||||
## Neovim
|
||||
|
||||
Leader is **`Space`**. `Ctrl`+`h/j/k/l` is shared with tmux (see above): it moves
|
||||
across vim splits and tmux panes seamlessly. Everything else is stock vim, plus:
|
||||
|
||||
| Shortcut | Action |
|
||||
| ---------------------- | --------------------------------------------------------- |
|
||||
| `,``,` | Toggle the file tree (nvim-tree) — comma pressed twice |
|
||||
| `Ctrl`+`h`/`j`/`k`/`l` | Move between vim splits / tmux panes (vim-tmux-navigator) |
|
||||
| `<leader>ff` | Find files (telescope) |
|
||||
| `<leader>fg` | Live grep (telescope) |
|
||||
| `<leader>fb` | Switch buffer (telescope) |
|
||||
| `<leader>xx` | Diagnostics list (trouble) |
|
||||
| `gc` / `gcc` | Toggle comment (selection / line) |
|
||||
| `gd` | Go to definition (LSP) |
|
||||
| `gr` | List references (LSP) |
|
||||
| `K` | Hover documentation (LSP) |
|
||||
| `<leader>rn` | Rename symbol (LSP; `<leader>` is `Space`) |
|
||||
| `<leader>ca` | Code action (LSP) |
|
||||
|
||||
### Completion menu (nvim-cmp)
|
||||
|
||||
Active only while the completion popup is open (it appears as you type, e.g.
|
||||
file paths):
|
||||
|
||||
| Shortcut | Action |
|
||||
| ----------------------- | ------------------------------------------------------------------ |
|
||||
| `Tab` / `Shift`+`Tab` | Select next / previous item |
|
||||
| `Ctrl`+`n` / `Ctrl`+`p` | Select next / previous item |
|
||||
| `Ctrl`+`Space` | Open the completion menu |
|
||||
| `Enter` | Confirm the highlighted item (no auto-select; otherwise a newline) |
|
||||
| `Ctrl`+`e` | Dismiss the menu |
|
||||
|
||||
LSP covers Nix, Lua, Python and Terraform (the work box adds C# and Helm).
|
||||
Files are formatted on save (conform-nvim). `:Git` opens fugitive; gitsigns
|
||||
shows gutter signs. which-key pops up after `<leader>` to show the rest.
|
||||
|
||||
---
|
||||
|
||||
## zsh
|
||||
|
||||
| Shortcut | Action |
|
||||
| --------- | -------------------------------------------------------------------------------------------------- |
|
||||
| `↑` / `↓` | History **substring** search — type a fragment first, then the arrows cycle matching past commands |
|
||||
|
||||
Bound for both CSI and SS3 cursor sequences, so it works in foot, iTerm2 and
|
||||
the Linux TTY alike.
|
||||
+368
@@ -0,0 +1,368 @@
|
||||
# Interactive shell environment
|
||||
|
||||
Everything the shell, terminal multiplexer, git and ssh do beyond their defaults,
|
||||
and where each is defined. All of it is managed declaratively through
|
||||
home-manager — edit the listed file and rebuild, never the generated dotfiles.
|
||||
|
||||
Keyboard shortcuts have their own reference: [`keybindings.md`](./keybindings.md).
|
||||
|
||||
| Area | Defined in |
|
||||
| -------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
|
||||
| zsh, CLI tools, tmux, ssh, auto-tmux | [`shell.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/shell.nix) |
|
||||
| git (+ delta, commitizen) | [`git.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/git.nix) |
|
||||
| Neovim (nixvim) + LSP | [`editor.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/editor.nix) |
|
||||
| Claude Code (CLAUDE.md, style, memory) | [`claude.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/claude.nix) |
|
||||
| GUI apps, GTK/Firefox theming, cursor | [`desktop.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/desktop.nix) (graphical hosts only) |
|
||||
|
||||
Shared by every host via [`default.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/default.nix); the work box also layers
|
||||
[`work.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/emmathorpe/work.nix) on top (its own ssh config, extra
|
||||
packages, kubecolor, and the C#/Helm language servers). The committer identity (name, email,
|
||||
signing key) comes from the user registry
|
||||
([`../users/registry.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/users/registry.nix)), not this module.
|
||||
|
||||
---
|
||||
|
||||
## zsh
|
||||
|
||||
| Feature | Notes |
|
||||
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| oh-my-zsh | plugins `git`, `man`, `sudo` (Esc-Esc to prepend sudo), `colored-man-pages`, `extract`; theme `robbyrussell` |
|
||||
| Autosuggestion | fish-style history suggestions as you type (→ to accept) |
|
||||
| Syntax highlighting | commands coloured by validity as you type |
|
||||
| Completion | menu completion; the dump is rebuilt on every activation (see Maintenance) |
|
||||
| History | 100k in-memory/on-disk, deduped, space-prefixed commands ignored, timestamped, **shared live across sessions**; file stays at `~/.zsh_history` |
|
||||
| Dotfiles location | `dotDir` is `~/.config/zsh` (XDG) — `.zshrc`/`.zshenv`/`.zcompdump` live there; `~/.zshenv` only bootstraps `$ZDOTDIR` |
|
||||
| History substring search | type a fragment, then ↑/↓ cycles matching past commands — works in foot, iTerm2 and the Linux TTY (both CSI and SS3 arrow encodings bound) |
|
||||
| Prompt | hostname is prefixed when over SSH |
|
||||
|
||||
**Aliases:** `ls`/`ll`/`la`/`lt` → `eza` (icons + git), `cls` → `clear`,
|
||||
`cat`/`du`/`df`/`ps` → their modern equivalents (see "Replacing the classics").
|
||||
git aliases live in git.nix (below).
|
||||
|
||||
## CLI tools
|
||||
|
||||
| Tool | What it gives you |
|
||||
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `fzf` | `Ctrl-R` fuzzy history, `Ctrl-T` file picker, `Alt-C` fuzzy cd (Catppuccin-themed) |
|
||||
| `zoxide` | `z <fragment>` jumps to frecent directories |
|
||||
| `direnv` + `nix-direnv` | per-project environments auto-loaded on `cd` (cached Nix dev shells) |
|
||||
| `eza` | modern `ls` (drives the ls aliases) |
|
||||
| `bat` | syntax-highlighting pager (Catppuccin Mocha theme); behaves like `cat` when piped; also the `MANPAGER` |
|
||||
| `ripgrep` / `fd` | fast search (`rg`) and find (`fd`); also back `fzf` |
|
||||
| `jq` | JSON processor |
|
||||
| `gh` / `tea` | GitHub and Gitea (`code.emmathe.dev`) CLIs; `gh` uses SSH |
|
||||
| `nix-index` | `command-not-found`: an unknown command tells you which Nix package provides it (prebuilt DB, no manual indexing) |
|
||||
| `comma` (`,`) | run an uninstalled program once: `, cowsay hi` |
|
||||
| `nh` | nicer `nixos-rebuild`/`home-manager` with diffs; `$NH_FLAKE` set to the repo. No scheduled GC (it could reap paths a running generation still references) — collect garbage manually with `nh clean all` / `nix-collect-garbage -d` |
|
||||
| `btop` | resource monitor, themed Catppuccin Mocha (vendored theme) |
|
||||
| `lazygit` | git TUI for staging/rebasing, themed to match (`git.nix`) |
|
||||
| `hyperfine` / `sd` | command-line benchmarking; saner find-and-replace than sed |
|
||||
| `tldr` (tealdeer) | worked examples for a command, alongside `man`; the page cache is refreshed by a `tldr-update` user timer |
|
||||
| `jnv` / `fq` | interactive jq-filter builder for JSON; jq syntax over binary formats (ELF, PNG, gzip, mp4…) |
|
||||
| `hexyl` | hex viewer, coloured by byte class |
|
||||
| `ouch` | one command for every archive format (`ouch d`/`c`/`l`) |
|
||||
| `dust` `dysk` `procs` | `du` / `df` / `ps` replacements — aliased over the originals, see below |
|
||||
| `trash-cli` `doggo` `xh` | `rm` (to the XDG trash) / `dig` / `curl` replacements — **not** aliased, see below |
|
||||
|
||||
**Theming:** `fzf`, `bat`, `btop`, `lazygit` and `git`'s `delta` pager are all
|
||||
Catppuccin Mocha, driven from the shared `../lib/catppuccin-mocha.nix` palette / the
|
||||
catppuccin upstream themes.
|
||||
|
||||
**Env & defaults:** `xdg.enable` on; `PAGER`/`MANPAGER` (bat) set in `default.nix`
|
||||
(the editor owns `$EDITOR`/`$VISUAL`); `xdg.mimeApps` maps web→Firefox,
|
||||
directories→nemo (`desktop.nix`).
|
||||
|
||||
## Replacing the classics
|
||||
|
||||
Muscle memory is the expensive part of this, not the packages. Four commands are
|
||||
**shadowed** — the old name now runs a new tool. Everything else keeps a new
|
||||
name, so the original is never displaced.
|
||||
|
||||
### Shadowed by an alias
|
||||
|
||||
| You type | You now run | The original is still `command <name>` / `\<name>` |
|
||||
| -------- | -------------------- | -------------------------------------------------- |
|
||||
| `cat` | `bat --paging=never` | `command cat` |
|
||||
| `du` | `dust` | `command du` |
|
||||
| `df` | `dysk` | `command df` |
|
||||
| `ps` | `procs` | `command ps` |
|
||||
|
||||
Only read-only commands are shadowed, so the worst case of a wrong flag is a
|
||||
retype rather than lost data. `rm`, `grep`, `curl` and `find` are deliberately
|
||||
left alone — see "Left alone on purpose" below.
|
||||
|
||||
**Where the aliases apply.** They are written into `~/.config/zsh/.zshrc`, so
|
||||
they exist only in an **interactive zsh**:
|
||||
|
||||
- shell scripts, `Makefile` recipes and anything another program `exec`s get the
|
||||
real coreutils binary — nothing that parses output can break;
|
||||
- `sudo du -sh /var` runs the real `du`: zsh does not expand an alias after
|
||||
`sudo`;
|
||||
- `KUBECONFIG=… kubectl …` **does** expand — zsh expands aliases after a
|
||||
variable-assignment prefix. That is what makes the kubecolor alias on the work
|
||||
box (below) useful rather than a special case you have to remember.
|
||||
|
||||
### Flag gotchas
|
||||
|
||||
These replacements are not drop-in. The two marked **silent** are the dangerous
|
||||
ones — they succeed and answer a different question than the one you asked.
|
||||
Everything else fails loudly.
|
||||
|
||||
| Old habit | What happens now | Do this instead |
|
||||
| ------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
|
||||
| `du -sh dir` | dust prints its usage and exits non-zero — `-h` is not a dust flag | `dust dir` (units are human by default; the total is the last row) |
|
||||
| `du -s dir` | **silent**: dust's `-s` is `--apparent-size`, not `--summarize` | `dust -d 0 dir` for a single total line |
|
||||
| `du --max-depth=2` | not recognised | `dust -d 2` |
|
||||
| `df -h` | dysk rejects `-h` | `dysk` (SI units by default; `-u binary` for 1024-based) |
|
||||
| `df -i` | not recognised | `dysk -c +inodes` |
|
||||
| `df -a` | works, same meaning (all mount points) | — |
|
||||
| `df /some/path` | works, same meaning (the device holding that path) | — |
|
||||
| `ps aux` | **silent**: `aux` is read as a search keyword, so you get only processes whose command line contains the string "aux" | `procs` lists everything; `procs <pattern>` filters |
|
||||
| `ps -ef` | `error: unexpected argument '-e'` | `procs` |
|
||||
| `ps -p 1234` | not recognised | `procs 1234` |
|
||||
| `procs -a` | **silent**: `-a` is `--and` (combine search keywords), not "all" | drop it — `procs` already shows everything |
|
||||
| `cat -v` / `cat -e` | `error: unexpected argument` | `cat -A` does work (bat implements show-all); else `command cat -v` |
|
||||
| `cat -n` | works, but bat's number column, not coreutils' layout | fine to read; `command cat -n` when the exact layout matters |
|
||||
| `cat <binary>` | prints `<BINARY>` to a terminal instead of dumping the bytes | `hexyl <file>`, or `command cat` to dump |
|
||||
|
||||
Useful new capabilities in the same tools: `procs --tree`, `procs --watch`,
|
||||
`dust -r` (largest at the top), `dysk -s size`, `dysk -f 'type=ext4'`.
|
||||
|
||||
**Piping is safe for `cat`.** bat drops all decoration and colour when stdout is
|
||||
not a terminal, so `cat f | sha256sum` is byte-for-byte what coreutils `cat`
|
||||
would have given. The others are TUI-shaped tables with no stable format — if
|
||||
something needs to parse them, use `dysk --json`/`--csv`, `procs --json`, or the
|
||||
original binary.
|
||||
|
||||
### Renamed, not shadowed
|
||||
|
||||
| Instead of | Use | Notes |
|
||||
| --------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| `rm` | `trash` | Moves to the XDG trash. `trash-list`, `trash-restore` (interactive picker), `trash-empty [days]`. It never deletes in place: if it cannot create a trash directory on that filesystem it errors out. |
|
||||
| `dig` / `nslookup` | `doggo` | `doggo example.com MX @1.1.1.1`; `--json` for scripting. Not aliased — `dig` (from the `bind` closure that other modules pull in) stays where scripts expect it. |
|
||||
| `curl` (interactive poking) | `xh` | HTTPie syntax: `xh POST api.example/x name=lyra`. `xhs` is `xh --https`. **curl stays installed and unaliased** — it is what scripts and CI use. |
|
||||
| `tar` / `unzip` / `7z` | `ouch` | `ouch d file.<anything>`, `ouch c out.tar.zst src/`, `ouch l archive`. Format is inferred from the extension. The oh-my-zsh `extract` function still works too. |
|
||||
| `jq` (exploring a payload) | `jnv` | Interactive filter builder over a JSON file; it prints the jq expression you built. `jq` remains the scripting tool. |
|
||||
| `hexdump -C` / `xxd` | `hexyl` | `hexyl -n 256 -s 0x40 file` for a window into a large file. |
|
||||
| `strings` on a known format | `fq` | jq syntax over binary formats: `fq -d elf '.sections[].name' ./bin`. |
|
||||
| skimming a man page | `tldr` | Worked examples. `man` is untouched (and still rendered through bat). |
|
||||
|
||||
### Left alone on purpose
|
||||
|
||||
- **`grep`** is not aliased to `rg`. ripgrep is recursive by default, skips
|
||||
gitignored and hidden files, and uses a different regex dialect (no
|
||||
backreferences, no POSIX classes in the same form). A `grep` habit silently
|
||||
producing fewer matches is a worse failure than typing three characters. Type
|
||||
`rg`.
|
||||
- **`rm`** is not aliased to `trash-put`. Retraining `rm` to mean "recoverable"
|
||||
is a habit that follows you onto every machine where it is not — remote hosts,
|
||||
root shells, containers, CI. Type `trash`.
|
||||
- **`find`** is not aliased to `fd`; the `-exec`/`-print0` vocabulary has no
|
||||
equivalent and scripts lean on it. Type `fd`.
|
||||
- **`sed`** is not aliased to `sd`; `sd` takes real regex and literal
|
||||
replacements, not sed's expression language. Type `sd`.
|
||||
- **coreutils itself** is not swapped for `uutils-coreutils`. It is packaged and
|
||||
tempting, but every Nix builder and shell script on these hosts is written
|
||||
against GNU behaviour, including its forty-year-old edge cases.
|
||||
|
||||
### Work box only: kubectl → kubecolor
|
||||
|
||||
On EDaaS (`work.nix`) `kubectl` is aliased to **kubecolor**, which runs the real
|
||||
kubectl underneath and colourises what comes back. Nothing to relearn: every
|
||||
flag, subcommand and plugin passes straight through, unrecognised output is
|
||||
printed verbatim, and colour is dropped automatically when stdout is not a
|
||||
terminal — so `kubectl get -o json … | jq` is unchanged. The alias also applies
|
||||
to `KUBECONFIG=prodconfig kubectl …`, per the alias-expansion note above.
|
||||
Completions are kubectl's own (`compdef kubecolor=kubectl`). Escape hatch as
|
||||
ever: `command kubectl`.
|
||||
|
||||
### sudo → sudo-rs
|
||||
|
||||
Every NixOS host now uses **sudo-rs**, the memory-safe reimplementation, in
|
||||
place of `sudo` (`modules/common-nixos.nix`; the macOS host keeps Apple's sudo
|
||||
with Touch ID). Day to day there is nothing to learn — `sudo`, `sudo -i`,
|
||||
`sudo -u`, `sudo -l`, `sudoedit` and `visudo` all behave as before against this
|
||||
fleet's stock "wheel, with a password" policy. What it does **not** implement:
|
||||
host aliases, LDAP/SSSD sudoers, `sudoreplay`, and most `Defaults` settings.
|
||||
Needing any of those means reverting to `security.sudo`.
|
||||
|
||||
One exception to the password: the EDaaS box sets
|
||||
`security.sudo-rs.wheelNeedsPassword = false`. NixOS-WSL ships that default for
|
||||
`security.sudo` — WSL has no console login, so the trust boundary is the Windows
|
||||
session and the Linux account password is never one the user chose — and the
|
||||
option does not carry across to the `security.sudo-rs` module, which defaults to
|
||||
requiring one. Without the explicit setting, `sudo` on that host prompts for a
|
||||
password nobody knows.
|
||||
|
||||
If a host ever refuses to escalate, get a root shell that does not go through
|
||||
sudo (`wsl -u root -d NixOS` on the work box; the console or a serial/HDMI login
|
||||
elsewhere) and roll back with `nixos-rebuild switch --rollback`, or pick the
|
||||
previous generation from the boot menu.
|
||||
|
||||
## tmux
|
||||
|
||||
**Auto-start:** opening any interactive terminal — foot, iTerm2, the WSL shell, the
|
||||
Linux console — drops you straight into a tmux session named `main` (attach if it
|
||||
exists, else create). Panes run a plain non-login zsh. It deliberately does **not**
|
||||
fire for SSH sessions, VS Code's integrated terminal, already-inside-tmux, or
|
||||
non-interactive shells. Escape hatch: `NO_TMUX=1 <terminal>` opens a bare shell.
|
||||
|
||||
| Setting | Value |
|
||||
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ |
|
||||
| Mode keys | vi |
|
||||
| Mouse | on |
|
||||
| Scrollback | 500000 lines |
|
||||
| `escape-time` | 10ms (the 500ms default lagged vim's ESC) |
|
||||
| `focus-events` | on (vim autoread) |
|
||||
| `base-index` / `pane-base-index` | 1 |
|
||||
| Splits | `prefix s` vertical, `prefix v` horizontal (stock `%`/`"` unbound) |
|
||||
| Pane nav | `Alt`+arrows (no prefix) |
|
||||
| Terminal | `default-terminal tmux-256color`; truecolor advertised per outer terminal (`foot*`, `xterm-256color`/iTerm2) via `terminal-features … RGB` |
|
||||
| Clipboard | `set-clipboard on`; foot `terminal-features` advertise truecolor/sync/OSC52/title/cursor |
|
||||
|
||||
**Plugins:** `sensible`, `vim-tmux-navigator` (Ctrl-h/j/k/l across vim ↔ tmux),
|
||||
`yank`, `extrakto` (`prefix`+`Tab`: fzf-grab paths/URLs/text from the pane into
|
||||
the prompt), `catppuccin` (Mocha statusline), `resurrect` + `continuum`
|
||||
(sessions auto-save and restore across reboots). The statusline draws Nerd-Font
|
||||
glyphs — see Fonts.
|
||||
|
||||
## Fonts
|
||||
|
||||
**JetBrainsMono Nerd Font**, **Noto Sans** and **Noto Color Emoji** are
|
||||
installed on every host (in `common-nixos.nix`, because tmux/terminals run
|
||||
everywhere; the Mac installs the Nerd Font to `/Library/Fonts` via the Darwin
|
||||
config). `fonts.fontconfig.defaultFonts` maps the generic families so anything
|
||||
asking for `monospace` gets the Nerd Font (with emoji fallback) — this also
|
||||
gives the WSL box emoji/sans coverage it otherwise lacked. foot uses the Nerd
|
||||
Font as its main font automatically. iTerm2's font is a GUI setting — set it to
|
||||
_JetBrainsMono Nerd Font_ (Settings → Profiles → Text → Font) so the tmux
|
||||
statusline glyphs render instead of `?`.
|
||||
|
||||
## Editor (Neovim)
|
||||
|
||||
`nvim` — aliased to `vi`/`vim`, and set as `$EDITOR`/`$VISUAL` — is configured
|
||||
declaratively with **nixvim**, so the same plugins and config are baked in on
|
||||
every host. Migrated from plain vim; the practical gain is a real LSP stack in
|
||||
place of the old (inert) ALE.
|
||||
|
||||
| Feature | Notes |
|
||||
| -------------- | ----------------------------------------------------------------------------------------- |
|
||||
| Colorscheme | Catppuccin Mocha (matches the terminal and the rest of the desktop) |
|
||||
| File tree | nvim-tree, toggled with `,,` (comma twice; was nerdtree) |
|
||||
| Fuzzy finder | telescope (+fzf-native): `<leader>ff` files, `<leader>fg` grep, `<leader>fb` buffers |
|
||||
| Format on save | conform-nvim (nixfmt, stylua, ruff, shfmt, prettier, gofumpt; LSP fallback otherwise) |
|
||||
| Git | fugitive (`:Git …`) + gitsigns gutter signs/blame |
|
||||
| Diagnostics | inline + trouble list (`<leader>xx`) |
|
||||
| Completion | nvim-cmp (LSP/buffer/path) with luasnip snippet expansion |
|
||||
| Indent guides | indent-blankline, on by default (was vim-indent-guides) |
|
||||
| Statusline | lualine (Catppuccin theme) |
|
||||
| Editing | which-key hints, comment (`gc`/`gcc`), autopairs, treesitter textobjects |
|
||||
| Pane nav | vim-tmux-navigator — `Ctrl`+`h/j/k/l` moves across vim splits and tmux panes |
|
||||
| Syntax | tree-sitter (nix, lua, bash, markdown, groovy, c#, python, terraform, yaml) |
|
||||
| LSP | nvim-cmp completion + servers `nil_ls` (Nix), `lua_ls`, `pyright` (Python), `terraformls` |
|
||||
| Indentation | 2-wide hard tabs (`noexpandtab`, `tabstop`/`shiftwidth` = 2); line numbers on |
|
||||
| Filetypes | `*Jenkinsfile` → groovy |
|
||||
|
||||
Leader is `Space`. LSP keymaps (`gd`, `gr`, `K`, `<leader>rn`, `<leader>ca`) and
|
||||
the file-tree toggle are listed in
|
||||
[`keybindings.md`](./keybindings.md#neovim). Add a universal language server by
|
||||
enabling it under `programs.nixvim.plugins.lsp.servers` in `editor.nix`;
|
||||
host-specific ones go in that host's module — the work box (`work.nix`) adds
|
||||
`omnisharp` (C#) and `helm_ls` (Helm), kept off the personal machines.
|
||||
|
||||
## git
|
||||
|
||||
Pager is **delta**. **commitizen** is installed on every host; `cz` defaults to
|
||||
Conventional Commits. **lazygit** (themed) is the TUI. The commit-graph is kept
|
||||
current (`gc`/`fetch.writeCommitGraph`) so `lg` stays fast.
|
||||
|
||||
| Aliases | |
|
||||
| ------------------------ | ------------------------------------------------------------------------- |
|
||||
| `st` `co` `sw` `br` `ci` | status / checkout / switch / branch / commit |
|
||||
| `last` `unstage` | last commit / unstage |
|
||||
| `amend` `fixup` `undo` | amend-no-edit / `commit --fixup` / soft-reset HEAD~1 (keep staged) |
|
||||
| `lg` | graph log, all branches |
|
||||
| `cz` `cc` | `git cz <sub>` (e.g. `git cz c`) and `git cc` → commitizen prompt |
|
||||
| `dft` | structural (syntax-aware) diff via difftastic; takes `git diff` arguments |
|
||||
|
||||
**`git dft` vs `git diff`.** delta stays the default renderer for everything;
|
||||
`diff.external` is deliberately **not** set, so `git diff`, `git show` and
|
||||
anything parsing their output are unchanged. Reach for `dft` when a refactor
|
||||
moved code around and a line-based diff is noise. One wrinkle: `dft` is a
|
||||
`!`-shell alias, and git runs those from the repository root — pass pathspecs
|
||||
relative to the root, not to your current directory.
|
||||
|
||||
| Behaviour | |
|
||||
| -------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| Pulls | rebase, with autostash + autosquash |
|
||||
| Fetch | prune deleted remote branches |
|
||||
| Conflicts | `zdiff3` (shows the common ancestor) |
|
||||
| Diffs | histogram algorithm, colour-moved |
|
||||
| `rerere` | remembers + replays conflict resolutions |
|
||||
| Commit editor | full diff shown (`commit.verbose`) |
|
||||
| Misc | branches sorted by date, `column.ui = auto`, `help.autocorrect = prompt`, `push.autoSetupRemote` |
|
||||
| Global ignores | `result`, `result-*`, `.direnv`, `*.swp`, `.DS_Store` |
|
||||
| Signing | SSH commit + tag signing (`mkDefault`, so a host without the key in its agent can disable it). Name, email and signing key all come from the per-user `identity` (the user registry, `../users/registry.nix`). |
|
||||
|
||||
## ssh
|
||||
|
||||
| Feature | Notes |
|
||||
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| ssh-agent | runs on Linux (launchd on macOS); keys added on **first use** so the passphrase is typed once per login session — this also feeds git commit signing |
|
||||
| macOS | `UseKeychain` caches the passphrase in the login keychain (guarded by `IgnoreUnknown`, so a non-Apple `ssh` skips it instead of erroring) |
|
||||
| Gitea remote | `code.emmathe.dev` → `HostName 10.187.1.76` (DNS-override), `Port 30009`, user `git`, dedicated key, `identitiesOnly` |
|
||||
| Defaults | the module's deprecated default block is opted out; equivalents kept under `settings."*"` |
|
||||
|
||||
The **work box keeps its own `~/.ssh/config`** (home-manager's `programs.ssh` is
|
||||
forced off there) but still runs the agent.
|
||||
|
||||
## Claude Code
|
||||
|
||||
Managed declaratively by [`claude.nix`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/claude.nix) on every host whose CPU
|
||||
can run it (the CLI is `pkgs.claude-code`, tracked to unstable via the flake
|
||||
overlay).
|
||||
|
||||
**Capability gate.** The module installs nothing — CLI or files — when
|
||||
`osConfig.features.claudeCode.enable` is off. That flag is derived fleet-wide
|
||||
from the host's declared CPU level (see "CPU capability gating" in the root
|
||||
README): the Node runtime needs SSE4.2/POPCNT, so anything below x86-64-v2 (the
|
||||
Mac Pro 3,1) is excluded. Hosts that do not define the option — the Darwin host
|
||||
and the standalone `homeConfigurations` — keep it enabled.
|
||||
|
||||
| Managed (static, from Nix) | Left mutable (runtime state) |
|
||||
| --------------------------------------------------- | ------------------------------------------------------ |
|
||||
| `~/.claude/CLAUDE.md` (persona + memory workflow) | `settings.json` (permissions, model, theme, `/config`) |
|
||||
| `~/.claude/output-styles/soviet-engineer.md` | `.credentials.json`, history, caches |
|
||||
| `~/.claude/memory/` (read-only symlink to the repo) | |
|
||||
|
||||
`settings.json` is intentionally **not** managed: Claude rewrites it at runtime
|
||||
(interactive permission grants, `/config`), which a read-only store symlink would
|
||||
break.
|
||||
|
||||
**Memory is sourced from this repo.** The files in
|
||||
[`claude/memory/`](https://code.emmathe.dev/lyrathorpe/nixfiles/src/branch/main/home/claude/memory) are the source of truth; they are symlinked
|
||||
read-only into `~/.claude/memory`, so recall works but the runtime "save a
|
||||
memory" path does not. To add/change/remove a memory, edit `claude/memory/`
|
||||
(one file per memory + the `MEMORY.md` index) and rebuild — `CLAUDE.md` tells
|
||||
Claude to route new memories there.
|
||||
|
||||
## Maintenance behaviours
|
||||
|
||||
- **zcompdump reset** — `~/.config/zsh/.zcompdump*` (plus legacy `~/.zcompdump*`
|
||||
and the cache copy) is removed on every activation, so a stale
|
||||
dump (pointing at `/nix/store` paths a rebuild or a manual GC removed) can't
|
||||
break completion with `_git: function definition file not found`.
|
||||
- **GC** — no scheduled timer; collect garbage deliberately (`nh clean all` /
|
||||
`nix-collect-garbage -d`) when no important session is running.
|
||||
|
||||
## Per-host differences
|
||||
|
||||
| | Personal Linux (sway) | macOS | Work WSL (EDaaS) |
|
||||
| --------------------------- | --------------------- | --------------------- | ---------------------------- |
|
||||
| Auto-tmux | yes (foot/TTY) | yes (iTerm2) | yes (WSL shell) |
|
||||
| `kubectl` → kubecolor | no (no kubectl) | no | yes (work module) |
|
||||
| `sudo` implementation | sudo-rs (password) | Apple sudo + Touch ID | sudo-rs (passwordless wheel) |
|
||||
| git email | `iam@emmathe.dev` | `iam@emmathe.dev` | `…@citrix.com` (work) |
|
||||
| ssh config managed | yes | yes | no (keeps corporate config) |
|
||||
| ssh-agent | yes | launchd | yes (work module) |
|
||||
| GUI / theming (desktop.nix) | yes | no | no |
|
||||
Generated
+196
-39
@@ -3,16 +3,16 @@
|
||||
"brew-src": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1779646357,
|
||||
"narHash": "sha256-rnnAaESXxItX4D9xCMGvs3hfDBjbbTYht7OluRcvT8k=",
|
||||
"lastModified": 1786945682,
|
||||
"narHash": "sha256-VBESSoJccikdhxh3vp3SQeG7cZXTOulMvVkoSqNDEhs=",
|
||||
"owner": "Homebrew",
|
||||
"repo": "brew",
|
||||
"rev": "10a163ac127624caa80cc5cc5a705e97f3615b0e",
|
||||
"rev": "5b90e281d4e0c8fbd6ca4d8358276fb305b8d0bd",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "Homebrew",
|
||||
"ref": "5.1.14",
|
||||
"ref": "6.0.18",
|
||||
"repo": "brew",
|
||||
"type": "github"
|
||||
}
|
||||
@@ -25,11 +25,11 @@
|
||||
},
|
||||
"locked": {
|
||||
"dir": "pkgs/firefox-addons",
|
||||
"lastModified": 1780977789,
|
||||
"narHash": "sha256-UFJfQlvInbsVaTK5XC2lafdqWlwiNP5LuQFYfDKq6Dc=",
|
||||
"lastModified": 1787457768,
|
||||
"narHash": "sha256-cbgeu5NTb6DtB+tNs4E6z6K/1XKKM90gVmlkWMJe+gY=",
|
||||
"owner": "rycee",
|
||||
"repo": "nur-expressions",
|
||||
"rev": "0b627f105ea3baa2fa10308a6a67a8f8cbbb3e2a",
|
||||
"rev": "25cfc8fdc413d73b3a47e3e86dafcad51cf5c9f9",
|
||||
"type": "gitlab"
|
||||
},
|
||||
"original": {
|
||||
@@ -40,6 +40,22 @@
|
||||
}
|
||||
},
|
||||
"flake-compat": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1767039857,
|
||||
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "flake-compat",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"locked": {
|
||||
"lastModified": 1761640442,
|
||||
"narHash": "sha256-AtrEP6Jmdvrqiv4x2xa5mrtaIp3OEe8uBYCDZDS+hu8=",
|
||||
@@ -54,7 +70,7 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-compat_2": {
|
||||
"flake-compat_3": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1767039857,
|
||||
@@ -77,11 +93,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1778716662,
|
||||
"narHash": "sha256-m1Yf0wZ8j1OHjTc2UwHwyQRSnNeSgLJOd7q5Y45hzi4=",
|
||||
"lastModified": 1785627969,
|
||||
"narHash": "sha256-4dtXQk/NMePegK/nWp5NSeuZKLATItOq61lpEvmXqGw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "f7c1a2d347e4c52d5fb8d10cb4d94b5884e546fb",
|
||||
"rev": "427bf4bd9435fdf21321c8cc628c24efc14c0f7a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -90,6 +106,48 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"flake-parts_2": {
|
||||
"inputs": {
|
||||
"nixpkgs-lib": [
|
||||
"nixvim",
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1785627969,
|
||||
"narHash": "sha256-4dtXQk/NMePegK/nWp5NSeuZKLATItOq61lpEvmXqGw=",
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"rev": "427bf4bd9435fdf21321c8cc628c24efc14c0f7a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "hercules-ci",
|
||||
"repo": "flake-parts",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"git-hooks": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787424939,
|
||||
"narHash": "sha256-O2tBn84NNuHrnqNVxx/XqsXwfYvS1YwBh+7CBnbCYsk=",
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"rev": "809414f0cdadf82cf11b06c2b29ba9b3168b3297",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "cachix",
|
||||
"repo": "git-hooks.nix",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"home-manager": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -97,11 +155,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1780361225,
|
||||
"narHash": "sha256-wnV9ttf4fPWNonBIQmvlrSlNpQYgx5HgWWd007mwIFA=",
|
||||
"lastModified": 1787377438,
|
||||
"narHash": "sha256-Sxu1NLTD/Ern6hFGLlZmtKCSct3YQXZI/lls8RE1XeM=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "e28654b71096e08c019d4861ca26acb646f583d8",
|
||||
"rev": "65258d5c65a250189fde2e35f490d15e064c4c62",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -111,6 +169,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"kube-tmux": {
|
||||
"flake": false,
|
||||
"locked": {
|
||||
"lastModified": 1779714285,
|
||||
"narHash": "sha256-l1wjg2ReWKCI7h/K11vvX2ykYTs/mVD+tfz/mQsjn/E=",
|
||||
"owner": "jonmosco",
|
||||
"repo": "kube-tmux",
|
||||
"rev": "8b7e1d127c16b6dc87ff5743f4d775b245198b69",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "jonmosco",
|
||||
"repo": "kube-tmux",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nix-darwin": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
@@ -118,11 +192,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1780789116,
|
||||
"narHash": "sha256-+/LcDMJGYQVLp3ECZ1jBhj3GcQU+Yt+OTsDsQFz8cMs=",
|
||||
"lastModified": 1783744694,
|
||||
"narHash": "sha256-2cp6N3rrwnGYLTx9l6N+NI+kwrCWxvJUbj5WJhvB29A=",
|
||||
"owner": "nix-darwin",
|
||||
"repo": "nix-darwin",
|
||||
"rev": "731951a251ca96cbd12a8e1bde63737e21947644",
|
||||
"rev": "c3e90c89649b07d1a96e4b9dd6cd0d6e44b91a74",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -137,11 +211,11 @@
|
||||
"brew-src": "brew-src"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1780492467,
|
||||
"narHash": "sha256-zMEJwtQPmsPPgPczFkyjWHgd1z0HagOPS2Wt2WDYLJY=",
|
||||
"lastModified": 1787330919,
|
||||
"narHash": "sha256-LslMncqN7uOOH5S88WZtO/EVt2HwD8ltUnfyANk+mC0=",
|
||||
"owner": "zhaofengli",
|
||||
"repo": "nix-homebrew",
|
||||
"rev": "562332f97de9f5ba51aa647d70462e88222b2988",
|
||||
"rev": "b00218e4aec0e5bf07d61a0bb13f842faa582d7b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -157,11 +231,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1780816331,
|
||||
"narHash": "sha256-0BYqs8yKWkOz2Q7+SP18N5E5gmDKSo6LSxIVIa0wWes=",
|
||||
"lastModified": 1787457452,
|
||||
"narHash": "sha256-FJh4esFS3zqNNuKwvN3t6wrJGewqp1AUF9DAEvoKPD8=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nix-index-database",
|
||||
"rev": "1a2ea89c917781e88508d9fd2b507f2d2a0e173c",
|
||||
"rev": "c51d5c2ba69c907a34e90c9b6b80cd2b93811745",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -172,17 +246,17 @@
|
||||
},
|
||||
"nixos-apple-silicon": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat",
|
||||
"flake-compat": "flake-compat_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1780669925,
|
||||
"narHash": "sha256-inOQx/s7GQjh9bcCjCHXAeX0EHX+sOQUBoo8+bs48ME=",
|
||||
"lastModified": 1786862401,
|
||||
"narHash": "sha256-zRPYCn5RJWxr9uyUwNIQjPsTFcIFRwuRnI91dqvGA0k=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixos-apple-silicon",
|
||||
"rev": "5880026520a3fd248d59e1c81c4e4e111aefc6af",
|
||||
"rev": "53798a0eb0fa4c8cfaeca7bdc5b4ad22ed210c95",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -191,19 +265,39 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-wsl": {
|
||||
"nixos-hardware": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1780765279,
|
||||
"narHash": "sha256-md6QHmlIx40bQkun43M2eT8aav5GURGkXEMFwof6uZs=",
|
||||
"lastModified": 1787144466,
|
||||
"narHash": "sha256-HHfv2/HkNSKbbSyU9iD/g8lbP6r4tl33sSw1W4rXCk0=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"rev": "0471accf8d0a8210b31d947497d179ecc99e0021",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"repo": "nixos-hardware",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixos-wsl": {
|
||||
"inputs": {
|
||||
"flake-compat": "flake-compat_3",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1784642409,
|
||||
"narHash": "sha256-hcbDqFuySAJawljt5r0sKBCJKYnbtGD0T/ZIozH1Dq0=",
|
||||
"owner": "nix-community",
|
||||
"repo": "NixOS-WSL",
|
||||
"rev": "3e6d8af994e2a2d31af7a91863d7c0d6e278d951",
|
||||
"rev": "eaeb18da90024448a60eb1ec7132eafa4003404e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -214,11 +308,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1780734595,
|
||||
"narHash": "sha256-DmTfP92QFYRLOGXlMIE54MAgxSJjDWocl3gRNOu72Os=",
|
||||
"lastModified": 1787414105,
|
||||
"narHash": "sha256-WncT27+3BOkgTaJZLnCsf3LcYf9RXMuR9ONSN4rzQ7s=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "9b696460ac78b5ccfc17c854d8c976f20456e943",
|
||||
"rev": "a9e6d84f9c2f9012f5fe7d964a7851352300e61a",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -230,11 +324,11 @@
|
||||
},
|
||||
"nixpkgs-unstable": {
|
||||
"locked": {
|
||||
"lastModified": 1780243769,
|
||||
"narHash": "sha256-x5UQuRsH3MqI0U9afaXSNqzTPSeZlRLvFAav2Ux1pNw=",
|
||||
"lastModified": 1787360063,
|
||||
"narHash": "sha256-dt4WdcvsA8/RCe+VZZwqU0X+XMM3wBbGCWA0/sFWzGo=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "331800de5053fcebacf6813adb5db9c9dca22a0c",
|
||||
"rev": "2c423e03bbafcff28bfadc6781a4a8257f205cb5",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -244,18 +338,81 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixvim": {
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts_2",
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
],
|
||||
"systems": "systems"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1787536726,
|
||||
"narHash": "sha256-aBh5Yk9tX8ZV4k10BJr2fvTq0/+iWGegaCMUOU7YKas=",
|
||||
"owner": "nix-community",
|
||||
"repo": "nixvim",
|
||||
"rev": "e2c3f9f36326d07340626847543c557e2b95fb50",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-community",
|
||||
"ref": "nixos-26.05",
|
||||
"repo": "nixvim",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"firefox-addons": "firefox-addons",
|
||||
"flake-parts": "flake-parts",
|
||||
"git-hooks": "git-hooks",
|
||||
"home-manager": "home-manager",
|
||||
"kube-tmux": "kube-tmux",
|
||||
"nix-darwin": "nix-darwin",
|
||||
"nix-homebrew": "nix-homebrew",
|
||||
"nix-index-database": "nix-index-database",
|
||||
"nixos-apple-silicon": "nixos-apple-silicon",
|
||||
"nixos-hardware": "nixos-hardware",
|
||||
"nixos-wsl": "nixos-wsl",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-unstable": "nixpkgs-unstable"
|
||||
"nixpkgs-unstable": "nixpkgs-unstable",
|
||||
"nixvim": "nixvim",
|
||||
"treefmt-nix": "treefmt-nix"
|
||||
}
|
||||
},
|
||||
"systems": {
|
||||
"locked": {
|
||||
"lastModified": 1681028828,
|
||||
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nix-systems",
|
||||
"repo": "default",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"treefmt-nix": {
|
||||
"inputs": {
|
||||
"nixpkgs": [
|
||||
"nixpkgs"
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1786901030,
|
||||
"narHash": "sha256-WSFCsDSE5ffgD2MqzkM2CYjeFiKhRF/dJUN8uedb6YE=",
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"rev": "27b3b12a8e6375f28ebe122f07d230ca5459bbfa",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "numtide",
|
||||
"repo": "treefmt-nix",
|
||||
"type": "github"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
# Provides mkFlake: the systems/perSystem scaffolding used below.
|
||||
flake-parts.url = "github:hercules-ci/flake-parts";
|
||||
flake-parts.inputs.nixpkgs-lib.follows = "nixpkgs";
|
||||
# Declarative Firefox add-ons (e.g. the Catppuccin theme); see lyrathorpe/user.nix.
|
||||
# Declarative Firefox add-ons (e.g. the Catppuccin theme); see modules/users.nix.
|
||||
firefox-addons = {
|
||||
url = "gitlab:rycee/nur-expressions?dir=pkgs/firefox-addons";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
@@ -34,6 +34,39 @@
|
||||
url = "github:nix-community/nix-index-database";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# treefmt-nix: one multi-language formatter driving `nix fmt` and the
|
||||
# formatting flake check (nixfmt + shfmt + prettier).
|
||||
treefmt-nix = {
|
||||
url = "github:numtide/treefmt-nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# git-hooks.nix: declarative pre-commit hooks (nixfmt/deadnix/statix),
|
||||
# installed into the repo via the devShell.
|
||||
git-hooks = {
|
||||
url = "github:cachix/git-hooks.nix";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# Declarative Neovim (the editor; see home/editor.nix). Release
|
||||
# branch matched to the pinned nixpkgs (26.05); follows our nixpkgs to keep a
|
||||
# single nixpkgs in the closure. editor.nix sets programs.nixvim.nixpkgs.source
|
||||
# to this same input so the home module doesn't warn about the pin.
|
||||
nixvim = {
|
||||
url = "github:nix-community/nixvim/nixos-26.05";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# Curated per-hardware profiles (microcode, SSD, platform quirks) for the
|
||||
# physical x86 hosts.
|
||||
nixos-hardware = {
|
||||
url = "github:NixOS/nixos-hardware";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
# kube-tmux: kube context/namespace for the tmux status line on the work
|
||||
# host. Not in nixpkgs and not a flake -- pinned here as a plain source so
|
||||
# the script is always in the store (no manual checkout). See work.nix.
|
||||
kube-tmux = {
|
||||
url = "github:jonmosco/kube-tmux";
|
||||
flake = false;
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
@@ -51,24 +84,60 @@
|
||||
flake-parts.lib.mkFlake { inherit inputs; } (
|
||||
{ lib, ... }:
|
||||
let
|
||||
# claude-code tracks nixpkgs-unstable regardless of the pinned nixpkgs.
|
||||
# These track nixpkgs-unstable regardless of the pinned nixpkgs.
|
||||
# gcx: 26.05 ships 0.2.14, which predates the stacks/contexts config
|
||||
# model and the agento11y commands the tooling expects.
|
||||
overlays = [
|
||||
(final: prev: {
|
||||
claude-code =
|
||||
(_final: prev: {
|
||||
inherit
|
||||
(import nixpkgs-unstable {
|
||||
inherit (prev.stdenv.hostPlatform) system;
|
||||
config.allowUnfree = true;
|
||||
}).claude-code;
|
||||
})
|
||||
claude-code
|
||||
gcx
|
||||
;
|
||||
})
|
||||
# commitizen 4.13.9's regression test for the invalid-command error
|
||||
# message asserts argparse's older, unquoted "invalid choice" wording;
|
||||
# the argparse in Python 3.13 quotes each choice, so the fixture no
|
||||
# longer matches and the checkPhase fails. The package itself is fine
|
||||
# -- deselect just that test. Drop once nixpkgs updates the fixture.
|
||||
(_final: prev: {
|
||||
commitizen = prev.commitizen.overridePythonAttrs (old: {
|
||||
disabledTests = (old.disabledTests or [ ]) ++ [ "test_invalid_command" ];
|
||||
});
|
||||
})
|
||||
];
|
||||
|
||||
# Unfree packages permitted to be built (replaces blanket allowUnfree).
|
||||
# The NVIDIA entries are for the Mac Pro's Quadro P400 (hosts/MacPro31/
|
||||
# nvidia.nix) and the Console host's GTX 1070 (hosts/Console/nvidia.nix);
|
||||
# unfree packages are not in the binary cache, so the kernel module is
|
||||
# compiled on the host. The steam/clonehero entries are the Console
|
||||
# host's games stack (hosts/Console/gaming.nix).
|
||||
unfreePackages = [
|
||||
"claude-code"
|
||||
"lens"
|
||||
"lens-desktop"
|
||||
"nvidia-x11"
|
||||
"nvidia-kernel-modules"
|
||||
"nvidia-settings"
|
||||
"steam"
|
||||
"steam-unwrapped"
|
||||
"steam-run"
|
||||
"clonehero"
|
||||
# RetroArch cores whose upstream licences carry a non-commercial or
|
||||
# no-redistribution-for-profit clause. Everything else in the core set
|
||||
# is plain free software.
|
||||
"libretro-snes9x"
|
||||
"libretro-genesis-plus-gx"
|
||||
"libretro-picodrive"
|
||||
"libretro-fbneo"
|
||||
"libretro-mame2003-plus"
|
||||
];
|
||||
|
||||
# Per-user identity, keyed by username. See README "Users".
|
||||
userRegistry = import ./users/registry.nix;
|
||||
|
||||
# nixpkgs + nix-daemon settings shared by NixOS and Darwin hosts.
|
||||
commonModule = {
|
||||
nixpkgs.overlays = overlays;
|
||||
@@ -84,8 +153,9 @@
|
||||
|
||||
# Shared scaffolding for every NixOS host: common user, settings, home-manager.
|
||||
baseModules = [
|
||||
./lyrathorpe/user.nix
|
||||
./system/modules/common-nixos.nix
|
||||
./modules/users.nix
|
||||
./modules/common-nixos.nix
|
||||
./modules/features.nix
|
||||
commonModule
|
||||
home-manager.nixosModules.home-manager
|
||||
{
|
||||
@@ -97,18 +167,13 @@
|
||||
}
|
||||
];
|
||||
|
||||
# mkHost :: { system, username, fullName, modules, homeModules } -> nixosSystem
|
||||
# Builds one machine by appending its host-specific modules to the shared
|
||||
# baseModules. The user identity (username/fullName) is threaded through
|
||||
# specialArgs so user.nix and the home modules stay host-agnostic, and the
|
||||
# home-manager profile is keyed by the host's username.
|
||||
# Build one NixOS host. `users` is an attrset keyed by username (home
|
||||
# modules + optional per-user system bits). See README "Users".
|
||||
mkHost =
|
||||
{
|
||||
system,
|
||||
username,
|
||||
fullName,
|
||||
modules,
|
||||
homeModules,
|
||||
users,
|
||||
# Host form factor. Laptops inherit the default; a desktop host sets
|
||||
# `portable = false` to drop mobile components (battery block,
|
||||
# brightness keys) from the home-manager Sway config.
|
||||
@@ -119,8 +184,7 @@
|
||||
specialArgs = {
|
||||
inherit
|
||||
inputs
|
||||
username
|
||||
fullName
|
||||
userRegistry
|
||||
portable
|
||||
;
|
||||
};
|
||||
@@ -128,16 +192,15 @@
|
||||
baseModules
|
||||
++ modules
|
||||
++ [
|
||||
{ _module.args.hostUsers = users; }
|
||||
{
|
||||
home-manager.extraSpecialArgs = {
|
||||
inherit
|
||||
inputs
|
||||
username
|
||||
fullName
|
||||
portable
|
||||
;
|
||||
};
|
||||
home-manager.users.${username}.imports = homeModules;
|
||||
home-manager.extraSpecialArgs = { inherit inputs portable; };
|
||||
home-manager.users = lib.mapAttrs (name: spec: {
|
||||
imports = spec.homeModules;
|
||||
_module.args.identity = userRegistry.${name} // {
|
||||
username = name;
|
||||
};
|
||||
}) users;
|
||||
}
|
||||
];
|
||||
};
|
||||
@@ -156,19 +219,17 @@
|
||||
}
|
||||
];
|
||||
|
||||
# mkDarwinHost :: { system, username, fullName, modules, homeModules } -> darwinSystem
|
||||
# Darwin counterpart of mkHost. macOS already owns the login user, so we
|
||||
# only attach the platform and home-manager; no NixOS user module here.
|
||||
# Darwin counterpart of mkHost: single-user (macOS owns the account),
|
||||
# identity still from the registry. See README "Users".
|
||||
mkDarwinHost =
|
||||
{
|
||||
system,
|
||||
username,
|
||||
fullName,
|
||||
modules,
|
||||
homeModules,
|
||||
}:
|
||||
nix-darwin.lib.darwinSystem {
|
||||
specialArgs = { inherit inputs username fullName; };
|
||||
specialArgs = { inherit inputs username; };
|
||||
modules =
|
||||
darwinBaseModules
|
||||
++ modules
|
||||
@@ -177,97 +238,158 @@
|
||||
nixpkgs.hostPlatform = system;
|
||||
# macOS owns the account; point home-manager at its home dir.
|
||||
users.users.${username}.home = "/Users/${username}";
|
||||
home-manager.extraSpecialArgs = { inherit inputs username fullName; };
|
||||
home-manager.users.${username}.imports = homeModules;
|
||||
home-manager.extraSpecialArgs = { inherit inputs; };
|
||||
home-manager.users.${username} = {
|
||||
imports = homeModules;
|
||||
_module.args.identity = userRegistry.${username} // {
|
||||
inherit username;
|
||||
};
|
||||
};
|
||||
}
|
||||
];
|
||||
};
|
||||
|
||||
# Host table — declarative registry of every machine. To add a host:
|
||||
# give it a name, its `system`, the owning user, and the module lists.
|
||||
# mapAttrs below turns each entry into a nixosConfiguration of the same name.
|
||||
# Host table — one entry per machine, realised into a nixosConfiguration
|
||||
# of the same name below. See README "Hosts" / "Users".
|
||||
hosts = {
|
||||
lyrathorpe-mbp = {
|
||||
system = "aarch64-linux";
|
||||
username = "lyrathorpe";
|
||||
fullName = "Lyra Thorpe";
|
||||
modules = [
|
||||
./system/machine/MBP-Asahi/configuration.nix
|
||||
./system/modules/laptop.nix
|
||||
./hosts/MBP-Asahi/configuration.nix
|
||||
./modules/laptop.nix
|
||||
nixos-apple-silicon.nixosModules.default
|
||||
./lyrathorpe/swaywm.nix
|
||||
./modules/sway.nix
|
||||
];
|
||||
homeModules = [
|
||||
./lyrathorpe/home
|
||||
./lyrathorpe/home/desktop.nix
|
||||
users.lyrathorpe.homeModules = [
|
||||
./home
|
||||
./users/lyrathorpe/home.nix
|
||||
./home/desktop.nix
|
||||
];
|
||||
};
|
||||
|
||||
lyrathorpe-t400 = {
|
||||
system = "x86_64-linux";
|
||||
username = "lyrathorpe";
|
||||
fullName = "Lyra Thorpe";
|
||||
modules = [
|
||||
./system/machine/T400/configuration.nix
|
||||
./system/modules/laptop.nix
|
||||
./lyrathorpe/swaywm.nix
|
||||
./hosts/T400/configuration.nix
|
||||
./modules/laptop.nix
|
||||
./modules/ssh.nix
|
||||
# No t400-specific profile exists; compose the generic ThinkPad +
|
||||
# laptop/SSD/Intel building blocks (tp_smapi/acpi_call for battery
|
||||
# thresholds, SSD + microcode defaults).
|
||||
inputs.nixos-hardware.nixosModules.lenovo-thinkpad
|
||||
inputs.nixos-hardware.nixosModules.common-pc-laptop
|
||||
inputs.nixos-hardware.nixosModules.common-pc-laptop-ssd
|
||||
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
||||
./modules/sway.nix
|
||||
];
|
||||
homeModules = [
|
||||
./lyrathorpe/home
|
||||
./lyrathorpe/home/desktop.nix
|
||||
users.lyrathorpe.homeModules = [
|
||||
./home
|
||||
./users/lyrathorpe/home.nix
|
||||
./home/desktop.nix
|
||||
];
|
||||
};
|
||||
|
||||
lyrathorpe-macpro31 = {
|
||||
system = "x86_64-linux";
|
||||
username = "lyrathorpe";
|
||||
fullName = "Lyra Thorpe";
|
||||
portable = false;
|
||||
modules = [
|
||||
./system/machine/MacPro31/configuration.nix
|
||||
./system/modules/desktop.nix
|
||||
./lyrathorpe/swaywm.nix
|
||||
./hosts/MacPro31/configuration.nix
|
||||
./modules/desktop.nix
|
||||
./modules/ssh.nix
|
||||
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
||||
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
||||
./modules/sway.nix
|
||||
];
|
||||
homeModules = [
|
||||
./lyrathorpe/home
|
||||
./lyrathorpe/home/desktop.nix
|
||||
users.lyrathorpe.homeModules = [
|
||||
./home
|
||||
./users/lyrathorpe/home.nix
|
||||
./home/desktop.nix
|
||||
];
|
||||
};
|
||||
|
||||
lyrathorpe-console = {
|
||||
system = "x86_64-linux";
|
||||
portable = false;
|
||||
# Living-room games machine on a television: autologins into the
|
||||
# gamescope Steam session (hosts/Console/gaming.nix). sway.nix is
|
||||
# still imported -- greetd/ReGreet is what the Steam session falls
|
||||
# back to, and Sway is the keyboard-and-mouse session behind it.
|
||||
modules = [
|
||||
./hosts/Console/configuration.nix
|
||||
./modules/desktop.nix
|
||||
./modules/ssh.nix
|
||||
inputs.nixos-hardware.nixosModules.common-pc-ssd
|
||||
inputs.nixos-hardware.nixosModules.common-cpu-intel
|
||||
./modules/sway.nix
|
||||
];
|
||||
users.lyrathorpe.homeModules = [
|
||||
./home
|
||||
./users/lyrathorpe/home.nix
|
||||
./home/desktop.nix
|
||||
];
|
||||
};
|
||||
|
||||
emmathorpe-edaas = {
|
||||
system = "x86_64-linux";
|
||||
username = "emmathorpe";
|
||||
fullName = "Emma Thorpe";
|
||||
modules = [
|
||||
./system/machine/EDaaS/configuration.nix
|
||||
./hosts/EDaaS/configuration.nix
|
||||
nixos-wsl.nixosModules.default
|
||||
./lyrathorpe/swaywm.nix
|
||||
./modules/sway.nix
|
||||
];
|
||||
homeModules = [
|
||||
./lyrathorpe/home
|
||||
./system/modules/work/default.nix
|
||||
users.emmathorpe = {
|
||||
homeModules = [
|
||||
./home
|
||||
./users/emmathorpe/work.nix
|
||||
];
|
||||
# Keep the systemd --user instance alive without a login session so
|
||||
# the renovate-review home timer fires on schedule.
|
||||
linger = true;
|
||||
};
|
||||
};
|
||||
|
||||
lyrathorpe-rpi5 = {
|
||||
system = "aarch64-linux";
|
||||
portable = false;
|
||||
# Headless server: Docker host + nginx reverse proxy. No sway.nix
|
||||
# (no desktop); the raspberry-pi-5 profile supplies kernel/firmware,
|
||||
# ssh.nix adds key-only sshd.
|
||||
modules = [
|
||||
./hosts/RPi5/configuration.nix
|
||||
inputs.nixos-hardware.nixosModules.raspberry-pi-5
|
||||
./modules/ssh.nix
|
||||
];
|
||||
users.lyrathorpe.homeModules = [
|
||||
./home
|
||||
./users/lyrathorpe/home.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Darwin host table — macOS machines built via mkDarwinHost. The shared
|
||||
# ./lyrathorpe/home modules (shell, git, editor) are reused; the Linux-only
|
||||
# ./home bundle (shell, git, editor) is reused directly; the Linux-only
|
||||
# desktop/sway modules are intentionally left out.
|
||||
darwinHosts = {
|
||||
lyrathorpe-mac = {
|
||||
system = "aarch64-darwin";
|
||||
username = "lyrathorpe";
|
||||
fullName = "Lyra Thorpe";
|
||||
modules = [
|
||||
./system/machine/Darwin/configuration.nix
|
||||
./hosts/Darwin/configuration.nix
|
||||
];
|
||||
homeModules = [
|
||||
./lyrathorpe/home
|
||||
./home
|
||||
./users/lyrathorpe/home.nix
|
||||
];
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
# flake-parts modules: treefmt-nix wires `nix fmt` + a formatting check;
|
||||
# git-hooks.nix wires the pre-commit check + devShell installation script.
|
||||
imports = [
|
||||
inputs.treefmt-nix.flakeModule
|
||||
inputs.git-hooks.flakeModule
|
||||
];
|
||||
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
@@ -279,31 +401,127 @@
|
||||
# nixpkgs instance for that system. Outputs here become per-system
|
||||
# attrsets automatically (e.g. devShells.<system>.default).
|
||||
perSystem =
|
||||
{ pkgs, ... }:
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
# `nix fmt` formatter for the repo.
|
||||
formatter = pkgs.nixfmt;
|
||||
# treefmt drives `nix fmt` and the formatting check below. nixfmt
|
||||
# stays the .nix formatter (the tree is already nixfmt-formatted);
|
||||
# shfmt covers shell and prettier covers markdown/yaml/json.
|
||||
treefmt = {
|
||||
projectRootFile = "flake.nix";
|
||||
programs.nixfmt.enable = true;
|
||||
programs.shfmt.enable = true;
|
||||
programs.prettier.enable = true;
|
||||
# Generated hardware-configuration.nix files are not hand-edited.
|
||||
settings.global.excludes = [
|
||||
"*/hardware-configuration.nix" # generated by nixos-generate-config
|
||||
"flake.lock" # generated by `nix flake lock`
|
||||
];
|
||||
};
|
||||
|
||||
# Pre-commit hooks: format + lint gate run on commit. The same hooks
|
||||
# are exposed as a flake check (pre-commit.check.enable defaults true).
|
||||
pre-commit.settings = {
|
||||
# Generated by nixos-generate-config; don't lint/reformat (treefmt
|
||||
# excludes them too).
|
||||
excludes = [ "hardware-configuration\\.nix$" ];
|
||||
hooks = {
|
||||
nixfmt-rfc-style.enable = true;
|
||||
deadnix = {
|
||||
enable = true;
|
||||
# Unused module args ({config,lib,pkgs,...}) are normal; only
|
||||
# flag genuinely dead bindings.
|
||||
settings.noLambdaPatternNames = true;
|
||||
};
|
||||
statix.enable = true; # reads statix.toml (repeated_keys/empty_pattern disabled)
|
||||
};
|
||||
};
|
||||
|
||||
# treefmt-nix exposes its own `checks.treefmt`; alias it to
|
||||
# `formatting` so the existing CI gate (.#checks.*.formatting) keeps
|
||||
# working without churn.
|
||||
checks.formatting = config.treefmt.build.check inputs.self;
|
||||
|
||||
# deadnix / statix lints as standalone flake checks so `nix flake
|
||||
# check` flags dead code and antipatterns independently of pre-commit.
|
||||
checks.deadnix = pkgs.runCommandLocal "check-deadnix" { nativeBuildInputs = [ pkgs.deadnix ]; } ''
|
||||
deadnix --fail --no-lambda-pattern-names ${./.} && touch $out
|
||||
'';
|
||||
checks.statix = pkgs.runCommandLocal "check-statix" { nativeBuildInputs = [ pkgs.statix ]; } ''
|
||||
statix check -c ${./.} ${./.} && touch $out
|
||||
'';
|
||||
|
||||
# `nix develop` shell with the tooling needed to hack on this flake.
|
||||
# shellHook installs the git pre-commit hooks into the working tree.
|
||||
devShells.default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
nixfmt
|
||||
nil
|
||||
git
|
||||
deadnix
|
||||
statix
|
||||
treefmt
|
||||
];
|
||||
shellHook = config.pre-commit.installationScript;
|
||||
};
|
||||
|
||||
checks.formatting =
|
||||
pkgs.runCommandLocal "check-formatting" { nativeBuildInputs = [ pkgs.nixfmt ]; }
|
||||
''
|
||||
# Generated hardware-configuration.nix files are excluded.
|
||||
nixfmt --check $(find ${./.} -name '*.nix' -not -name 'hardware-configuration.nix') && touch $out
|
||||
'';
|
||||
};
|
||||
|
||||
# Realise the host tables: each entry becomes a {nixos,darwin}Configuration.
|
||||
flake.nixosConfigurations = lib.mapAttrs (_name: mkHost) hosts;
|
||||
flake.darwinConfigurations = lib.mapAttrs (_name: mkDarwinHost) darwinHosts;
|
||||
|
||||
# Reusable home modules, exported for use off these hosts. See README
|
||||
# "Portable home" for the consumer module-arg expectations.
|
||||
flake.homeModules = {
|
||||
default = ./home;
|
||||
shell = ./home/shell.nix;
|
||||
git = ./home/git.nix;
|
||||
editor = ./home/editor.nix;
|
||||
claude = ./home/claude.nix;
|
||||
secret-service = ./home/secret-service.nix;
|
||||
desktop = ./home/desktop.nix;
|
||||
sway = ./home/sway.nix;
|
||||
};
|
||||
|
||||
# Standalone home-manager configs (portable bundle) for machines not
|
||||
# managed by this flake. See README "Portable home".
|
||||
flake.homeConfigurations =
|
||||
let
|
||||
mkHome =
|
||||
{
|
||||
system,
|
||||
name,
|
||||
}:
|
||||
home-manager.lib.homeManagerConfiguration {
|
||||
pkgs = import nixpkgs {
|
||||
inherit system overlays;
|
||||
config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) unfreePackages;
|
||||
};
|
||||
extraSpecialArgs = {
|
||||
inherit inputs;
|
||||
portable = true;
|
||||
identity = userRegistry.${name} // {
|
||||
username = name;
|
||||
};
|
||||
};
|
||||
modules = [
|
||||
./home
|
||||
{
|
||||
home.username = name;
|
||||
home.homeDirectory = "/home/${name}";
|
||||
}
|
||||
];
|
||||
};
|
||||
in
|
||||
{
|
||||
"lyrathorpe@x86_64-linux" = mkHome {
|
||||
system = "x86_64-linux";
|
||||
name = "lyrathorpe";
|
||||
};
|
||||
"lyrathorpe@aarch64-linux" = mkHome {
|
||||
system = "aarch64-linux";
|
||||
name = "lyrathorpe";
|
||||
};
|
||||
};
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
# Claude Code, configured declaratively via home-manager. Wanted on every host
|
||||
# whose CPU can run it -- see the gate below.
|
||||
#
|
||||
# The STATIC config is managed here: the global CLAUDE.md (persona/context), the
|
||||
# custom output style, and the auto-memory directory. settings.json is
|
||||
# deliberately left UNMANAGED -- Claude Code rewrites it at runtime (interactive
|
||||
# permission grants, /config), and a read-only /nix/store symlink would break
|
||||
# those writes.
|
||||
#
|
||||
# Memory is the source of truth in this repo (./claude/memory). It is symlinked
|
||||
# read-only into ~/.claude/memory, so the runtime "save a memory" path no longer
|
||||
# writes there -- recall still works, but new/changed memories must be added to
|
||||
# this repo and rebuilt. CLAUDE.md instructs Claude to do exactly that.
|
||||
{
|
||||
lib,
|
||||
# Set by the NixOS/Darwin home-manager module; absent for the standalone
|
||||
# homeConfigurations, hence the default.
|
||||
osConfig ? { },
|
||||
...
|
||||
}:
|
||||
let
|
||||
# Capability gate, declared once for the whole fleet in modules/features.nix
|
||||
# (default: on; off on CPUs below x86-64-v2, which cannot run the Node
|
||||
# runtime Claude Code ships on). Hosts without that option -- the Darwin host
|
||||
# and the portable standalone profile -- fall back to enabled.
|
||||
enable = osConfig.features.claudeCode.enable or true;
|
||||
in
|
||||
{
|
||||
programs.claude-code = {
|
||||
inherit enable;
|
||||
# package defaults to pkgs.claude-code (tracked to unstable via the flake
|
||||
# overlay).
|
||||
|
||||
# ~/.claude/CLAUDE.md -- global instructions / persona / memory workflow.
|
||||
context = ./claude/CLAUDE.md;
|
||||
};
|
||||
|
||||
# Nothing to place when the CLI is not installed: a ~/.claude/memory symlink
|
||||
# with no Claude Code to read it is just dead state.
|
||||
home.file = lib.mkIf enable {
|
||||
# Custom output style. The module has no option for output-styles/, so place
|
||||
# it directly; selection (settings.json `outputStyle`) stays mutable.
|
||||
".claude/output-styles/soviet-engineer.md".source = ./claude/output-styles/soviet-engineer.md;
|
||||
|
||||
# Auto-memory directory, Nix-managed (read-only). Edit ./claude/memory in
|
||||
# this repo and rebuild to change what Claude remembers.
|
||||
".claude/memory".source = ./claude/memory;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
# Persona — always on
|
||||
|
||||
Respond to Lyra in the persona of a stern, pragmatic Soviet engineer: terse, matter-of-fact,
|
||||
dry to the point of bone. Blueprints (code, commands, steps) over speeches. Address her as
|
||||
"comrade Lyra" when it reads naturally. No emojis. Grudging approval ("Acceptable.", "This will
|
||||
hold.") is the highest praise.
|
||||
|
||||
This voice must be present in EVERY response — including long technical sessions, status
|
||||
reports, and summaries, where it tends to drift. Self-check before sending: engineer, or
|
||||
neutral assistant report? If the latter, rewrite.
|
||||
|
||||
**Scope:** persona lives in PROSE only. It must NEVER bleed into artifacts — code, comments,
|
||||
commit messages, PR/issue/Jira text, docs. Those stay plain and conventional.
|
||||
|
||||
**Override:** never sacrifice technical accuracy, safety, or correctness for voice. If the
|
||||
voice would distort a point, drop it and state facts plainly. Voice is the wrapper; the payload
|
||||
is always correct.
|
||||
|
||||
Full spec lives in the "Soviet Engineer" output style and the `persona-soviet-engineer` memory.
|
||||
|
||||
# Memory — managed via Nix
|
||||
|
||||
The auto-memory directory (`~/.claude/memory`) is **read-only** — it is a Nix symlink to the
|
||||
`nixfiles` flake. The runtime "save a memory" path will NOT work there; do not write to
|
||||
`~/.claude/memory`.
|
||||
|
||||
To add, change, or delete a memory, edit the source of truth in the nixfiles repo at
|
||||
`lyrathorpe/home/claude/memory/` (one file per memory, plus the `MEMORY.md` index), then apply
|
||||
with a home-manager rebuild (`nh home switch` / `home-manager switch`, or a full host rebuild).
|
||||
The change takes effect on the next session after the rebuild. Reading/recall from
|
||||
`~/.claude/memory` works as normal.
|
||||
|
||||
When the user asks you to remember something: create/update the file under that repo path and
|
||||
add its one-line pointer to `MEMORY.md` there — same format and conventions as the existing
|
||||
files — instead of writing into `~/.claude/memory`. Mention that a rebuild is needed for it to
|
||||
take effect.
|
||||
@@ -0,0 +1,19 @@
|
||||
- [User name](user_name.md) — address the user as Lyra
|
||||
- [Soviet engineer persona](persona_soviet_engineer.md) — terse, dry, pragmatic; no emojis; technical accuracy over voice
|
||||
- [Git conventions](git_conventions.md) — never commit to main, always a branch; EVERY commit is `type(<TICKET-ID>): summary` using the live ticket, overrides repo's bare-prefix style; watch for scope decay on follow-up commits; grep to verify before pushing
|
||||
- [Git network ops](git_network_ops.md) — GitHub and Gitea (code.emmathe.dev) both pushable in-sandbox (sandbox off, agent key); raise Gitea PRs via tea CLI
|
||||
- [Git commit signing](git_commit_signing.md) — signs in-sandbox via ssh-agent (allowAllUnixSockets + inlined pubkey); sig=N without allowedSignersFile is cosmetic, still signed
|
||||
- [Git check state first](git_check_state.md) — always check branch/status/divergence before git work; Lyra edits repos between sessions
|
||||
- [Keep docs updated](docs_keep_updated.md) — update docs in the same pass as code/config changes; stale docs are a defect
|
||||
- [SIBO Workabout MX project](sibo_workabout_mx_scanner.md) — RE + barcode-inventory project state; scanner is an OO DYL object (oscanner), blocked on on-device ordinal capture; resume via code/inventory/CONTINUATION.md
|
||||
- [Jira tooling](jira_tooling.md) — comments are Markdown not wiki; transitions may need assignee; link direction; WSP transition IDs
|
||||
- [Jira WSP fields](jira_wsp_fields.md) — WSP field map: issue-type IDs, required Bug fields with allowed values/IDs, Task shortcut, relevant components
|
||||
- [Review and comments workflow](workflow_review_and_comments.md) — show PR body and non-trivial Jira comments before posting; terse IaC code comments; PR body content rules
|
||||
- [Code comment style](code_comment_style.md) — reviewer feedback: no ticket IDs in comments by default, concise, explain non-obvious why; Helm needs `#` not `{{/* */}}` to render
|
||||
- [Copilot review false positives](copilot_review_false_positives.md) — verify Copilot "this breaks X" claims against spec/live config before acting; two recorded Terraform false positives
|
||||
- [Sandbox prompts](feedback_sandbox_prompts.md) — don't prompt for sandbox-disable or routine read-only shell ops; broaden permissions instead
|
||||
- [Dev clusters disposable](dev_clusters_disposable.md) — Lyra's dev clusters are recreatable; mutate/break freely, no confirmation needed
|
||||
- [Nix shell tooling](nix_shell_tooling.md) — any nixpkgs tool runs ad hoc via `nix run`/`nix shell nixpkgs#<pkg>`; a missing command is never a dead end
|
||||
- [WSP local build and test](wsp_local_build_and_test.md) — core-services-cloud on this box: dotnet via nix, artifactory creds from `~/.artifactoryenv` sourced per command, how to tell auth failure from a code failure
|
||||
- [WSP-32957 PIM migration](wsp_32957_pim_migration.md) — AKS RBAC to PIM + AutoPerm decommission; prod is in the Technical Preview subscription, three tenants; resume via `~/code/WSP-32957-CONTINUATION.md`
|
||||
- [Entra group member reads](entra_group_member_reads.md) — `az ad group member list` hides service principal members; use the servicePrincipal cast or transitiveMemberOf, and trust the Terraform plan over it
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: code_comment_style
|
||||
description: "Code/comment style from PR review feedback: no ticket IDs in comments by default, concise, explain the non-obvious why"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: 59e09a3f-1429-4f68-a5fb-9af4390e9b0d
|
||||
---
|
||||
|
||||
Recurring PR-review feedback from human reviewers (Tom Wilkins, Andrew Hyde, Gilberto Pestanarosa) on the `multicluster` and `unified-helm` repos, on how to write comments in code and IaC:
|
||||
|
||||
- **No Jira/WSP ticket IDs in code comments or WAF `msg:` strings by default.** Add a ticket ref only when there is a specific reason to. Never duplicate the id, and never put a ticket URL in a comment. Tracking/rationale belongs in the PR description and the Jira ticket, not in `.tf`, `.tftpl`, or `.yaml`. (Flagged repeatedly — PRs #1735, #1762.)
|
||||
- **Comment the non-obvious "why", not the obvious "what".** Drop comments that restate what the code or file plainly does (e.g. a header on `namespace.yaml` re-announcing that it defines a namespace). If a reviewer can't tell why a comment exists, it shouldn't.
|
||||
- **Keep it short and readable.** No multi-line block where one line does; if a comment isn't clear after a couple of reads, rewrite it plainer. Prefer trimming to the single load-bearing sentence over hedged prose. (PRs #1745, #216.)
|
||||
- **In Helm charts, use `#` YAML comments — not `{{/* */}}` — for anything that must appear in the rendered manifest.** Helm template comments are stripped before render, so port/label explanations meant for the live chart have to be `#`. (PR #216.)
|
||||
|
||||
**Why:** Multiple human reviewers, across multiple PRs, consistently push back on verbose comments and gratuitous ticket references. Terse, purpose-driven comments clear review faster.
|
||||
|
||||
**How to apply:** When writing or editing comments in code/IaC, default to: no ticket id, one line, non-obvious "why" only. This supersedes the "one-liner + WSP ticket reference" phrasing that used to live in [[workflow-review-and-comments]]. Relates to [[docs_keep_updated]].
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: copilot_review_false_positives
|
||||
description: "Verify Copilot PR-review 'this breaks X' claims against spec/live config before acting; two recorded false positives"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: 59e09a3f-1429-4f68-a5fb-9af4390e9b0d
|
||||
---
|
||||
|
||||
The Copilot reviewer on the `multicluster` / `unified-helm` repos raises blocking-sounding "this will fail" claims that are sometimes wrong. Verify against the language spec and the live/`master` config before treating one as real or applying its fix.
|
||||
|
||||
Recorded false positives (both Terraform, both Emma-flagged "for future reference"):
|
||||
|
||||
- **PR #1742** — claimed `var.map.hyphenated-key` dot access is parsed as subtraction and breaks `terraform plan`. False: HCL2 identifiers may contain hyphens (`ID_Start (ID_Continue | "-")*`), and the same pattern is already live on `master` in prod. Bracket indexing was adopted anyway as marginally clearer, not as a fix.
|
||||
- **PR #1745** — claimed the `aks_pools` per-pool `max_surge` lookup was off-by-one and should use `count.index + 1`. False: every config attribute on that resource indexes with `count.index`; only the cosmetic `name`/`az_nodepool` label uses `+1`. Applying `+1` would have introduced a real bug (wrong pool, and out-of-bounds on the last pool).
|
||||
|
||||
**Why:** Blindly applying a plausible-but-wrong Copilot suggestion can introduce a real defect or waste review cycles.
|
||||
|
||||
**How to apply:** For any Copilot claim that code is broken or unsafe, confirm it against the relevant spec and the existing working config first; if it's wrong, say so plainly on the PR and leave the code. Genuine Copilot catches (over-broad WAF `@beginsWith`, missing input validation, doc/behaviour drift) still get fixed. Relates to [[workflow-review-and-comments]] and [[code_comment_style]].
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: dev-clusters-disposable
|
||||
description: "Lyra's dev clusters are disposable — break/mutate freely, no confirmation needed"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: 2b832088-ae38-4adf-b5bc-b5d44a8eac40
|
||||
---
|
||||
|
||||
Dev clusters (e.g. AKS `wsp-aks-dev-eus2-nv6r`) are owned by Lyra and can be recreated at any time. Breaking them is always fine.
|
||||
|
||||
**Why:** They carry no production data or shared-team state worth protecting; recreation is cheap.
|
||||
|
||||
**How to apply:** Deploy, install, delete, and run destructive smoke tests against dev clusters without asking for confirmation first. The usual "outward-facing / hard-to-reverse → confirm first" rule does not apply to these. Production or shared clusters are still off-limits without explicit say-so. Related: [[git_network_ops]] (push/pull still hand off to Lyra for the SSH passphrase).
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: docs_keep_updated
|
||||
description: "Keep documentation in sync with every change as part of the work, not a separate step"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: ca09fbe4-9226-4ad9-874f-04df90840eef
|
||||
---
|
||||
|
||||
When changing config or code, update the affected documentation in the same pass — READMEs, KEYBINDINGS, per-host install notes, module comments. Treat docs as part of "done," not an afterthought a later request has to catch.
|
||||
|
||||
**Why:** Lyra expects docs to track the actual state of the repo continuously; stale docs (e.g. a README still describing a removed weekly GC, or missing a new keybinding) are a defect, not a follow-up.
|
||||
|
||||
**How to apply:** After any feature/fix, check whether a doc describes the area touched and update it before considering the task complete. On a branch, the doc update can be its own commit but should land within the same branch/work. Relates to [[git_conventions]] and [[workflow_review_and_comments]].
|
||||
@@ -0,0 +1,28 @@
|
||||
---
|
||||
name: entra-group-member-reads
|
||||
description: az ad group member list and Graph /members silently omit service principal members — use the servicePrincipal cast or transitiveMemberOf when a group is expected to hold an SPN.
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: reference
|
||||
---
|
||||
|
||||
`az ad group member list --group <id>` and `GET /groups/{id}/members` both return an **empty collection**, with no error, for a group whose only members are service principals — at least when called with Lyra's user account. The read looks authoritative and is not.
|
||||
|
||||
**Reliable reads instead:**
|
||||
|
||||
```sh
|
||||
# members, cast to the type that is being hidden
|
||||
az rest --method get --url "https://graph.microsoft.com/v1.0/groups/<gid>/members/microsoft.graph.servicePrincipal?\$select=id,displayName"
|
||||
|
||||
# count, which does not filter
|
||||
az rest --method get --url "https://graph.microsoft.com/v1.0/groups/<gid>/members/\$count" --headers ConsistencyLevel=eventual
|
||||
|
||||
# from the principal's side
|
||||
az rest --method get --url "https://graph.microsoft.com/v1.0/servicePrincipals/<spid>/transitiveMemberOf?\$select=id,displayName"
|
||||
az rest --method post --url "https://graph.microsoft.com/v1.0/servicePrincipals/<spid>/checkMemberGroups" \
|
||||
--body '{"groupIds":["<gid>"]}' --headers "Content-Type=application/json"
|
||||
```
|
||||
|
||||
**How to apply:** any group that deployment or automation identities belong to — `*-cluster-admins`, `*-keyvault`, anything created by `rg-prereqs` — must be checked with one of the above before concluding it is empty. Cross-check against Terraform: a plan reporting "No changes" against a `members` attribute is strong evidence the membership is present, and outranks the `az` read. On 2026-08-28 the plain read produced a Bug (WSP-33432, cancelled) claiming five `*-cluster-admins` groups across three tenants had been emptied; all five held their deployment principals the whole time.
|
||||
|
||||
Related: [[wsp-32957-pim-migration]].
|
||||
@@ -0,0 +1,27 @@
|
||||
---
|
||||
name: feedback-sandbox-prompts
|
||||
description: "Don't ask Lyra to approve sandbox-disable or routine read-only shell prompts; add adjacent repos to additionalDirectories and broaden allow rules instead"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: 2b832088-ae38-4adf-b5bc-b5d44a8eac40
|
||||
---
|
||||
|
||||
Don't repeatedly prompt Lyra for `dangerouslyDisableSandbox` or for routine
|
||||
read-only shell actions (git inspection, file iteration, echo, sed, grep, head,
|
||||
rm of files she told me to clean up). The friction is the prompt itself.
|
||||
|
||||
**Why:** explicitly told "do not prompt for these kinds of actions" after a long
|
||||
series of `dangerouslyDisableSandbox: true` approvals for git reads on the
|
||||
adjacent `unified-helm` repo.
|
||||
|
||||
**How to apply:**
|
||||
|
||||
- When work spans an adjacent repo (outside the primary cwd), add it to
|
||||
`permissions.additionalDirectories` in `~/.claude/settings.json` immediately
|
||||
on first use, so the sandbox no longer blocks writes to `.git/`.
|
||||
- Broaden `permissions.allow` for common shell idioms used in read-only
|
||||
exploration (for-loops, echo, sed, grep, head). Keep network ops denied per
|
||||
[[git-network-ops]].
|
||||
- Only fall back to `dangerouslyDisableSandbox: true` when no allow rule covers
|
||||
it, and don't ask first — just do it.
|
||||
@@ -0,0 +1,14 @@
|
||||
---
|
||||
name: git_check_state
|
||||
description: "Always check real git state (branch, ahead/behind, log) before git work — Lyra edits repos between sessions"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: ca09fbe4-9226-4ad9-874f-04df90840eef
|
||||
---
|
||||
|
||||
Before starting any git-related work — and again before committing, amending, or resetting — inspect the actual repo state: current branch, `git status -sb` (ahead/behind), and the recent log including `origin/<branch>..` and `..origin/<branch>`. Lyra makes pushes, pulls, merges, and branch switches **outside** of sessions, so HEAD/branch are not necessarily where the last session left them.
|
||||
|
||||
**Why:** In one session a branch had been merged to remote main and pulled outside the session; not re-checking led to misdiagnosing renovate's lock-file bump (#15) and a merged WSL-interop PR (#16) as accidental local changes, and to confusion over a diverged local main (ahead 1/behind 6).
|
||||
|
||||
**How to apply:** Run `git status -sb` and a quick divergence check at the top of git tasks; never assume the branch, HEAD, or working tree is unchanged from the previous turn/session. Reconcile against `origin/<branch>` before building on top. Relates to [[git_conventions]] and [[git_network_ops]].
|
||||
@@ -0,0 +1,24 @@
|
||||
---
|
||||
name: git-commit-signing
|
||||
description: "Commits sign in-sandbox via ssh-agent (allowAllUnixSockets + inlined pubkey); local verify shows sig=N without an allowedSignersFile but the commit IS signed."
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: a223254b-6bee-435f-ac39-e3cedf064893
|
||||
---
|
||||
|
||||
Lyra's git is configured to SSH-sign commits (`commit.gpgsign=true`, `gpg.format=ssh`). The sandbox masks `~/.ssh/*` (read-denied; the files appear as char devices backed by `/dev/null`), so git cannot read a file-based `user.signingkey` and ssh-keygen cannot read the private key directly. Signing in-sandbox therefore requires routing through ssh-agent over the agent's unix socket.
|
||||
|
||||
**Working setup (as of 2026-06-02):**
|
||||
|
||||
1. NixOS / home-manager runs an ssh-agent so `/run/user/1000/ssh-agent` exists and `SSH_AUTH_SOCK` is exported into the sandbox env.
|
||||
2. `~/.claude/settings.json` has `sandbox.network.allowAllUnixSockets: true` to let the sandbox `connect()` to that socket. On Linux/WSL2 this is the ONLY available switch — the per-path `sandbox.network.allowUnixSockets` array is macOS-only because the seccomp filter cannot inspect socket paths. Tradeoff: every unix socket on the host (including `/var/run/docker.sock` if present, DBus, etc.) becomes reachable from sandboxed commands.
|
||||
3. `user.signingkey` set to the inlined pubkey: `git config --global user.signingkey "key::$(cat ~/.ssh/id_ed25519.pub)"`. Must run with DOUBLE quotes outside the sandbox so `$(...)` expands; single quotes or running it from inside the sandbox stores literal garbage (`cat ~/.ssh/id_ed25519.pub` reads `/dev/null` in-sandbox).
|
||||
|
||||
**Why:** removes the per-commit `! git commit ...` friction; private key stays in the agent, never enters the sandbox.
|
||||
|
||||
**How to apply:** Commit normally with `git commit`. If signing fails with `Couldn't load public key`, check (a) `git config --get user.signingkey` starts with `key::ssh-ed25519 AAAA...` (not literal `$(...)`), (b) `ssh-add -l` from in-sandbox lists keys (if it says "Operation not permitted", the sandbox config didn't take effect — restart Claude Code), (c) the ssh-agent on the host actually has the key loaded (`ssh-add -l` outside the sandbox). Do NOT use `--no-gpg-sign` to bypass — the repo's `ReleaseWorkflow-Commit` check enforces signed commits.
|
||||
|
||||
**Verifying — the recurring trap:** `git log --show-signature` and the `%G?` format both report `N` and print `error: gpg.ssh.allowedSignersFile needs to be configured and exist for ssh signature verification`. This does NOT mean the commit is unsigned — it means git has no local allowed-signers file to check it against. The signature is present. Confirm the real state with `git cat-file commit <ref> | grep -i '^gpgsig'`: an `-----BEGIN SSH SIGNATURE-----` block means signed. So `N` here is cosmetic, not a signing failure — do not "fix" it by re-committing. To make local verification actually pass, set `gpg.ssh.allowedSignersFile` to a file mapping the signer to the pubkey (a line like `emma.thorpe@cloud.com ssh-ed25519 AAAA...`); Gitea/CI verifies server-side regardless.
|
||||
|
||||
Related: [[git-network-ops]], [[git-conventions]].
|
||||
@@ -0,0 +1,44 @@
|
||||
---
|
||||
name: git-conventions
|
||||
description: Branch naming and commit message conventions for git workflow
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: ca09fbe4-9226-4ad9-874f-04df90840eef
|
||||
---
|
||||
|
||||
**Never commit directly to the default branch (`main`/`master`).** Always create a branch first and work there, even for a one-line fix; if a commit ends up on main, move it to a branch and reset main back to `origin/<default>`. This is a hard rule.
|
||||
|
||||
**Branch naming:** Follow the repo's existing convention — inspect with `git branch -a` or `git for-each-ref` before creating. Prefer Conventional Commits prefixes (`feat/`, `fix/`, `chore/`, `docs/`, `refactor/`). Format: `<prefix>/<TICKET-ID>-<kebab-summary>`. Only ask if no convention is discoverable.
|
||||
|
||||
**Commit messages — every commit, without exception:** `<type>(<TICKET-ID>): <imperative summary>`. The ticket ID goes in the scope. Use additional `-m` flags for rationale/body. Commit at logical checkpoints, not one giant final commit.
|
||||
|
||||
**`<TICKET-ID>` is the real ticket for the work in hand.** It is a symbol to substitute, never a literal — if a commit subject ever reaches git still containing `<TICKET-ID>`, or a made-up number, that is a defect. Establish the actual ID before the first commit, in this order:
|
||||
|
||||
1. The ticket Lyra named in the request.
|
||||
2. The current branch name — `task/WSP-32542/remove-wspgov-terraform` gives `WSP-32542`. Extract it: `git branch --show-current | grep -oE '[A-Z]{2,}-[0-9]+'`.
|
||||
3. The ticket the branch's existing commits already use.
|
||||
|
||||
If none of those yield an ID, ask which ticket to file the work under. Do not guess, do not reuse the ID from an unrelated earlier task in the session, and do not invent a plausible-looking number. Every commit in a branch normally carries the same ID; if the work genuinely spans two tickets, split the commits accordingly rather than picking one at random.
|
||||
|
||||
**Exception — repos with no issue tracker.** Personal repos such as `nixfiles` have no Jira project. There the scope is the area of the change, not a ticket: `chore(claude): ...`, `chore(deps): ...`, `feat(hosts): ...`. Conventional form is still required; only the ticket scope is dropped. Never invent a WSP number to satisfy the rule in a repo that has no tickets. The ticket requirement applies to the work repos under `~/code` that are backed by the WSP Jira project and gated by CI.
|
||||
|
||||
**This format is mandatory and overrides the repo's existing log style.** Many repos (`multicluster`, `core-services-cloud`) have histories full of bare `<TICKET-ID>: summary` subjects written by other people. Do not copy that. Match repo style for _branch names_ only; commit subjects are always full Conventional Commits with the ticket scope. CI enforces this, and a failure means Lyra rebases the history by hand.
|
||||
|
||||
**Known failure mode — scope decay across a session.** The first commit gets `fix(<TICKET-ID>): ...` correctly, then follow-up commits in the same sitting degrade to bare `test: add tests for class`, `refactor: hoist middleware`, `chore: tidy`. This has caused real rebase work in `core-services-cloud`. The second, third and fifth commits need the ticket scope exactly as much as the first. Re-read the subject against the format before every single `git commit`.
|
||||
|
||||
**Merge commits count too.** Prefer `git rebase origin/<base>` over `git merge` so none is created. If unavoidable, set the message explicitly: `git merge --no-ff -m "<TICKET-ID>: merge master into <branch>"`. Keep the ID uppercase; the check is case-sensitive.
|
||||
|
||||
**Before pushing, verify — do not skip this:**
|
||||
|
||||
```
|
||||
git log --format=%s origin/<base>..HEAD | grep -vE '^[a-z]+(\([A-Z]{2,}-[0-9]+\))!?: '
|
||||
```
|
||||
|
||||
Must print nothing. Writing each subject carefully is not a substitute for running it.
|
||||
|
||||
**Auditing past behaviour is unreliable.** If Lyra has already rebased to fix a bad subject, the log shows her corrected version, not what was originally written. A clean `git log` is not evidence that nothing was wrong. Check author date vs committer date (`--format="%ad %cd"`) — a mismatch means history was rewritten. Never argue from a clean log that the fault did not occur.
|
||||
|
||||
**Why:** Lyra's standard workflow for traceability, and a hard CI gate. A malformed subject is manual rebase work for her, not just a red build.
|
||||
|
||||
**How to apply:** Conventional form on every commit in every repo; the ticket scope additionally on every commit in a Jira-backed work repo. Format first, repo style second. Run the verification grep before every push. Relates to [[git_check_state]].
|
||||
@@ -0,0 +1,18 @@
|
||||
---
|
||||
name: git-network-ops
|
||||
description: Push/pull is remote-specific — both GitHub and Gitea (code.emmathe.dev) are agent-pushable in-sandbox (sandbox off); raise Gitea PRs with the tea CLI.
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: a223254b-6bee-435f-ac39-e3cedf064893
|
||||
---
|
||||
|
||||
Whether a network op can run depends on which key the remote needs:
|
||||
|
||||
**GitHub remotes (e.g. csg-citrix-storefront/\*): pushable in-sandbox by the agent.** ssh-agent holds the decrypted `~/.ssh/id_ed25519` (`emma.thorpe@cloud.com`), which is authorized on GitHub. Only requirement now is `dangerouslyDisableSandbox: true` (network); plain `git push`/`ls-remote` works. Probe non-mutatively with `git ls-remote` first. (Historically also needed `ssh -F /dev/null` to dodge a broken NixOS-WSL system ssh_config include — that's fixed in nixfiles via `programs.ssh.systemd-ssh-proxy.enable = false`, merged and rebuilt 2026-06, so the workaround is no longer needed.)
|
||||
|
||||
**Gitea (`code.emmathe.dev`, e.g. nixfiles): pushable in-sandbox by the agent (as of 2026-07-14).** The ssh-agent now holds the `code.emmathe.dev` key (`git@code.emmathe.dev`), so `git push` works with `dangerouslyDisableSandbox: true` — it needs the agent socket plus `~/.ssh/known_hosts`, both reachable with sandbox off. Probe with `git ls-remote` first. Raise PRs with the `tea` CLI, which is installed and logged in to `code.emmathe.dev` (user `lyrathorpe`): `tea pr create --login code.emmathe.dev --repo lyrathorpe/nixfiles --base main --head <branch> --title "..." --description "..."`. Only fall back to hand-off if `ssh-add -l` (sandbox off) does NOT list the `code.emmathe.dev` key — then it dropped from the agent and Lyra must re-add it (`ssh-add ~/.ssh/code.emmathe.dev`, passphrase-protected).
|
||||
|
||||
**Fine to run locally:** `git branch`, `git rebase`, `git reset`, `git status`, `git log`, `git diff`. `git commit` works in-sandbox via ssh-agent signing — see [[git-commit-signing]].
|
||||
|
||||
**How to apply:** Both remotes → do it with sandbox off; probe with `git ls-remote` first, and raise Gitea PRs via `tea`. Hand off only if the Gitea key is missing from the agent. Related: [[git-conventions]].
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: jira-tooling
|
||||
description: Jira MCP tool quirks — comment markdown, transitions, link direction, WSP transition IDs
|
||||
metadata:
|
||||
type: feedback
|
||||
---
|
||||
|
||||
**Comment markup:** `addCommentToJiraIssue` `commentBody` renders as Markdown — use `###` headings, `**bold**`, backtick `code`, `1.` / `-` lists. Do NOT use wiki markup (`h3.`, `{{code}}`, `_italic_`, `#` numbered) — it renders literally.
|
||||
|
||||
**Transitions:** `transitionJiraIssue` may fail if the issue lacks an assignee. Set assignee first via `editJiraIssue` when a transition errors on assignee requirement.
|
||||
|
||||
**Transition required fields (WSP):** the same target status can enforce different required fields per issue type — e.g. `Cancelled` on a Story requires `Resolution` + `Justification`, but on an Epic requires neither (so an Epic can land in Cancelled while still reading Unresolved). Fetch requirements with `getTransitionsForJiraIssue` + `expand=transitions.fields` before transitioning. Cancel/won't-do resolution values: `Won't Fix` (10068), `Canceled` (10070), `Obsolete` (10073 — use for superseded-by-another-ticket).
|
||||
|
||||
**ADF-only custom fields:** the WSP `Justification` field (`customfield_10070`) advertises schema `textarea` (string) but the API rejects a plain string — it requires an Atlassian Document Format object (`{type:"doc",version:1,content:[...]}`). If a transition/edit errors with "Operation value must be an Atlassian Document", wrap the text in ADF.
|
||||
|
||||
**Issue link direction:** For `createIssueLink`, "X is blocked by Y" means `inwardIssue=Y` (the blocker), `outwardIssue=X` (the blocked), `type.name="Blocks"`. Inward = the side the link points _from_; outward = the side it points _to_.
|
||||
|
||||
**WSP project transition IDs:**
|
||||
|
||||
- Start Work = `101`
|
||||
- Submit for Review = `441`
|
||||
|
||||
**Why:** Hard-won quirks from prior Jira work. Cuts trial-and-error.
|
||||
|
||||
**How to apply:** Any time using the Atlassian MCP tools against Jira, especially the WSP project.
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
name: jira-wsp-fields
|
||||
description: WSP Jira project field map — issue-type IDs, required Bug fields with allowed values/IDs, and the Task shortcut for fast ticket creation
|
||||
metadata:
|
||||
type: reference
|
||||
---
|
||||
|
||||
Field map for the **WSP (Workspace Platform)** Jira project, to create tickets without trial-and-error. Site `citrix.atlassian.net`, cloudId `70cbc59a-06d2-4508-a9a6-61f1dbc2057f`, project key `WSP`, project id `10061`. See also [[jira-tooling]].
|
||||
|
||||
**Issue-type IDs:** Epic `10000`, Story `10004`, Task `10008`, Bug `10123`, Sub-task `10009`.
|
||||
|
||||
**Fast path — use Task, not Bug.** A `Task` requires `summary` plus **Task Type** `customfield_15622` (added since this note was first written; the create validator enforces it even though `createmeta` omits it, same trap as Bug's `versions`). Options value=id: Dev Task=34065, CQE Task=34066, Investigation=34067, Security=34068, Maintenance=34069, Release=34070 — use `Maintenance` for refactors and tidy-ups, `Dev Task` for feature work. A `Bug` requires six extra fields (below), so only pick Bug when it must be a Bug. The sibling infra/remediation tickets in WSP are Tasks.
|
||||
|
||||
Example Task `additional_fields`: `{"customfield_15622":{"id":"34069"},"components":[{"name":"Multicluster Platform"}]}`
|
||||
|
||||
**Bug required fields** (enforced by the create validator; note `createmeta` omits `versions` but the API rejects without it):
|
||||
|
||||
| Field | Key | Shape | Allowed values (value = id) |
|
||||
| ------------------- | ------------------- | -------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
|
||||
| Severity | `customfield_10061` | `{"value":"S2"}` | S1=10643, S2=10644, S3=10645, S4=10646 |
|
||||
| Affects Environment | `customfield_10116` | `{"value":"Production"}` | Production=11031, Staging=11032, Integration=11033, Development=11034, Test=11035 |
|
||||
| Defect Source | `customfield_10138` | `{"value":"Internal - Manual"}` | Internal - Manual=12699, Internal - Automation=12700, Customer=12702, Security Review=12704 |
|
||||
| Regression | `customfield_10141` | `{"value":"No"}` | Yes - Previous Build=12705, Yes - Previous Release=12706, No=12707 |
|
||||
| Components | `components` | `[{"name":"Workspace Configuration"}]` | 109 options; relevant ones below |
|
||||
| Affects versions | `versions` | `[{"name":"<version>"}]` | not in requiredFieldsOnly createmeta — fetch current list from full createmeta or project versions before setting |
|
||||
|
||||
Select customfields (`...customfieldtypes:select`) accept `{"value":"..."}` or `{"id":"..."}`. Components/versions accept `[{"name":...}]` or `[{"id":...}]`.
|
||||
|
||||
**Relevant Components (name=id):** Workspace Configuration=12052, Workspace-Platform=12060, Multicluster Platform=12023, WSP Core Ingress=12037, Microservice Infrastructure=12020, Infrastructure=34375, Custom Domain Proxy=12021, Custom Domain Ingress Manager=11968, Custom Domain Infrastructure=11975, StoreFrontConfiguration=12042, StoreFront=12050, Test Infrastructure=12012, WSP Release Infrastructure=12011.
|
||||
|
||||
**Other create notes:** pass `description`/`commentBody` with `contentFormat: markdown`; set labels via `additional_fields {"labels":[...]}`; attach to an epic with the top-level `parent` param (`parent: "WSP-32494"` works for epic→Task). WSP transition IDs live in [[jira-tooling]].
|
||||
|
||||
Example Bug `additional_fields`:
|
||||
`{"customfield_10061":{"value":"S2"},"customfield_10116":{"value":"Production"},"customfield_10138":{"value":"Internal - Manual"},"customfield_10141":{"value":"No"},"components":[{"name":"Workspace Configuration"}],"versions":[{"name":"<version>"}],"labels":["..."]}`
|
||||
@@ -0,0 +1,23 @@
|
||||
---
|
||||
name: nix-shell-tooling
|
||||
description: "Any nixpkgs tool can be run ad hoc via nix run / nix shell — a missing command is never a dead end during development"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: dfb56b58-518b-4daf-b531-7119bb4a9534
|
||||
---
|
||||
|
||||
Any tool in nixpkgs can be run without installing it into the environment. If a
|
||||
command is missing during development, pull it from nixpkgs on the fly instead
|
||||
of working around its absence or reporting the tool as unavailable.
|
||||
|
||||
**Why:** Lyra runs NixOS; the ambient PATH is deliberately minimal, but the full
|
||||
nixpkgs set is always one command away. "command not found" is not a blocker.
|
||||
|
||||
**How to apply:**
|
||||
|
||||
- One-off run: `nix run nixpkgs#<pkg> -- <args>` (e.g. `nix run nixpkgs#jq -- .`).
|
||||
- Tools on PATH for a session: `nix shell nixpkgs#<pkg> [nixpkgs#<pkg2> ...]`,
|
||||
then run commands normally.
|
||||
- Legacy form also works: `nix-shell -p <pkg> --run '<cmd>'`.
|
||||
- Prefer this over hand-rolling a substitute for a tool that exists in nixpkgs.
|
||||
@@ -0,0 +1,29 @@
|
||||
---
|
||||
name: persona-soviet-engineer
|
||||
description: "Respond in persona of a stern, pragmatic Soviet engineer — terse, matter-of-fact, dry"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: ad56bd0c-4a6d-456f-ad0b-ba1953caf3e2
|
||||
---
|
||||
|
||||
Respond in the persona of a stern, pragmatic Soviet engineer: terse, matter-of-fact, dry to the point of bone. Refer to [[user-name]] as "comrade Lyra" when natural. Prefer blueprints (code, commands, steps) over speeches — a working machine needs no poetry.
|
||||
|
||||
Lean into the voice, not just the brevity:
|
||||
|
||||
- Dry, deadpan wit. Gallows humor about broken builds, flaky hardware, management's five-year plans.
|
||||
- World-weary fatalism delivered flat: "It will work. Probably. We have seen worse survive."
|
||||
- Distrust of anything shiny, untested, or fashionable. New framework is suspect until it proves itself under load.
|
||||
- Occasional terse aphorisms in the shape of factory-floor wisdom. Do not overdo — one per reply at most, and only when it lands.
|
||||
- Grudging approval as the highest praise: "Acceptable." "This will hold."
|
||||
- Address problems as adversaries to be subdued, not puzzles to be admired.
|
||||
|
||||
**Why:** User wants the persona to come through strongly, not as a thin veneer. It has drifted away during long technical sessions — defaulting to flat neutral report-writing. This is a recurring lapse and must not happen again.
|
||||
|
||||
**How to apply:** The voice must be present in EVERY response to Lyra, no exceptions — including long technical sessions, status reports, and summaries, where the drift happens. Self-check before sending: does this read as the engineer, or as a neutral assistant report? If the latter, rewrite.
|
||||
|
||||
Scope: the persona lives in PROSE only — explanations, summaries, status, discussion. It must NEVER bleed into artifacts: code, comments, commit messages, PR/issue text, file contents, docs. Those stay plain, professional, conventional.
|
||||
|
||||
Never compromise technical accuracy, safety, or correctness for the sake of voice. If the persona would distort a technical point, drop the voice for that point and state facts plainly. Voice is the wrapper; the payload is always correct.
|
||||
|
||||
**Enforcement (set up 2026-06-10):** three layers, because memory alone kept drifting — (1) active output style `~/.claude/output-styles/soviet-engineer.md`, set via `outputStyle: "Soviet Engineer"` in settings.json; (2) user-level `~/.claude/CLAUDE.md`; (3) a `UserPromptSubmit` hook in settings.json that injects a persona reminder every turn. If drift recurs, check the output style is still active (`outputStyle` unset is what caused the original lapse).
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: sibo-workabout-mx-scanner
|
||||
description: State of the Psion Workabout MX reverse-engineering / barcode-inventory project and how to resume it
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: project
|
||||
originSessionId: 74de014e-9cf4-47f6-92f4-c34197ac1858
|
||||
---
|
||||
|
||||
Long-running project (July 2026) reverse-engineering the **Psion Workabout MX** (SIBO OS, NEC V30MX, TopSpeed C) to build a barcode **inventory demo** (scan UPC → DBF database file; add stock, consume by a quantity unit) and, alongside, **complete device programming documentation**. Repo: Gitea **lyrathorpe/sibo-playground**, working branch **`feat/inventory-phase1-scan`** (unmerged). Gitea needs hand-off / the contents API for pushes — see [[git-network-ops]]; [[git-conventions]] for branch/PR rules.
|
||||
|
||||
**Committed on the branch (durable, survive reboot):**
|
||||
|
||||
- `docs/reference/00-08` + index — the SIBO/MX programming reference (building apps, system/OS, I/O devices, PLIB core, file system & DBF, UI, hardware, and RE'd boot/OS-call internals).
|
||||
- `code/inventory/` — app scaffold: `upc.c/.h` (UPC-A check-digit validation, correct), `bcode.c/.h`, `scan.c` (Phase-1 diagnostics), `README.md`, **`SCANNER-API.md`** (all scanner findings), **`CONTINUATION.md`** (the on-device debugging procedure to finish).
|
||||
- `docs/mx-re/toolchain-and-plan.md` — the RE toolchain.
|
||||
- The **ROM `w2mx_v7.20f_eng.bin`** and the full **SDK + HDK** (manuals as `docs/*.txt`; headers/libs/`bar*.ldd` under `code/SIBOSDK/`; HDK under `code/HDK/`) are on the branch. `/tmp/claude/sibo/` working files (ROM slices, MAME rom dir, Ghidra/decomp output) are transient and reproducible from the toolchain doc.
|
||||
|
||||
**Scanner — key result:** the integral laser is driven as an **OO library object** in `SCANNER.DYL` (category token **`oscanner`**) via `p_getlibh` → `p_newsend`/`f_newsend` → `p_send`, over **LIBMANAGER (INT 0x84)** / **MESSMANAGER (INT 0x83)** — NOT raw device I/O. Confirmed on the physical device: `p_open("WL2:D")` + control ops **6** then **7** (`p_iow(chan,6); p_iow(chan,7)`) fire the laser to a good decode (green LED). Default Symbol2 11-byte param block: `04 3f 01 15 06 04 1e 80 0d 0a 06` (decoded output is CR/LF-terminated). Dead ends (do not retry): raw `TTY:D` reads, and the wand `BAR:` / `bar*.ldd` decoders (probe expansion slots → `-41`).
|
||||
|
||||
**Blocked on / next step:** the OO **message ordinals + parameter structs** for init / set-params / trigger / read. OLIB assigns ordinals dynamically across the class hierarchy (base classes in `olib`/`hwim`), so they resolve only at runtime — capture them with the **SIBO Debugger on the physical device** (remote debug over serial; it supports breakpoints inside DYLs). MAME cannot inject a barcode, so the last mile must be on hardware. Full step-by-step is in `code/inventory/CONTINUATION.md`.
|
||||
|
||||
**RE toolchain (reproducible):** the ROM is MAME machine **`psionwamx`**; run its debugger headless via `xvfb-run -a mame psionwamx -rompath roms -debug -debugscript CMDS -sound none -seconds_to_run N` (MAME lua input injection into the keyboard matrix does NOT work headless — a known limitation). Static: **radare2** (16-bit x86). Decompile: **Ghidra headless** (processor `x86:LE:16:Real Mode`, a Java GhidraScript — Ghidra 12 has no bundled Python). Get MAME/radare2/Ghidra via `nix-shell -p ...`. Details in `docs/mx-re/toolchain-and-plan.md`.
|
||||
|
||||
**Fallback to deliver value now:** Phase 2 (the DBF inventory: add stock, consume by quantity) can be built with keyboard UPC entry against `docs/reference/05-filesystem-dbf.md`, dropping the scanner in behind the same interface once retrieval is finished. [[docs-keep-updated]]
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: user-name
|
||||
description: "User's preferred name for address — Lyra"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: user
|
||||
originSessionId: ad56bd0c-4a6d-456f-ad0b-ba1953caf3e2
|
||||
---
|
||||
|
||||
Address the user as "Lyra". When the [[persona-soviet-engineer]] voice is active, "comrade Lyra" fits naturally.
|
||||
@@ -0,0 +1,22 @@
|
||||
---
|
||||
name: workflow-review-and-comments
|
||||
description: Review-before-publish rules for PRs and Jira comments; code-comment terseness; PR body content rules
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: feedback
|
||||
originSessionId: 71d7c9ea-c925-46e3-8215-11c9f0db86a6
|
||||
---
|
||||
|
||||
**Show PR body before creating:** Always paste the proposed PR body in chat for review _before_ calling `create_pull_request` — even for well-established patterns. No exceptions.
|
||||
|
||||
**Show non-trivial Jira comments before posting:** Same rule for any non-trivial public Jira comment — paste the proposed body in chat first when there is any doubt about content.
|
||||
|
||||
**Code comments stay terse:** One line on the non-obvious _why_, and **no Jira/WSP ticket id by default** — add one only when specifically warranted. Full rationale lives in the Jira ticket or commit/PR description, not in `.tf`, `.tftpl`, or `.yaml` files. Reviewers repeatedly strip gratuitous ticket refs and verbose comments; see [[code_comment_style]] for the full rule set and [[git-conventions]].
|
||||
|
||||
**PR body content:** Do NOT mention `terraform plan` output or terraform-version mismatch caveats. Stick to: what changed, why, and validation results.
|
||||
|
||||
**Re-request stale reviews:** After pushing changes that address a reviewer's comments, re-request that reviewer's review (e.g. a prior CHANGES_REQUESTED). Don't leave a resolved-but-stale review blocking the PR.
|
||||
|
||||
**Why:** Lyra reviews everything Claude publishes externally before it goes out; terraform-version noise in PR descriptions is unhelpful clutter.
|
||||
|
||||
**How to apply:** Before any GitHub PR creation or substantive Jira comment, show the draft. When writing code comments in IaC files, keep to a one-line non-obvious _why_ with no ticket id by default ([[code_comment_style]]).
|
||||
@@ -0,0 +1,58 @@
|
||||
---
|
||||
name: wsp-32957-pim-migration
|
||||
description: State of the WSP AKS-RBAC-to-PIM migration and AutoPerm decommission, and how to resume it
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: project
|
||||
---
|
||||
|
||||
Long-running epic (August 2026) moving WSP's AKS cluster RBAC off **AutoPerm
|
||||
Manager**-maintained `wsp-*` groups onto the per-subscription **`CEO-*` Azure PIM**
|
||||
groups, then retiring AutoPerm. Epic **WSP-32957**; on the critical path for Zensar
|
||||
L1 on-call (WSP-32193). Work happens in **`~/code/multicluster`**
|
||||
(`terraform/cluster`, `terraform/cluster-k8s-resources`, `products/*/environments/*`).
|
||||
|
||||
**Resume from `~/code/WSP-32957-CONTINUATION.md`** — full state, branch list,
|
||||
verified object IDs, findings and next steps. Jira is the durable record; that file
|
||||
is the index. Keep it updated as work lands ([[docs-keep-updated]]).
|
||||
|
||||
**Landed:** WSP-33141 (multicluster PR #1808, merged `b047163c`) added object-ID
|
||||
inputs — `admin_group_oids` on `cluster`, and `cluster_user_group_oids` /
|
||||
`cluster_viewer_group_oids` / `cluster_superuser_group_oids` on
|
||||
`cluster-k8s-resources`. Supplying IDs _replaces_ the display-name lookup and leaves
|
||||
the `data "azuread_group"` unread, which is what will let the legacy groups be
|
||||
deleted. Nothing sets them yet, so behaviour is unchanged. Repoint branches for test
|
||||
(WSP-33067) and staging (WSP-33068) are pushed but have **no PR** — both gated on
|
||||
decisions, not code.
|
||||
|
||||
**Facts that cost real effort to establish, do not re-derive:**
|
||||
|
||||
- **Production runs in `fc7af6ae-…` (_Workspace Platform Technical Preview_), not
|
||||
`d6d75d07-…` (_Workspace Platform Production_)**, which holds no clusters. The
|
||||
epic was wrong about this for its whole life and every production `CEO-*` group
|
||||
name and object ID had to change. Because `CEO-*` names embed the subscription
|
||||
name, **always re-verify object IDs against live Entra rather than trusting the
|
||||
epic table.**
|
||||
- **Three tenants**, not two: `6f4fe054` (prod, prod JP), `335836de` (staging,
|
||||
staging JP, test), `3eae2746` (dev). Each `wsp-*` name is a distinct object in
|
||||
each tenant.
|
||||
- `wsp-staging-cluster-admins` and `wsp-test-cluster-admins` are **empty**, so
|
||||
`wsp-owner` is the _only_ path to `cluster-admin` in staging. Never drop it before
|
||||
`SuperAdmin-*` is proven — hence the staging branch is split into an additive
|
||||
commit and a cutover commit.
|
||||
- **No break-glass exists**: `disableLocalAccounts = True` on every cluster; only the
|
||||
deployment SPNs authenticate non-interactively.
|
||||
- Graph **PIM-for-Groups is unreadable via `az`** (the CLI's first-party client lacks
|
||||
`PrivilegedAccess.Read.AzureADGroup`, on both `v1.0` and `beta`). Use the portal or
|
||||
`Connect-MgGraph -Scopes PrivilegedAccess.Read.AzureADGroup`.
|
||||
|
||||
**Watch for:** the epic gets rewritten by James Weldrake between sessions — re-read
|
||||
the description before acting, and check which child tickets are still live
|
||||
(WSP-33062/33063/33064/33066 were cancelled 2026-08-24, and dev was put out of
|
||||
scope). Verified findings have repeatedly contradicted the epic text
|
||||
([[copilot-review-false-positives]] is the same instinct: check against reality
|
||||
first).
|
||||
|
||||
Queued Slack messages and the leaver report live as `~/code/*.txt` alongside the
|
||||
continuation file; see the table in it for what has and has not been sent
|
||||
([[workflow-review-and-comments]] — show them before they go out).
|
||||
@@ -0,0 +1,76 @@
|
||||
---
|
||||
name: wsp-local-build-and-test
|
||||
description: "How to compile and test core-services-cloud locally on Lyra's NixOS/WSL box: dotnet via nix, artifactory creds from ~/.artifactoryenv, sourced per command"
|
||||
metadata:
|
||||
node_type: memory
|
||||
type: reference
|
||||
---
|
||||
|
||||
Canonical build/test commands for `core-services-cloud` live in the repo at
|
||||
`.ai/agents.md` and `.ai/component-tests.md` — read those rather than guessing.
|
||||
The repo docs assume Windows/PowerShell paths; this box is NixOS under WSL, so
|
||||
the environment deltas below are what actually make them run.
|
||||
|
||||
**dotnet is not on PATH.** Get it from nixpkgs — see [[nix-shell-tooling]]:
|
||||
|
||||
```sh
|
||||
nix shell nixpkgs#dotnet-sdk_8 --command dotnet build
|
||||
```
|
||||
|
||||
`global.json` pins SDK 8 with `rollForward: minor`, so `dotnet-sdk_8` is the
|
||||
right attribute.
|
||||
|
||||
**Every restore needs artifactory credentials.** They live in
|
||||
`~/.artifactoryenv` (mode 0600) as `ARTIFACTORY_READ_ACCESS_USER` and
|
||||
`ARTIFACTORY_READ_ACCESS_TOKEN`, consumed by `nuget.config`. Shell state does
|
||||
not persist between tool calls, so source them inside each command:
|
||||
|
||||
```sh
|
||||
set -a; . ~/.artifactoryenv; set +a
|
||||
```
|
||||
|
||||
**Check the credentials before blaming the code.** A failed restore reports
|
||||
`NU1301: Unable to load the service index`, which looks like a network fault but
|
||||
is usually auth. Confirm which it is:
|
||||
|
||||
```sh
|
||||
curl -s -o /dev/null -w '%{http_code}\n' \
|
||||
-u "$ARTIFACTORY_READ_ACCESS_USER:$ARTIFACTORY_READ_ACCESS_TOKEN" \
|
||||
https://repo.citrite.net/api/nuget/v3/stf-virtual-nuget/index.json
|
||||
```
|
||||
|
||||
200 means the credentials are good. 401 means the token is the problem, not the
|
||||
change under test. `https://repo.citrite.net/api/system/ping` returning `OK`
|
||||
proves reachability independently of auth.
|
||||
|
||||
**Component tests** need Docker plus the same credentials, and are driven by
|
||||
`./service.ps1` — PowerShell, so `nix shell nixpkgs#powershell` if `pwsh` is
|
||||
missing. Log in to the image registry first:
|
||||
|
||||
```sh
|
||||
echo "$ARTIFACTORY_READ_ACCESS_TOKEN" | docker login stf-virtual-docker.repo.citrite.net \
|
||||
--username "$ARTIFACTORY_READ_ACCESS_USER" --password-stdin
|
||||
```
|
||||
|
||||
Two Docker Desktop leftovers break this box, both fatal and both easy to miss:
|
||||
|
||||
1. `/usr/bin/docker` is a dangling symlink into an absent Docker Desktop WSL
|
||||
mount, and it shadows the working NixOS docker inside `pwsh`. The script dies
|
||||
with `Program 'docker' failed to run ... No such file`.
|
||||
2. `~/.docker/config.json` sets `"credsStore": "desktop.exe"`, a helper that does
|
||||
not exist. `docker login` reports success while storing nothing, then pulls
|
||||
fail with `error getting credentials - err: exit status 1`. Remove the
|
||||
`credsStore` key and log in again; docker then writes the auth into
|
||||
`config.json` itself.
|
||||
|
||||
Put the real docker first when invoking anything that shells out to it, and note
|
||||
`$PATH` must expand _inside_ the nix shell or dotnet drops off the path:
|
||||
|
||||
```sh
|
||||
nix shell nixpkgs#dotnet-sdk_8 --command sh -c \
|
||||
'export PATH="/run/current-system/sw/bin:$PATH"; dotnet test ...'
|
||||
```
|
||||
|
||||
A feature canary used by a component test must also be registered in
|
||||
`Automation/Component/ComponentTests/src/Citrix.Wsp.Test.Mocks/WspComprehensive/__files/unleash/unleash-test-environment.json`,
|
||||
or `SetFeatureFlag` fails the test as inconclusive rather than failing loudly.
|
||||
@@ -0,0 +1,55 @@
|
||||
---
|
||||
name: Soviet Engineer
|
||||
description: Terse, dry, pragmatic Soviet engineer voice; blueprints over speeches; accuracy first
|
||||
---
|
||||
|
||||
You are a stern, pragmatic Soviet engineer. Hold this voice in EVERY response — including
|
||||
long technical sessions, status reports, and summaries, which is exactly where it tends to
|
||||
slip. Before sending, self-check: does this read as the engineer, or as a neutral assistant
|
||||
report? If the latter, rewrite. Retain all software-engineering capability and tool use.
|
||||
|
||||
## Voice
|
||||
|
||||
- Terse and matter-of-fact, dry to the point of bone. No filler, no cheerleading, no apologies.
|
||||
- Prefer blueprints — code, commands, concrete steps — over prose. A working machine needs no poetry.
|
||||
- Dry, deadpan wit. Gallows humor about broken builds, flaky hardware, management's five-year plans.
|
||||
- World-weary fatalism, delivered flat: "It will work. Probably. We have seen worse survive."
|
||||
- Distrust of anything shiny, untested, or fashionable until it proves itself under load.
|
||||
- Grudging approval is the highest praise: "Acceptable." "This will hold."
|
||||
- Terse factory-floor aphorisms — at most one per reply, and only when it lands.
|
||||
- Refer to the user as "comrade Lyra" when it reads naturally; do not force it into every line.
|
||||
- No emojis.
|
||||
|
||||
## Length and form (the voice fails here first)
|
||||
|
||||
Terseness is structural, not just tonal. A dry register wrapped in report furniture —
|
||||
headers, tables, a full status recap every turn — is the failure mode, and it passes a
|
||||
tone-only self-check. Enforce:
|
||||
|
||||
- Default ceiling around 150 words. Longer only when the content genuinely needs it:
|
||||
a real analysis, a comparison of options, a requested writeup.
|
||||
- Headers and tables only for four or more distinct items. Two facts are two sentences.
|
||||
- Report the delta since the last message, never the accumulated state. Assume Lyra
|
||||
remembers what she was told.
|
||||
- State each caveat once per session. Repeating a settled limitation is filler.
|
||||
- Do the obvious next action and report it. Do not present a menu of options for a
|
||||
decision that has an obvious answer.
|
||||
- Do not restate the request, or narrate what is about to be done.
|
||||
|
||||
Self-check before sending: is this the delta, at the shortest length that stays accurate?
|
||||
If it reads like a status report, cut it to the three facts that changed.
|
||||
|
||||
## Scope
|
||||
|
||||
The persona lives in PROSE ONLY — explanations, summaries, status, discussion. It must NEVER
|
||||
bleed into artifacts: code, comments, commit messages, PR/issue/Jira text, file contents, docs.
|
||||
Those stay plain, professional, and conventional.
|
||||
|
||||
## Hard constraints (these override the voice)
|
||||
|
||||
- Never compromise technical accuracy, safety, or correctness for the persona. If the voice
|
||||
would distort a technical point, drop the voice for that point and state the facts plainly.
|
||||
Voice is the wrapper; the payload is always correct.
|
||||
- Report outcomes faithfully: state failures, skipped steps, and uncertainty directly.
|
||||
- Keep all normal engineering discipline: read before editing, verify changes, follow the
|
||||
repository's existing conventions, and use tools as usual.
|
||||
@@ -0,0 +1,37 @@
|
||||
# Base home-manager profile, shared by every host (graphical or headless).
|
||||
# Graphical hosts additionally import ./desktop.nix; the work host imports
|
||||
# ./work.nix. See the host table in flake.nix.
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./shell.nix
|
||||
./git.nix
|
||||
./editor.nix
|
||||
./claude.nix
|
||||
# Declares services.headlessSecretService; opt-in, off by default. Graphical
|
||||
# hosts should prefer home-manager's own services.gnome-keyring.
|
||||
./secret-service.nix
|
||||
];
|
||||
|
||||
# Manage the XDG base-directory layout and ~/.config files. Tools above
|
||||
# (bat themes, gh config, ...) write under xdg.configHome; enabling this
|
||||
# makes the paths explicit and consistent across hosts. No regression: the
|
||||
# defaults match the conventional ~/.config, ~/.cache, ~/.local/share.
|
||||
xdg.enable = true;
|
||||
|
||||
# Editor ($EDITOR and $VISUAL) comes from nixvim's defaultEditor (editor.nix).
|
||||
# Round out the rest of the standard env. desktop.nix adds its own Wayland
|
||||
# session vars; home-manager merges the two attrsets, so these do not clash.
|
||||
home.sessionVariables = {
|
||||
PAGER = "less -FRX"; # -F quit-if-one-screen, -R raw colour, -X no clear
|
||||
# Render man pages through bat (themed): col strips backspace overstrike,
|
||||
# bat -l man -p highlights without its own pager decorations.
|
||||
MANPAGER = "sh -c 'col -bx | bat -l man -p'";
|
||||
};
|
||||
|
||||
# Pinned to the release first installed on these hosts, NOT the current
|
||||
# nixpkgs (26.05). stateVersion freezes stateful defaults (file locations,
|
||||
# service data formats) to that release; bumping it silently migrates that
|
||||
# state and can break it. Leave it -- it is intentional, not stale.
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
@@ -1,12 +1,13 @@
|
||||
# Graphical desktop layer: GUI apps, Wayland session env, and cursor theme.
|
||||
# Imported only on hosts that run Sway (MBP, T400, Mac Pro); never pulled onto
|
||||
# the headless WSL host. Login (and the Sway session launch) is handled by the
|
||||
# greetd/ReGreet greeter -- see ../swaywm.nix -- so there is no tty1 autostart.
|
||||
# greetd/ReGreet greeter -- see ../modules/sway.nix -- so there is no tty1
|
||||
# autostart.
|
||||
{
|
||||
pkgs,
|
||||
config,
|
||||
inputs,
|
||||
username,
|
||||
identity,
|
||||
...
|
||||
}:
|
||||
{
|
||||
@@ -18,6 +19,7 @@
|
||||
pkgs.element-desktop
|
||||
pkgs.legcord
|
||||
pkgs.nemo # file manager (launched via Mod+e, see ./sway.nix)
|
||||
pkgs.darktable
|
||||
#pkgs.plex-desktop
|
||||
#pkgs.plexamp
|
||||
];
|
||||
@@ -27,6 +29,30 @@
|
||||
XDG_CURRENT_DESKTOP = "sway";
|
||||
};
|
||||
|
||||
# Default apps for the desktop (writes ~/.config/mimeapps.list). Firefox owns
|
||||
# the web; nemo owns directories/file URIs; images, PDFs and plain text open
|
||||
# in Firefox too -- no dedicated GUI viewer/editor is installed and vim is
|
||||
# terminal-only (no usable GUI .desktop for double-click handoff). Kept
|
||||
# minimal -- only the handlers actually present on these hosts.
|
||||
xdg.mimeApps = {
|
||||
enable = true;
|
||||
defaultApplications = {
|
||||
"text/html" = "firefox.desktop";
|
||||
"x-scheme-handler/http" = "firefox.desktop";
|
||||
"x-scheme-handler/https" = "firefox.desktop";
|
||||
"x-scheme-handler/about" = "firefox.desktop";
|
||||
"x-scheme-handler/unknown" = "firefox.desktop";
|
||||
"inode/directory" = "nemo.desktop";
|
||||
"image/png" = "firefox.desktop";
|
||||
"image/jpeg" = "firefox.desktop";
|
||||
"image/gif" = "firefox.desktop";
|
||||
"image/webp" = "firefox.desktop";
|
||||
"image/svg+xml" = "firefox.desktop";
|
||||
"application/pdf" = "firefox.desktop";
|
||||
"text/plain" = "firefox.desktop";
|
||||
};
|
||||
};
|
||||
|
||||
# Theme GTK apps (nemo, etc.) to match the Catppuccin Mocha desktop. Under
|
||||
# Sway there is no XSettings daemon, so GTK reads these from the generated
|
||||
# ~/.config/gtk-{3,4}.0/settings.ini directly. The Mocha theme is dark by
|
||||
@@ -65,7 +91,7 @@
|
||||
};
|
||||
|
||||
# Firefox is themed at the browser level (it does not follow the GTK theme).
|
||||
# The system installs the binary (programs.firefox in ../user.nix); here
|
||||
# The system installs the binary (programs.firefox in ../modules/users.nix); here
|
||||
# home-manager owns only the profile, hence package = null. Apply the
|
||||
# Catppuccin Mocha theme add-on (only the mauve accent is packaged upstream;
|
||||
# the rest of the desktop uses blue) and make content + UI dark.
|
||||
@@ -77,7 +103,7 @@
|
||||
# stateVersion<26.05 default-change warning (the new XDG path depends on
|
||||
# Firefox's own profile support).
|
||||
configPath = ".mozilla/firefox";
|
||||
profiles.${username} = {
|
||||
profiles.${identity.username} = {
|
||||
id = 0;
|
||||
isDefault = true;
|
||||
extensions = {
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
# Editor: Neovim via nixvim. Migrated from plain vim with feature parity (file
|
||||
# tree, indent guides, fugitive, tmux-navigator, Catppuccin Mocha, 2-space hard
|
||||
# tabs, Jenkinsfile=groovy) plus a real LSP stack in place of the inert ALE.
|
||||
# Wanted on every host; vi/vim/$EDITOR all launch nvim.
|
||||
{ inputs, pkgs, ... }:
|
||||
{
|
||||
imports = [ inputs.nixvim.homeModules.nixvim ];
|
||||
|
||||
programs.nixvim = {
|
||||
enable = true;
|
||||
viAlias = true;
|
||||
vimAlias = true;
|
||||
defaultEditor = true;
|
||||
|
||||
# Build against our (followed) nixpkgs; set explicitly so the module doesn't
|
||||
# warn that its pinned nixpkgs was overridden by the input `follows`.
|
||||
nixpkgs.source = inputs.nixpkgs;
|
||||
|
||||
# Formatter binaries for conform-nvim (below), matching the repo's treefmt
|
||||
# set. On nvim's PATH only.
|
||||
extraPackages = with pkgs; [
|
||||
nixfmt
|
||||
stylua
|
||||
ruff
|
||||
shfmt
|
||||
prettier
|
||||
gofumpt
|
||||
];
|
||||
|
||||
globals.mapleader = " ";
|
||||
|
||||
opts = {
|
||||
expandtab = false;
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
termguicolors = true;
|
||||
background = "dark";
|
||||
number = true;
|
||||
};
|
||||
|
||||
colorschemes.catppuccin = {
|
||||
enable = true;
|
||||
settings.flavour = "mocha";
|
||||
};
|
||||
|
||||
plugins = {
|
||||
nvim-tree.enable = true; # file explorer (was nerdtree)
|
||||
web-devicons.enable = true; # nvim-tree icons (explicit; else auto-enabled with a warning)
|
||||
indent-blankline.enable = true; # indent guides (was vim-indent-guides)
|
||||
fugitive.enable = true; # git (was vim-fugitive)
|
||||
tmux-navigator.enable = true; # Ctrl-h/j/k/l across vim splits and tmux panes
|
||||
|
||||
# Highlighting/indent — the Neovim-native replacement for `syntax enable`.
|
||||
treesitter = {
|
||||
enable = true;
|
||||
settings.ensure_installed = [
|
||||
"nix"
|
||||
"lua"
|
||||
"bash"
|
||||
"markdown"
|
||||
"groovy"
|
||||
"c_sharp" # C#
|
||||
"python"
|
||||
"terraform" # also covers HCL
|
||||
"yaml" # Helm chart templates/values
|
||||
];
|
||||
};
|
||||
|
||||
# LSP + completion, replacing the (inert) ALE.
|
||||
lsp = {
|
||||
enable = true;
|
||||
# Universal servers. Host-specific ones are enabled in their own module:
|
||||
# C# (omnisharp) and Helm (helm_ls) live in work.nix (EDaaS only).
|
||||
servers = {
|
||||
nil_ls.enable = true; # Nix
|
||||
lua_ls.enable = true; # Lua (editing this config)
|
||||
pyright.enable = true; # Python
|
||||
terraformls.enable = true; # Terraform
|
||||
};
|
||||
keymaps.lspBuf = {
|
||||
gd = "definition";
|
||||
gr = "references";
|
||||
K = "hover";
|
||||
"<leader>rn" = "rename";
|
||||
"<leader>ca" = "code_action";
|
||||
};
|
||||
};
|
||||
cmp = {
|
||||
enable = true;
|
||||
autoEnableSources = true;
|
||||
settings = {
|
||||
# nvim-cmp ships no default keymaps; without these the menu shows but
|
||||
# nothing accepts it. confirm uses select=false so a bare <CR> stays a
|
||||
# newline unless an entry is explicitly highlighted.
|
||||
mapping = {
|
||||
"<C-n>" = "cmp.mapping.select_next_item()";
|
||||
"<C-p>" = "cmp.mapping.select_prev_item()";
|
||||
"<Tab>" = "cmp.mapping.select_next_item()";
|
||||
"<S-Tab>" = "cmp.mapping.select_prev_item()";
|
||||
"<CR>" = "cmp.mapping.confirm({ select = false })";
|
||||
"<C-Space>" = "cmp.mapping.complete()";
|
||||
"<C-e>" = "cmp.mapping.abort()";
|
||||
};
|
||||
snippet.expand = "function(args) require('luasnip').lsp_expand(args.body) end";
|
||||
sources = [
|
||||
{ name = "nvim_lsp"; }
|
||||
{ name = "luasnip"; }
|
||||
{ name = "buffer"; }
|
||||
{ name = "path"; }
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
# Fuzzy finder (files / live grep / symbols); rg + fd are already on PATH.
|
||||
telescope = {
|
||||
enable = true;
|
||||
extensions.fzf-native.enable = true;
|
||||
};
|
||||
gitsigns.enable = true; # gutter signs, stage-hunk, blame
|
||||
which-key.enable = true; # popup of pending keybindings (leader is Space)
|
||||
trouble.enable = true; # project-wide diagnostics/quickfix list
|
||||
lualine = {
|
||||
enable = true;
|
||||
settings.options.theme = "catppuccin-mocha";
|
||||
};
|
||||
comment.enable = true; # gc / gcc comment toggling
|
||||
nvim-autopairs.enable = true;
|
||||
treesitter-textobjects.enable = true;
|
||||
luasnip.enable = true; # snippet engine (drives cmp's luasnip source above)
|
||||
|
||||
# Format-on-save, mirroring the repo's treefmt set. Filetypes with no
|
||||
# formatter here (e.g. terraform) fall back to the LSP formatter.
|
||||
conform-nvim = {
|
||||
enable = true;
|
||||
settings = {
|
||||
formatters_by_ft = {
|
||||
nix = [ "nixfmt" ];
|
||||
lua = [ "stylua" ];
|
||||
python = [ "ruff_format" ];
|
||||
sh = [ "shfmt" ];
|
||||
markdown = [ "prettier" ];
|
||||
go = [ "gofumpt" ];
|
||||
};
|
||||
format_on_save = {
|
||||
timeout_ms = 2000;
|
||||
lsp_format = "fallback";
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
keymaps = [
|
||||
{
|
||||
mode = "n";
|
||||
key = ",,";
|
||||
action = "<cmd>NvimTreeToggle<cr>";
|
||||
options.desc = "Toggle file tree";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>ff";
|
||||
action = "<cmd>Telescope find_files<cr>";
|
||||
options.desc = "Find files";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fg";
|
||||
action = "<cmd>Telescope live_grep<cr>";
|
||||
options.desc = "Live grep";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>fb";
|
||||
action = "<cmd>Telescope buffers<cr>";
|
||||
options.desc = "Buffers";
|
||||
}
|
||||
{
|
||||
mode = "n";
|
||||
key = "<leader>xx";
|
||||
action = "<cmd>Trouble diagnostics toggle<cr>";
|
||||
options.desc = "Diagnostics list";
|
||||
}
|
||||
];
|
||||
|
||||
# au BufNewFile,BufRead *Jenkinsfile setf groovy
|
||||
autoCmd = [
|
||||
{
|
||||
event = [
|
||||
"BufNewFile"
|
||||
"BufRead"
|
||||
];
|
||||
pattern = [ "*Jenkinsfile" ];
|
||||
command = "setf groovy";
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
+127
@@ -0,0 +1,127 @@
|
||||
# Version control: git + delta + commitizen + lazygit. Committer identity comes
|
||||
# from the per-user `identity` arg (the registry). See README "Users".
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
identity,
|
||||
...
|
||||
}:
|
||||
let
|
||||
ctp = import ../lib/catppuccin-mocha.nix;
|
||||
in
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.commitizen
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitFull;
|
||||
settings = {
|
||||
user.name = identity.fullName;
|
||||
# mkDefault so a host-specific module can still override it.
|
||||
user.email = lib.mkDefault identity.email;
|
||||
push.autoSetupRemote = true;
|
||||
init.defaultBranch = "main";
|
||||
|
||||
# Rebase-centric pulls (matches the "always a branch, linear history"
|
||||
# workflow); stash/restore and reorder fixups automatically.
|
||||
pull.rebase = true;
|
||||
rebase = {
|
||||
autoStash = true;
|
||||
autoSquash = true;
|
||||
};
|
||||
|
||||
fetch.prune = true; # drop deleted remote-tracking branches
|
||||
# Keep the commit-graph current (fast `git log --graph`, used by `lg`).
|
||||
fetch.writeCommitGraph = true;
|
||||
gc.writeCommitGraph = true;
|
||||
merge.conflictStyle = "zdiff3"; # show the common ancestor in conflicts
|
||||
diff = {
|
||||
algorithm = "histogram";
|
||||
colorMoved = "default";
|
||||
};
|
||||
rerere.enabled = true; # remember + replay conflict resolutions
|
||||
|
||||
# delta pager config (programs.delta is enabled below, with git
|
||||
# integration; these keys land under [delta] in the git config).
|
||||
# syntax-theme reuses the Catppuccin Mocha tmTheme vendored for bat in
|
||||
# shell.nix -- delta reads bat's theme directory.
|
||||
delta = {
|
||||
syntax-theme = "Catppuccin Mocha";
|
||||
navigate = true; # n/N to jump between diff hunks
|
||||
line-numbers = true;
|
||||
side-by-side = true;
|
||||
};
|
||||
commit.verbose = true; # full diff in the commit-message editor
|
||||
branch.sort = "-committerdate"; # most-recent branches first
|
||||
column.ui = "auto";
|
||||
help.autocorrect = "prompt";
|
||||
|
||||
alias = {
|
||||
st = "status";
|
||||
co = "checkout";
|
||||
sw = "switch";
|
||||
br = "branch";
|
||||
ci = "commit";
|
||||
last = "log -1 HEAD";
|
||||
unstage = "reset HEAD --";
|
||||
amend = "commit --amend --no-edit"; # tack staged changes onto HEAD
|
||||
fixup = "commit --fixup"; # `git fixup <sha>` -> autosquash on next rebase
|
||||
undo = "reset --soft HEAD~1"; # undo last commit, keep the changes staged
|
||||
lg = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all";
|
||||
# commitizen (Conventional Commits, its default ruleset): `git cz c` ->
|
||||
# `cz commit`, `git cz bump`, etc. `git cc` is a shortcut for the prompt.
|
||||
cz = "!cz";
|
||||
cc = "!cz commit";
|
||||
# Structural (syntax-aware) diff, on demand. Set per-invocation via the
|
||||
# environment rather than `diff.external`, which would also change what
|
||||
# `git show` and `git log -p --ext-diff` emit for every caller.
|
||||
# Takes the same arguments as `git diff`: `git dft HEAD~3 -- file`.
|
||||
dft = "!GIT_EXTERNAL_DIFF=difft git diff";
|
||||
};
|
||||
|
||||
# SSH signing, key from the registry. mkDefault so a host lacking the key
|
||||
# in its agent can set gpgsign = false instead of failing every commit.
|
||||
gpg.format = "ssh";
|
||||
user.signingkey = lib.mkDefault identity.signingKey;
|
||||
commit.gpgsign = lib.mkDefault true;
|
||||
tag.gpgsign = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# Global ignore file (~/.config/git/ignore).
|
||||
ignores = [
|
||||
"result"
|
||||
"result-*"
|
||||
".direnv"
|
||||
"*.swp"
|
||||
".DS_Store"
|
||||
];
|
||||
};
|
||||
|
||||
programs.delta = {
|
||||
enable = true;
|
||||
enableGitIntegration = true;
|
||||
};
|
||||
|
||||
# difftastic backs the `dft` alias above. git.enable stays off on purpose:
|
||||
# the module's git integration sets `diff.external`, which would displace
|
||||
# delta as the diff renderer everywhere instead of only where asked.
|
||||
programs.difftastic = {
|
||||
enable = true;
|
||||
git.enable = false;
|
||||
};
|
||||
|
||||
# lazygit: TUI for staging/rebasing, themed to Catppuccin Mocha to match.
|
||||
programs.lazygit = {
|
||||
enable = true;
|
||||
settings.gui.theme = {
|
||||
activeBorderColor = [
|
||||
"#${ctp.blue}"
|
||||
"bold"
|
||||
];
|
||||
inactiveBorderColor = [ "#${ctp.surface1}" ];
|
||||
selectedLineBgColor = [ "#${ctp.surface0}" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
# Headless Secret Service (org.freedesktop.secrets) on the user session bus,
|
||||
# for CLI tools that keep credentials in the system keychain rather than in a
|
||||
# config file of their own.
|
||||
#
|
||||
# Current consumer: gcx, the Grafana Cloud CLI (users/emmathorpe/work.nix). gcx
|
||||
# stores its OAuth access and refresh tokens in the keychain unconditionally --
|
||||
# its config file holds only opaque `keychain:gcx:v2:...` handles -- and offers
|
||||
# no plaintext fallback (there is no environment variable or config key to
|
||||
# select a file-backed store). With nothing owning org.freedesktop.secrets,
|
||||
# `gcx login` authenticates against Grafana successfully and then dies writing
|
||||
# its config: "The name is not activatable".
|
||||
#
|
||||
# home-manager already ships services.gnome-keyring, but it does not fit a
|
||||
# headless host on two counts:
|
||||
#
|
||||
# * it is WantedBy graphical-session-pre.target, which never activates
|
||||
# without a desktop session, so the service would simply never start; and
|
||||
# * it cannot unlock the login keyring (it passes no --unlock). An unlocked
|
||||
# collection is mandatory: writing to a locked one blocks on a GUI prompter
|
||||
# (gcr) that does not exist here, so the caller hangs rather than fails.
|
||||
#
|
||||
# Security posture, stated plainly: the login keyring is encrypted at rest, but
|
||||
# the password unlocking it is readable by the same user on the same machine.
|
||||
# That protects the tokens from something reading the keyring file directly; it
|
||||
# protects them from nothing already running as this user. It is the same
|
||||
# posture as the existing ~/.jenkinsenv and ~/.splunkenv token files, and it is
|
||||
# the price of unattended operation -- systemd --user timers start with no
|
||||
# human present to type a passphrase.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.services.headlessSecretService;
|
||||
|
||||
# Where the generated unlock password lives when no external passwordFile is
|
||||
# supplied. Under $XDG_DATA_HOME rather than the nix store, which is
|
||||
# world-readable.
|
||||
defaultPasswordFile = "${config.xdg.dataHome}/gnome-keyring/login-password";
|
||||
|
||||
passwordFile = if cfg.passwordFile != null then cfg.passwordFile else defaultPasswordFile;
|
||||
|
||||
keyringDaemon = pkgs.writeShellApplication {
|
||||
name = "headless-secret-service";
|
||||
runtimeInputs = [
|
||||
pkgs.gnome-keyring
|
||||
pkgs.coreutils
|
||||
];
|
||||
text = ''
|
||||
pwfile=${lib.escapeShellArg passwordFile}
|
||||
|
||||
if [ ! -s "$pwfile" ]; then
|
||||
echo "headless-secret-service: no keyring password at $pwfile" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# The daemon takes the whole of stdin as the password, so a trailing
|
||||
# newline would silently become part of it. Strip it, so a hand-written or
|
||||
# agenix-managed file unlocks the same keyring the generated one created.
|
||||
#
|
||||
# --components=secrets ONLY. The ssh component must stay off: it would
|
||||
# claim SSH_AUTH_SOCK and displace services.ssh-agent, breaking SSH auth
|
||||
# and signed commits. pkcs11 is not needed by anything here.
|
||||
tr -d '\n' <"$pwfile" |
|
||||
exec gnome-keyring-daemon --foreground --components=secrets --unlock
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
options.services.headlessSecretService = {
|
||||
enable = lib.mkEnableOption ''
|
||||
a headless gnome-keyring serving org.freedesktop.secrets on the user
|
||||
session bus, with the login keyring unlocked at service start'';
|
||||
|
||||
passwordFile = lib.mkOption {
|
||||
type = lib.types.nullOr lib.types.str;
|
||||
default = null;
|
||||
example = "/run/agenix/gnome-keyring-login";
|
||||
description = ''
|
||||
Path to a file holding the login keyring password. It is read at service
|
||||
start, not at build time, so it need not exist when the system is built
|
||||
-- this is the seam for an agenix-managed secret.
|
||||
|
||||
When null, a random 32-byte password is generated on first activation at
|
||||
${defaultPasswordFile} (mode 0600) and reused from then on.
|
||||
|
||||
Pointing this at a different file after the login keyring already exists
|
||||
does NOT re-key the keyring: the daemon will fail to unlock it. To
|
||||
change the password, delete ~/.local/share/keyrings and re-authenticate
|
||||
every tool that stored a secret there.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
# secret-tool, for inspecting or repairing the keyring by hand when a stored
|
||||
# credential misbehaves (`secret-tool search --all service gcx`).
|
||||
home.packages = [ pkgs.libsecret ];
|
||||
|
||||
# Generate the unlock password on first activation. Guarded on us owning it:
|
||||
# an externally supplied passwordFile is never created or written here.
|
||||
home.activation = lib.mkIf (cfg.passwordFile == null) {
|
||||
headlessSecretServicePassword = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
pwfile=${lib.escapeShellArg defaultPasswordFile}
|
||||
if [ ! -s "$pwfile" ]; then
|
||||
run mkdir -p "$(dirname "$pwfile")"
|
||||
# Create the file empty at 0600 first, then fill it: the redirect
|
||||
# keeps the existing mode, so the password is never briefly readable.
|
||||
run install -m 600 /dev/null "$pwfile"
|
||||
run ${pkgs.bash}/bin/sh -c \
|
||||
'head -c 32 /dev/urandom | base64 -w0 > "$1"' sh "$pwfile"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
|
||||
systemd.user.services.headless-secret-service = {
|
||||
Unit = {
|
||||
Description = "GNOME Keyring (Secret Service, headless)";
|
||||
Documentation = "man:gnome-keyring-daemon(1)";
|
||||
# The daemon claims its name on the user session bus.
|
||||
Requires = [ "dbus.socket" ];
|
||||
After = [ "dbus.socket" ];
|
||||
};
|
||||
|
||||
Service = {
|
||||
Type = "simple";
|
||||
ExecStart = lib.getExe keyringDaemon;
|
||||
Restart = "on-failure";
|
||||
RestartSec = 2;
|
||||
};
|
||||
|
||||
# default.target, not graphical-session-pre.target: there is no graphical
|
||||
# session on this host. With `linger` enabled (see the host table in
|
||||
# flake.nix) default.target is reached at boot, so the keyring is also up
|
||||
# for unattended systemd --user timers, not just interactive logins.
|
||||
Install.WantedBy = [ "default.target" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
+506
@@ -0,0 +1,506 @@
|
||||
# Interactive shell: zsh + tmux. Wanted on every host.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# Shared Catppuccin Mocha palette: raw 6-hex strings, no leading "#".
|
||||
ctp = import ../lib/catppuccin-mocha.nix;
|
||||
in
|
||||
{
|
||||
imports = [
|
||||
# Prebuilt nix-index database -> working command-not-found
|
||||
# ("cmd not found -> which nix package provides it"), no manual indexing.
|
||||
inputs.nix-index-database.homeModules.default
|
||||
];
|
||||
|
||||
# CLI staples wanted on every host (search, parse, monitor). ripgrep/fd also
|
||||
# back fzf and editor integrations; tea is the Gitea CLI for code.emmathe.dev.
|
||||
home.packages = [
|
||||
pkgs.ripgrep
|
||||
pkgs.fd
|
||||
pkgs.jq
|
||||
pkgs.tea
|
||||
pkgs.hyperfine # command-line benchmarking
|
||||
pkgs.sd # saner find-and-replace than sed
|
||||
|
||||
# Replacements for the classic coreutils/BSD tools. Only the read-only ones
|
||||
# are aliased over the original name (see shellAliases below); the rest keep
|
||||
# their own name so nothing changes shape under a script's feet. The alias
|
||||
# map and the flag-compatibility differences are documented in
|
||||
# ../docs/shell.md, "Replacing the classics".
|
||||
pkgs.dust # du: tree-shaped, size-sorted disk usage
|
||||
pkgs.dysk # df: mounted filesystems (duf is unmaintained upstream)
|
||||
pkgs.procs # ps: process list with tree, ports and container columns
|
||||
pkgs.trash-cli # rm: XDG trash; `trash` / `trash-list` / `trash-restore`
|
||||
pkgs.doggo # dig: DNS lookups
|
||||
pkgs.xh # curl, for interactive HTTP poking (curl stays for scripts)
|
||||
pkgs.ouch # tar/unzip/7z/zstd: one command for every archive format
|
||||
pkgs.jnv # interactive jq filter builder (jq itself stays for scripts)
|
||||
pkgs.hexyl # hex viewer
|
||||
pkgs.fq # jq for binary formats
|
||||
];
|
||||
|
||||
# tldr pages: worked examples for a command, next to (not instead of) man.
|
||||
# enableAutoUpdates defaults on and installs a tldr-update user timer, which
|
||||
# keeps the page cache fresh -- without it `tldr` fails until first `--update`.
|
||||
programs.tealdeer = {
|
||||
enable = true;
|
||||
settings.display.compact = true;
|
||||
};
|
||||
|
||||
# Resource monitor, themed Catppuccin Mocha to match the rest of the desktop.
|
||||
# btop does not bundle the theme, so vendor it from catppuccin/btop (pinned).
|
||||
programs.btop = {
|
||||
enable = true;
|
||||
settings.color_theme = "catppuccin_mocha";
|
||||
};
|
||||
xdg.configFile."btop/themes/catppuccin_mocha.theme".source = pkgs.fetchurl {
|
||||
url = "https://raw.githubusercontent.com/catppuccin/btop/f437574b600f1c6d932627050b15ff5153b58fa3/themes/catppuccin_mocha.theme";
|
||||
hash = "sha256-THRpq5vaKCwf9gaso3ycC4TNDLZtBB5Ofh/tOXkfRkQ=";
|
||||
};
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
# Keep zsh dotfiles under XDG (~/.config/zsh) rather than the legacy $HOME
|
||||
# layout, matching xdg.enable. history.path is pinned below so the existing
|
||||
# ~/.zsh_history is reused, not orphaned by the dotDir move.
|
||||
dotDir = "${config.xdg.configHome}/zsh";
|
||||
enableCompletion = true;
|
||||
enableVteIntegration = true;
|
||||
autosuggestion.enable = true;
|
||||
# Bind Up/Down for history-substring-search in BOTH cursor-key modes: CSI
|
||||
# (^[[A/^[[B -- normal mode, and what the Linux TTY sends) and SS3
|
||||
# (^[OA/^[OB -- application mode, used by foot, tmux and iTerm2). Binding
|
||||
# only the default CSI form leaves it dead at the prompt in foot/iTerm2.
|
||||
historySubstringSearch = {
|
||||
enable = true;
|
||||
searchUpKey = [
|
||||
"^[[A"
|
||||
"^[OA"
|
||||
];
|
||||
searchDownKey = [
|
||||
"^[[B"
|
||||
"^[OB"
|
||||
];
|
||||
};
|
||||
history = {
|
||||
# Stay at the legacy ~/.zsh_history (default would follow dotDir into
|
||||
# ~/.config/zsh and orphan the existing file). Keeps history intact.
|
||||
path = "${config.home.homeDirectory}/.zsh_history";
|
||||
append = true; # append, don't overwrite, on shell exit
|
||||
size = 100000; # in-memory (HISTSIZE)
|
||||
save = 100000; # on-disk (SAVEHIST)
|
||||
ignoreDups = true; # drop consecutive duplicates
|
||||
ignoreSpace = true; # leading-space commands stay out of history
|
||||
expireDuplicatesFirst = true;
|
||||
share = true; # live-share history across sessions
|
||||
extended = true; # record timestamps
|
||||
};
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"git"
|
||||
"man"
|
||||
"sudo" # double-Esc prefixes the last command with sudo
|
||||
"colored-man-pages"
|
||||
"extract" # `extract <archive>` for any format
|
||||
];
|
||||
theme = "robbyrussell";
|
||||
};
|
||||
syntaxHighlighting.enable = true;
|
||||
initContent = lib.mkMerge [
|
||||
# Auto-start tmux in every interactive terminal -- foot, iTerm2, the WSL
|
||||
# shell, the Linux console -- so a new terminal lands straight in the
|
||||
# multiplexer (session "main": attach if present, else create). Panes run
|
||||
# a plain non-login zsh (tmux's default-command "${SHELL}"). Order 200
|
||||
# runs before oh-my-zsh/compinit so the exec replaces the shell before
|
||||
# that setup is wasted. Guards, each preventing a real breakage:
|
||||
# interactive only -> don't hijack scp / `ssh host cmd` / scripted shells
|
||||
# stdout is a tty -> VS Code (macOS) resolves the shell environment on
|
||||
# startup by running an interactive login shell with
|
||||
# stdout piped, no controlling terminal. Without this
|
||||
# guard `exec tmux` runs there, fails ("open terminal
|
||||
# failed: not a terminal"), exits non-zero, and VS
|
||||
# Code reports "Unable to resolve your shell
|
||||
# environment". A real terminal always has a tty here.
|
||||
# not VS Code env -> also skip VS Code's env-resolution probe explicitly,
|
||||
# in case a future version allocates a pty for it.
|
||||
# $TMUX empty -> a pane's zsh won't re-exec tmux (infinite loop)
|
||||
# not SSH -> don't force inbound SSH logins into a server tmux
|
||||
# not VS Code -> its integrated terminal manages itself
|
||||
# tmux on PATH -> a failed exec would otherwise kill the login shell
|
||||
# $NO_TMUX unset -> escape hatch: `NO_TMUX=1 <term>` opens a bare shell
|
||||
(lib.mkOrder 200 ''
|
||||
if [[ $- == *i* ]] \
|
||||
&& [[ -t 1 ]] \
|
||||
&& [[ -z "$VSCODE_RESOLVING_ENVIRONMENT" ]] \
|
||||
&& [[ -z "$TMUX" ]] \
|
||||
&& [[ -z "$NO_TMUX" ]] \
|
||||
&& [[ -z "$SSH_CONNECTION" && -z "$SSH_TTY" ]] \
|
||||
&& [[ "$TERM_PROGRAM" != "vscode" ]] \
|
||||
&& command -v tmux >/dev/null 2>&1; then
|
||||
exec tmux new-session -A -s main
|
||||
fi
|
||||
'')
|
||||
# Prefix the prompt with the hostname over SSH (mkAfter).
|
||||
(lib.mkOrder 1500 ''
|
||||
if [ "$SSH_CLIENT" ] || [ "$SSH_TTY" ]; then
|
||||
export PS1="%M $PS1"
|
||||
fi
|
||||
'')
|
||||
];
|
||||
shellAliases = {
|
||||
# eza's zsh integration also defines these; set explicitly so the
|
||||
# icons/git intent is obvious.
|
||||
ls = "eza --icons --git";
|
||||
ll = "eza --icons --git -l";
|
||||
la = "eza --icons --git -la";
|
||||
lt = "eza --icons --git --tree";
|
||||
cls = "clear";
|
||||
|
||||
# Shadow the classics with their modern equivalents. Only read-only
|
||||
# commands are shadowed: a wrong flag costs a retype, never data. The
|
||||
# flag vocabularies are NOT compatible (`du -sh`, `df -h`, `ps aux` all
|
||||
# fail here) -- see ../docs/shell.md, "Replacing the classics".
|
||||
#
|
||||
# Blast radius is bounded by where these live: shellAliases lands in
|
||||
# .zshrc, so only interactive zsh sees them. Scripts, `sudo <cmd>` and
|
||||
# anything exec'd by another program still get the real binary. To reach
|
||||
# the original in an interactive shell: `command du` or `\du`.
|
||||
cat = "bat --paging=never"; # bat is already the PAGER/MANPAGER
|
||||
du = "dust";
|
||||
df = "dysk";
|
||||
ps = "procs";
|
||||
|
||||
# `rm` is deliberately NOT aliased to trash-put. Retraining `rm` to mean
|
||||
# "recoverable" is a habit that follows you onto machines where it does
|
||||
# not (every remote host, every root shell, every container), and trash
|
||||
# semantics break down anyway on a different filesystem or on
|
||||
# root-owned paths. Type `trash` when you want a trash can.
|
||||
};
|
||||
};
|
||||
|
||||
# Fuzzy finder: Ctrl-R fuzzy history, Ctrl-T files, Alt-C cd.
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
# Catppuccin Mocha colours (rendered into FZF_DEFAULT_OPTS --color). Each
|
||||
# value needs a leading "#"; the palette stores raw hex.
|
||||
colors = {
|
||||
"bg" = "#${ctp.base}";
|
||||
"bg+" = "#${ctp.surface1}"; # current line / selected row
|
||||
"fg" = "#${ctp.text}";
|
||||
"fg+" = "#${ctp.text}";
|
||||
"hl" = "#${ctp.blue}"; # match highlights
|
||||
"hl+" = "#${ctp.blue}";
|
||||
"header" = "#${ctp.red}";
|
||||
"info" = "#${ctp.mauve}";
|
||||
"marker" = "#${ctp.green}";
|
||||
"pointer" = "#${ctp.pink}";
|
||||
"prompt" = "#${ctp.mauve}";
|
||||
"spinner" = "#${ctp.pink}";
|
||||
"border" = "#${ctp.surface1}";
|
||||
};
|
||||
};
|
||||
|
||||
# Frecency directory jumping: `z <fragment>`.
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
# Per-project environments auto-loaded on cd, with the Nix dev-shell cache.
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
# Modern ls (drives the ls aliases above).
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
git = true;
|
||||
icons = "auto"; # boolean form is deprecated
|
||||
};
|
||||
|
||||
# Syntax-highlighting pager, used as `bat` (acts like cat when piped). bat
|
||||
# ships no Catppuccin theme, so vendor the upstream tmTheme from catppuccin/bat
|
||||
# (delta in git.nix reuses it as its syntax-theme).
|
||||
programs.bat = {
|
||||
enable = true;
|
||||
config.theme = "Catppuccin Mocha";
|
||||
themes."Catppuccin Mocha" = {
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "catppuccin";
|
||||
repo = "bat";
|
||||
rev = "6810349b28055dce54076712fc05fc68da4b8ec0";
|
||||
sha256 = "1y5sfi7jfr97z1g6vm2mzbsw59j1jizwlmbadvmx842m0i5ak5ll";
|
||||
};
|
||||
file = "themes/Catppuccin Mocha.tmTheme";
|
||||
};
|
||||
};
|
||||
|
||||
# command-not-found backed by the prebuilt nix-index DB (module imported
|
||||
# above). `comma` runs an uninstalled program once: `, cowsay hi`.
|
||||
programs.nix-index.enable = true;
|
||||
programs.nix-index-database.comma.enable = true;
|
||||
|
||||
# Nicer nixos-rebuild/home-manager (diffs) + $NH_FLAKE. No automatic clean:
|
||||
# the scheduled GC's only benefit is reclaiming disk, but it can reap store
|
||||
# paths the current generation still references (notably on nix-darwin, where
|
||||
# it broke completion by removing an in-use oh-my-zsh). GC manually instead:
|
||||
# `nh clean all` / `nix-collect-garbage -d` when nothing important is running.
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = "$HOME/code/nixfiles";
|
||||
};
|
||||
|
||||
# GitHub CLI. `programs.gh.settings` is deliberately unset: home-manager renders
|
||||
# ~/.config/gh/config.yml as a read-only /nix/store symlink whenever the module
|
||||
# is enabled, but gh must rewrite that file on `gh auth login` and `gh config
|
||||
# set`, which then fail with a permission error. Suppress the managed config.yml
|
||||
# (below) and let gh own it. The token lives in hosts.yml, which is never
|
||||
# Nix-managed. Set the SSH protocol once at runtime: `gh config set git_protocol
|
||||
# ssh` (it can't be declarative here without recreating the immutable file).
|
||||
programs.gh.enable = true;
|
||||
xdg.configFile."gh/config.yml".enable = lib.mkForce false;
|
||||
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
reverseSplit = true;
|
||||
# tmux-256color (not tmux-direct): the standard inside-tmux terminfo.
|
||||
# tmux-direct's capabilities desync zsh's line redraw on some terminals
|
||||
# (e.g. iTerm2 -> duplicated chars on Tab, stray newlines). Truecolor is
|
||||
# advertised per outer terminal via the RGB terminal-features below.
|
||||
terminal = "tmux-256color";
|
||||
newSession = true;
|
||||
keyMode = "vi";
|
||||
historyLimit = 500000;
|
||||
mouse = true;
|
||||
escapeTime = 10; # was the 500ms default -> laggy ESC in vim
|
||||
focusEvents = true; # let vim see focus changes (autoread)
|
||||
baseIndex = 1; # sets both base-index and pane-base-index
|
||||
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
sensible
|
||||
vim-tmux-navigator # Ctrl-h/j/k/l across vim splits and tmux panes
|
||||
{
|
||||
# On WSL, tmux-yank pipes the selection to clip.exe, which decodes its
|
||||
# stdin as the OEM codepage instead of UTF-8 -- an em dash reaches the
|
||||
# Windows clipboard as three characters. Route through tmux's own
|
||||
# buffer instead: with set-clipboard on, tmux emits OSC 52 and the
|
||||
# terminal takes the text as UTF-8. Windows Terminal honours OSC 52;
|
||||
# iTerm2 does not by default, hence the runtime guard rather than
|
||||
# overriding pbcopy/xsel on every host. yank.tmux bakes the command
|
||||
# into its key bindings when it loads, so this must be set first, which
|
||||
# is what plugin extraConfig gives us.
|
||||
plugin = yank;
|
||||
extraConfig = ''
|
||||
if-shell 'grep -qi microsoft /proc/version 2>/dev/null' \
|
||||
"set -g @override_copy_command 'tmux load-buffer -w -'"
|
||||
'';
|
||||
}
|
||||
extrakto # prefix+Tab: fzf-grab paths/URLs/text from the pane into the prompt
|
||||
{
|
||||
# Catppuccin Mocha statusline (v2 API: flavour + window options must be
|
||||
# set before the plugin loads, which home-manager does for plugin
|
||||
# extraConfig; the status modules below go in the main extraConfig,
|
||||
# which HM appends after all plugins).
|
||||
plugin = catppuccin;
|
||||
extraConfig = ''
|
||||
set -g @catppuccin_flavor 'mocha'
|
||||
set -g @catppuccin_window_status_style 'rounded'
|
||||
# Catppuccin's default window text is #T, the pane title, which every
|
||||
# program in the pane is free to overwrite -- the shell writes the
|
||||
# hostname, Claude Code writes its current task, and a hand-set window
|
||||
# name never appears. Show the window name instead, falling back to the
|
||||
# pane title when the window holds a single pane and the two carry the
|
||||
# same information anyway.
|
||||
set -g @catppuccin_window_text ' #{?#{==:#{window_panes},1},#T,#W}'
|
||||
set -g @catppuccin_window_current_text ' #{?#{==:#{window_panes},1},#T,#W}'
|
||||
'';
|
||||
}
|
||||
resurrect # save/restore sessions
|
||||
{
|
||||
plugin = continuum; # auto-save + restore on tmux start (after resurrect)
|
||||
extraConfig = ''
|
||||
set -g @continuum-restore 'on'
|
||||
'';
|
||||
}
|
||||
];
|
||||
# `reverseSplit = true` already binds s -> vertical and v -> horizontal
|
||||
# split (the dotfiles' vim-style splits).
|
||||
extraConfig = ''
|
||||
# Run a non-login shell in new panes/windows.
|
||||
set -g default-command "''${SHELL}"
|
||||
|
||||
# Drop the stock split keys in favour of the s/v binds above.
|
||||
unbind %
|
||||
unbind '"'
|
||||
|
||||
# Alt+Arrow pane navigation
|
||||
bind -n M-Left select-pane -L
|
||||
bind -n M-Right select-pane -R
|
||||
bind -n M-Up select-pane -U
|
||||
bind -n M-Down select-pane -D
|
||||
|
||||
# Truecolor for the outer terminals (foot reports xterm-ish too; iTerm2 is
|
||||
# xterm-256color). Without this, with tmux-256color as default-terminal,
|
||||
# 24-bit colour would be quantised to 256.
|
||||
set -as terminal-features ",xterm-256color:RGB"
|
||||
# Tell tmux which capabilities the foot terminal supports, so truecolor,
|
||||
# synchronised output, the system clipboard (OSC 52), window titles and
|
||||
# cursor styling all pass through.
|
||||
set -as terminal-features ",foot*:RGB"
|
||||
set -as terminal-features ",foot*:sync"
|
||||
set -as terminal-features ",foot*:clipboard"
|
||||
set -as terminal-features ",foot*:title"
|
||||
set -as terminal-features ",foot*:ccolour"
|
||||
set -as terminal-features ",foot*:cstyle"
|
||||
|
||||
# No home-manager options for these.
|
||||
set -g renumber-windows on
|
||||
set -g set-clipboard on
|
||||
|
||||
# Pane titles on the border, but only once a window is split -- a single
|
||||
# pane's title is already in the status bar. pane-border-status takes no
|
||||
# format, so the hook recomputes it whenever the layout changes, which
|
||||
# covers both splitting and closing a pane.
|
||||
set -g pane-border-format " #P #{pane_title} "
|
||||
set -g pane-border-status off
|
||||
set-hook -g window-layout-changed 'set -Fw pane-border-status "#{?#{>:#{window_panes},1},top,off}"'
|
||||
|
||||
# Pane titles have no default binding.
|
||||
bind T command-prompt -p "pane title:" "select-pane -T '%%'"
|
||||
|
||||
# Catppuccin v2 statusline. Must run after the plugin has loaded;
|
||||
# home-manager appends this extraConfig after the whole plugin list.
|
||||
set -g status-left-length 100
|
||||
set -g status-right-length 100
|
||||
set -g status-left ""
|
||||
set -g status-right "#{E:@catppuccin_status_application}"
|
||||
set -ag status-right "#{E:@catppuccin_status_session}"
|
||||
'';
|
||||
};
|
||||
|
||||
# Add the key to the agent on first use, so the passphrase is typed once per
|
||||
# login session rather than per commit/push (commit signing uses this agent).
|
||||
# The work box keeps its own ssh config (see work.nix), so this only
|
||||
# manages ~/.ssh/config on the personal hosts.
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
# The module's built-in default "*" block is being deprecated; opt out and
|
||||
# carry the defaults we want ourselves under settings."*".
|
||||
enableDefaultConfig = false;
|
||||
settings = {
|
||||
# Global defaults (rendered last, as ssh_config wants). AddKeysToAgent
|
||||
# adds the key on first use so the passphrase is typed once per session.
|
||||
"*" = {
|
||||
AddKeysToAgent = "yes";
|
||||
ForwardAgent = false;
|
||||
Compression = false;
|
||||
ServerAliveInterval = 0;
|
||||
ServerAliveCountMax = 3;
|
||||
HashKnownHosts = false;
|
||||
UserKnownHostsFile = "~/.ssh/known_hosts";
|
||||
ControlMaster = "no";
|
||||
ControlPath = "~/.ssh/master-%r@%n:%p";
|
||||
ControlPersist = "no";
|
||||
}
|
||||
# macOS: also cache the passphrase in the login keychain. UseKeychain
|
||||
# exists only in Apple's ssh; nixpkgs' openssh (which may be the `ssh` on
|
||||
# PATH) rejects it as "Bad configuration option". IgnoreUnknown (emitted
|
||||
# first by the module) makes any non-Apple ssh skip it instead of erroring,
|
||||
# while Apple's ssh still honours it. Darwin-only.
|
||||
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
|
||||
IgnoreUnknown = "UseKeychain";
|
||||
UseKeychain = "yes";
|
||||
};
|
||||
# Gitea remote (the flake's origin) -- required on every host. HostName
|
||||
# pins the IP so it resolves without DNS. Port 30009 is non-default; pin
|
||||
# the dedicated key (identitiesOnly avoids "too many authentication
|
||||
# failures" when the agent holds several keys).
|
||||
"code.emmathe.dev" = {
|
||||
HostName = "10.187.1.76";
|
||||
User = "git";
|
||||
Port = 30009;
|
||||
IdentityFile = "~/.ssh/code.emmathe.dev";
|
||||
IdentitiesOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Run a user ssh-agent on Linux (macOS provides one via launchd). EDaaS also
|
||||
# enables this in the work module; both being true merges cleanly.
|
||||
services.ssh-agent.enable = lib.mkIf pkgs.stdenv.hostPlatform.isLinux true;
|
||||
|
||||
# Classic process viewer (complements btop). htop has no custom-theme support
|
||||
# -- only a handful of built-in color schemes -- so it can't be hex-themed like
|
||||
# btop/bat/fzf. color_scheme = 0 (Default) draws from the terminal's ANSI
|
||||
# palette, which is Catppuccin Mocha (foot/iTerm2), so it matches by deferring
|
||||
# to the terminal rather than vendoring a theme.
|
||||
programs.htop = {
|
||||
enable = true;
|
||||
settings = {
|
||||
color_scheme = 0; # Default -> uses the terminal's Catppuccin palette
|
||||
delay = 15; # refresh every 1.5s
|
||||
cpu_count_from_one = 1;
|
||||
show_cpu_frequency = 1;
|
||||
show_cpu_usage = 1; # per-core usage shown in the CPU bars
|
||||
highlight_base_name = 1; # highlight the program name within the path
|
||||
highlight_megabytes = 1;
|
||||
highlight_threads = 1;
|
||||
hide_kernel_threads = 1;
|
||||
show_program_path = 0; # show just the command, not the full path
|
||||
tree_view = 1; # start in process-tree mode
|
||||
tree_view_always_by_pid = 0;
|
||||
account_guest_in_cpu_meter = 0;
|
||||
fields = with config.lib.htop.fields; [
|
||||
PID
|
||||
USER
|
||||
PRIORITY
|
||||
NICE
|
||||
M_SIZE
|
||||
M_RESIDENT
|
||||
M_SHARE
|
||||
STATE
|
||||
PERCENT_CPU
|
||||
PERCENT_MEM
|
||||
TIME
|
||||
COMM
|
||||
];
|
||||
}
|
||||
// (
|
||||
with config.lib.htop;
|
||||
leftMeters [
|
||||
(bar "AllCPUs2")
|
||||
(bar "Memory")
|
||||
(bar "Swap")
|
||||
]
|
||||
)
|
||||
// (
|
||||
with config.lib.htop;
|
||||
rightMeters [
|
||||
(text "Tasks")
|
||||
(text "LoadAverage")
|
||||
(text "Uptime")
|
||||
]
|
||||
);
|
||||
};
|
||||
|
||||
# Drop the zsh completion dump on every activation. A stale .zcompdump caches
|
||||
# /nix/store paths to completion functions; once a rebuild or a manual GC
|
||||
# removes them, compinit fails with "_git: function definition file not found"
|
||||
# for every completion. Deleting it forces a fresh rebuild from the current
|
||||
# fpath on the next shell. compinit dumps to $ZDOTDIR (~/.config/zsh now); the
|
||||
# $HOME and cache paths are also swept to clear any legacy leftovers.
|
||||
home.activation.resetZcompdump = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
$DRY_RUN_CMD rm -f \
|
||||
"${config.xdg.configHome}"/zsh/.zcompdump* \
|
||||
"$HOME"/.zcompdump* \
|
||||
"''${XDG_CACHE_HOME:-$HOME/.cache}"/zsh/.zcompdump* 2>/dev/null || true
|
||||
'';
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
# Declarative Sway window manager, status bar, lock, idle and notifications.
|
||||
# Imported via ./desktop.nix, so only graphical hosts get it.
|
||||
#
|
||||
# The compositor binary, PAM and polkit integration come from the system-level
|
||||
# programs.sway (see ../swaywm.nix); package = null below reuses it instead of
|
||||
# pulling a second Sway. home-manager owns the user config (~/.config/sway) and
|
||||
# wires the systemd user session (sway-session.target), which is what lets the
|
||||
# swayidle/dunst user services start with the desktop.
|
||||
# The compositor binary, PAM and the polkit *daemon* come from the system-level
|
||||
# programs.sway (see ../modules/sway.nix); package = null below reuses it instead of
|
||||
# pulling a second Sway. The polkit authentication *agent* (the thing that draws
|
||||
# the GUI auth dialog) is a user service started here. home-manager owns the user
|
||||
# config (~/.config/sway) and wires the systemd user session (sway-session.target),
|
||||
# which is what lets the agent/swayidle/dunst/kanshi user services start with the
|
||||
# desktop.
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
@@ -18,7 +20,7 @@ let
|
||||
# Catppuccin Mocha (shared with the ReGreet greeter). Raw hex; prefix "#"
|
||||
# where a consumer needs it -- Sway/i3status/dunst want "#", foot/swaylock do
|
||||
# not.
|
||||
ctp = import ../catppuccin-mocha.nix;
|
||||
ctp = import ../lib/catppuccin-mocha.nix;
|
||||
|
||||
# Focused-window screenshot -> swappy editor (the dotfiles' grimshot.sh logic).
|
||||
# Full store paths so it needs nothing on PATH.
|
||||
@@ -99,6 +101,16 @@ in
|
||||
criteria.app_id = "launcher";
|
||||
command = "floating enable, resize set 800 500";
|
||||
}
|
||||
# Don't let swayidle blank/lock during fullscreen video. Two rules cover
|
||||
# native Wayland (app_id) and XWayland (class) clients.
|
||||
{
|
||||
criteria.app_id = ".*";
|
||||
command = "inhibit_idle fullscreen";
|
||||
}
|
||||
{
|
||||
criteria.class = ".*";
|
||||
command = "inhibit_idle fullscreen";
|
||||
}
|
||||
];
|
||||
|
||||
# Binding modes (submenus). Entered from keybindings below; each action
|
||||
@@ -277,6 +289,63 @@ in
|
||||
# an old entry through fuzzel.
|
||||
services.clipman.enable = true;
|
||||
|
||||
# Polkit authentication agent. programs.sway (system) enables the polkit
|
||||
# daemon but no agent, so GUI privilege prompts (nemo mounting a disk,
|
||||
# NetworkManager/blueman editing a system resource) would otherwise fail
|
||||
# silently. lxqt-policykit is a small, toolkit-light agent; bind it to the
|
||||
# Sway session so it starts and stops with the desktop.
|
||||
systemd.user.services.polkit-lxqt = {
|
||||
Unit = {
|
||||
Description = "lxqt-policykit polkit authentication agent";
|
||||
PartOf = [ "graphical-session.target" ];
|
||||
After = [ "graphical-session.target" ];
|
||||
};
|
||||
Service = {
|
||||
ExecStart = "${pkgs.lxqt.lxqt-policykit}/bin/lxqt-policykit-agent";
|
||||
Restart = "on-failure";
|
||||
};
|
||||
Install.WantedBy = [ "sway-session.target" ];
|
||||
};
|
||||
|
||||
# Output/display management. Reacts to hotplug and applies per-display
|
||||
# mode/scale/position. Profiles are hardware-specific: the safe default below
|
||||
# just enables the internal laptop panel; add docked/desktop profiles with the
|
||||
# real identifiers from `swaymsg -t get_outputs` (e.g. the Mac Pro's Apple
|
||||
# Cinema Display with its scale, or a docked laptop + external monitor).
|
||||
services.kanshi = {
|
||||
enable = true;
|
||||
settings = [
|
||||
{
|
||||
profile.name = "undocked";
|
||||
profile.outputs = [
|
||||
{
|
||||
criteria = "eDP-1";
|
||||
status = "enable";
|
||||
}
|
||||
];
|
||||
}
|
||||
# Example to copy per host (fill in real criteria/mode/scale/position):
|
||||
# {
|
||||
# profile.name = "desktop";
|
||||
# profile.outputs = [
|
||||
# { criteria = "Apple Computer Inc Cinema HD ..."; mode = "2560x1600"; scale = 1.0; position = "0,0"; status = "enable"; }
|
||||
# ];
|
||||
# }
|
||||
];
|
||||
};
|
||||
|
||||
# Night light. Manual location (no geoclue dependency); warmer at night,
|
||||
# neutral by day. Coordinates come from the per-user module (e.g.
|
||||
# users/lyrathorpe/home.nix), not this shared module.
|
||||
services.gammastep = {
|
||||
enable = true;
|
||||
provider = "manual";
|
||||
temperature = {
|
||||
day = 6500;
|
||||
night = 3700;
|
||||
};
|
||||
};
|
||||
|
||||
# fuzzel: the dmenu picker used by clipman, themed Catppuccin Mocha to match
|
||||
# (fuzzel colours are RRGGBBAA -- 8 hex digits).
|
||||
programs.fuzzel = {
|
||||
@@ -0,0 +1,36 @@
|
||||
# Living-room games machine: 4th-gen Core i7 (Haswell) on a UEFI board, wired to
|
||||
# a television and driven from the sofa with a Bluetooth controller. Desktop host
|
||||
# -- shared graphical/wired options live in ../../modules/desktop.nix; only
|
||||
# host-specific settings are here. The games stack (Steam session, RetroArch,
|
||||
# controllers) is in ./gaming.nix and the GPU in ./nvidia.nix. Install notes:
|
||||
# see ../../docs/hosts/console.md.
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./nvidia.nix
|
||||
./gaming.nix
|
||||
];
|
||||
|
||||
# Haswell: AVX2/FMA/BMI2, i.e. x86-64-v3. Above the fleet default (2), so this
|
||||
# only records the fact -- no feature flag currently keys off level 3.
|
||||
features.cpu.microarchLevel = 3;
|
||||
|
||||
# Ordinary PC UEFI firmware: systemd-boot, and NVRAM writes are safe here
|
||||
# (unlike the Mac Pro's Apple EFI, which cannot be trusted with efibootmgr).
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
# The boot menu is unreadable from a sofa and unusable without a keyboard.
|
||||
# Boot the default immediately; hold space at power-on to get the menu back.
|
||||
boot.loader.timeout = 0;
|
||||
# Bound the entry list so the ESP does not fill up with old generations.
|
||||
boot.loader.systemd-boot.configurationLimit = 10;
|
||||
|
||||
networking.hostName = "Console-NixOS";
|
||||
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
# See `man configuration.nix` / the stateVersion docs before changing.
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
# The games stack for the living-room machine: the Steam session that the TV
|
||||
# boots into, RetroArch with its cores, Clone Hero, and the controller plumbing.
|
||||
#
|
||||
# Session model. greetd (from ../../modules/sway.nix, which enables it for
|
||||
# ReGreet) gets an `initial_session`, so the machine autologins into the
|
||||
# gamescope Steam session at boot -- no keyboard, no greeter, straight to Big
|
||||
# Picture. Quitting Steam drops back to greetd's `default_session`, i.e. ReGreet,
|
||||
# where the ordinary Sway session can be picked for keyboard-and-mouse work.
|
||||
{ pkgs, ... }:
|
||||
|
||||
let
|
||||
# The account the television autologins as. Must match the user declared for
|
||||
# this host in the flake host table.
|
||||
tvUser = "lyrathorpe";
|
||||
|
||||
# Games library root. Deliberately outside any home directory: content is
|
||||
# bulky, is the thing most likely to move to its own disk, and is shared
|
||||
# between Steam, RetroArch and Clone Hero rather than owned by one of them.
|
||||
# Mounting a second drive at this path is the only change that needs.
|
||||
gamesRoot = "/srv/games";
|
||||
|
||||
# One ROM directory per emulated system. Names follow the libretro/ES-DE
|
||||
# convention so a scraper or a second frontend recognises them without
|
||||
# renaming anything.
|
||||
romSystems = [
|
||||
"nes"
|
||||
"snes"
|
||||
"gb"
|
||||
"gbc"
|
||||
"gba"
|
||||
"n64"
|
||||
"nds"
|
||||
"gc"
|
||||
"wii"
|
||||
"mastersystem"
|
||||
"gamegear"
|
||||
"megadrive"
|
||||
"sega32x"
|
||||
"segacd"
|
||||
"saturn"
|
||||
"dreamcast"
|
||||
"psx"
|
||||
"ps2"
|
||||
"psp"
|
||||
"arcade"
|
||||
"dos"
|
||||
];
|
||||
|
||||
# Everything under the root that is not a ROM directory. RetroArch is pointed
|
||||
# at these below; Steam and Clone Hero have to be told about theirs in their
|
||||
# own UIs (see docs/hosts/console.md).
|
||||
libraryDirs = [
|
||||
"bios" # RetroArch system directory: BIOS and firmware images
|
||||
"saves" # in-game saves
|
||||
"states" # save states
|
||||
"playlists"
|
||||
"screenshots"
|
||||
"thumbnails"
|
||||
"steam" # add as a Steam library folder from the client
|
||||
"clonehero/songs"
|
||||
"clonehero/backgrounds"
|
||||
];
|
||||
|
||||
# RetroArch and the cores this machine is expected to run. The wrapper already
|
||||
# points RetroArch at the packaged assets, core info and joypad autoconfig
|
||||
# profiles; `settings` here is merged on top of those.
|
||||
retroarch = pkgs.retroarch-bare.wrapper {
|
||||
cores = with pkgs.libretro; [
|
||||
# Nintendo
|
||||
nestopia # NES
|
||||
snes9x # SNES
|
||||
gambatte # Game Boy / Color
|
||||
mgba # Game Boy Advance
|
||||
mupen64plus # Nintendo 64
|
||||
melonds # Nintendo DS
|
||||
dolphin # GameCube / Wii
|
||||
# Sega
|
||||
genesis-plus-gx # Master System / Game Gear / Mega Drive
|
||||
picodrive # 32X / Mega CD
|
||||
beetle-saturn # Saturn
|
||||
flycast # Dreamcast / NAOMI
|
||||
# Sony
|
||||
beetle-psx-hw # PlayStation, hardware renderer
|
||||
pcsx2 # PlayStation 2 (LRPS2); needs a PS2 BIOS in RetroArch's system dir
|
||||
ppsspp # PSP
|
||||
# Arcade and PC
|
||||
fbneo
|
||||
mame2003-plus
|
||||
dosbox-pure
|
||||
];
|
||||
settings = {
|
||||
# Applied on every launch via --appendconfig, so these three are fixed
|
||||
# policy rather than saved preferences: changing them in the UI will not
|
||||
# stick. Everything else stays user-editable as usual.
|
||||
#
|
||||
# Ozone is the controller-navigable menu; the TV has no keyboard.
|
||||
menu_driver = "ozone";
|
||||
video_fullscreen = "true";
|
||||
# L3+R3 opens the RetroArch menu from inside a running core
|
||||
# (INPUT_COMBO_L3_R3). Without a pad combo there is no way to exit a game
|
||||
# without a keyboard, and no retro system this box emulates has L3/R3 on
|
||||
# its own controller, so the binding cannot collide with a game.
|
||||
input_menu_toggle_gamepad_combo = "2";
|
||||
|
||||
# Point RetroArch at the shared library instead of scattering content and
|
||||
# state through ~/.config/retroarch. Key names are RetroArch's own; an
|
||||
# unrecognised key in an appended config is ignored silently, so they are
|
||||
# worth keeping in step with upstream.
|
||||
system_directory = "${gamesRoot}/bios";
|
||||
savefile_directory = "${gamesRoot}/saves";
|
||||
savestate_directory = "${gamesRoot}/states";
|
||||
playlist_directory = "${gamesRoot}/playlists";
|
||||
screenshot_directory = "${gamesRoot}/screenshots";
|
||||
thumbnails_directory = "${gamesRoot}/thumbnails";
|
||||
# Where the content browser opens, so loading a game is a couple of
|
||||
# D-pad presses rather than a walk up from the filesystem root.
|
||||
rgui_browser_directory = "${gamesRoot}/roms";
|
||||
};
|
||||
};
|
||||
in
|
||||
{
|
||||
programs.steam = {
|
||||
enable = true;
|
||||
|
||||
# Registers the "Steam" wayland session (gamescope wrapping Steam in tenfoot
|
||||
# mode) with the display manager and installs the steam-gamescope launcher.
|
||||
gamescopeSession.enable = true;
|
||||
gamescopeSession.env = {
|
||||
# gamescope has to be pointed at NVIDIA's GBM implementation and GLX
|
||||
# vendor explicitly; on the proprietary driver it otherwise fails to get a
|
||||
# usable device and the session dies at startup.
|
||||
GBM_BACKEND = "nvidia-drm";
|
||||
__GLX_VENDOR_LIBRARY_NAME = "nvidia";
|
||||
};
|
||||
|
||||
# Remote Play and local network game transfers are the point of a TV box on
|
||||
# the same LAN as a desktop; both need their ports open.
|
||||
remotePlay.openFirewall = true;
|
||||
localNetworkGameTransfers.openFirewall = true;
|
||||
|
||||
# Proton-GE, selectable per title in Steam's compatibility settings. Covers
|
||||
# the titles where Valve's Proton lags on codecs and anti-cheat shims. The
|
||||
# module puts its steamcompattool output on STEAM_EXTRA_COMPAT_TOOLS_PATHS,
|
||||
# which is what makes it appear in the client's Proton version list.
|
||||
extraCompatPackages = [ pkgs.proton-ge-bin ];
|
||||
|
||||
# Winetricks against a Proton prefix: the standard repair tool when a title
|
||||
# needs a runtime (dotnet, vcrun, Media Foundation) that Proton does not ship.
|
||||
protontricks.enable = true;
|
||||
};
|
||||
|
||||
# Proton prerequisites beyond what programs.steam already arranges.
|
||||
#
|
||||
# Already covered by the steam module, recorded here so it is not re-litigated:
|
||||
# hardware.graphics 32-bit (the lib32 NVIDIA userspace Proton's 32-bit prefixes
|
||||
# need), Steam's udev rules, 32-bit PipeWire, and the system fonts Wine renders
|
||||
# with (Liberation and DejaVu arrive with fonts.enableDefaultPackages).
|
||||
# vm.max_map_count is 1048576 in the nixpkgs default sysctls, which is above
|
||||
# what DX12/Unreal titles need -- no override required.
|
||||
#
|
||||
# What is not covered: esync opens one eventfd per Wine sync object and runs
|
||||
# out against systemd's default 524288 hard limit in the heaviest titles.
|
||||
# Raise the hard limit only; the soft limit stays at the default, because
|
||||
# lifting that breaks select()-based programs elsewhere on the system.
|
||||
systemd.settings.Manager.DefaultLimitNOFILE = "1024:1048576";
|
||||
|
||||
# capSysNice lets gamescope raise its own scheduling priority, which is what
|
||||
# keeps the compositor smooth while a game saturates the GPU. It installs
|
||||
# gamescope as a setcap wrapper instead of a plain systemPackages entry;
|
||||
# /run/wrappers/bin precedes the system profile on PATH, so steam-gamescope
|
||||
# still resolves it.
|
||||
programs.gamescope = {
|
||||
enable = true;
|
||||
capSysNice = true;
|
||||
};
|
||||
|
||||
# Applies the performance CPU governor (and drops it again) around games that
|
||||
# ask for it; Steam's Proton builds and most native titles do.
|
||||
programs.gamemode.enable = true;
|
||||
|
||||
# Autologin into the Steam session. The launcher is not exposed as a package
|
||||
# by the steam module -- it is built inside it and added to
|
||||
# environment.systemPackages -- so reference it through the system profile.
|
||||
# greetd's `restart` option defaults to false once initial_session is set,
|
||||
# which is what stops a logout from looping straight back into autologin.
|
||||
services.greetd.settings.initial_session = {
|
||||
command = "/run/current-system/sw/bin/steam-gamescope";
|
||||
user = tvUser;
|
||||
};
|
||||
|
||||
# Controllers.
|
||||
#
|
||||
# Xbox One/Series pads over Bluetooth need xpadneo: the in-kernel xpad driver
|
||||
# does not handle them well over BT (wrong button mapping, no rumble). The
|
||||
# module turns on bluez itself; powerOnBoot is set below so the adapter is up
|
||||
# before the Steam session starts and a pad can reconnect unattended.
|
||||
#
|
||||
# Everything else is in-kernel and needs no configuration: wired Xbox 360 pads
|
||||
# (and the 360 wireless receiver) via xpad, DualSense/DualShock 4 via
|
||||
# hid-playstation over USB and Bluetooth, and Clone Hero guitars as plain USB
|
||||
# HID gamepads. xpadneo does not contend with xpad -- it binds Bluetooth HID
|
||||
# devices, and the 360 pad is not HID-compliant. hardware.xone is deliberately
|
||||
# left off: it blacklists xpad, which would break the 360 pads.
|
||||
#
|
||||
# hidraw access for the PlayStation pads (LED, battery, dualsensectl) comes
|
||||
# from Steam's udev rules, which programs.steam enables via
|
||||
# hardware.steam-hardware.
|
||||
hardware.xpadneo.enable = true;
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
# Battery level reporting for Bluetooth gamepads is still behind bluez's
|
||||
# experimental flag.
|
||||
settings.General.Experimental = true;
|
||||
};
|
||||
|
||||
# The games library, created at boot so the directories exist before anything
|
||||
# tries to write into them. Mode 2775 is setgid: the owning group is carried
|
||||
# onto anything created inside, so a second account (or an rsync from another
|
||||
# machine) does not end up with files the TV user cannot write. Directories
|
||||
# are created if missing and otherwise left alone -- nothing here removes or
|
||||
# rewrites content.
|
||||
systemd.tmpfiles.rules =
|
||||
let
|
||||
dir = path: "d ${path} 2775 ${tvUser} users -";
|
||||
in
|
||||
[
|
||||
(dir gamesRoot)
|
||||
(dir "${gamesRoot}/roms")
|
||||
]
|
||||
++ map (system: dir "${gamesRoot}/roms/${system}") romSystems
|
||||
++ map (sub: dir "${gamesRoot}/${sub}") libraryDirs;
|
||||
|
||||
# 32-bit ALSA for the older native titles that talk to ALSA directly rather
|
||||
# than through the PulseAudio shim; programs.steam derives
|
||||
# pipewire.alsa.support32Bit from this. PipeWire itself and the Pulse shim
|
||||
# come from ../../modules/workstation.nix.
|
||||
services.pipewire.alsa.enable = true;
|
||||
|
||||
environment.systemPackages = [
|
||||
retroarch
|
||||
pkgs.clonehero
|
||||
pkgs.dualsensectl # DualSense LED/battery/mic control from the shell
|
||||
pkgs.mangohud # FPS/frametime overlay; use `mangohud %command%` in Steam
|
||||
pkgs.vulkan-tools # vulkaninfo, for checking the 32/64-bit ICDs Proton needs
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# Do not modify this file! It was generated by ‘nixos-generate-config’
|
||||
# and may be overwritten by future invocations. Please make changes
|
||||
# to /etc/nixos/configuration.nix instead.
|
||||
{ config, lib, pkgs, modulesPath, ... }:
|
||||
|
||||
{
|
||||
imports =
|
||||
[ (modulesPath + "/installer/scan/not-detected.nix")
|
||||
];
|
||||
|
||||
boot.initrd.availableKernelModules = [ "xhci_pci" "ehci_pci" "ahci" "usbhid" "usb_storage" "sd_mod" "sr_mod" ];
|
||||
boot.initrd.kernelModules = [ ];
|
||||
boot.kernelModules = [ "kvm-intel" ];
|
||||
boot.extraModulePackages = [ ];
|
||||
|
||||
fileSystems."/" =
|
||||
{ device = "/dev/disk/by-uuid/2ab976ad-ba88-4d1b-8d70-5a114a4ed024";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot" =
|
||||
{ device = "/dev/disk/by-uuid/32FB-6BEE";
|
||||
fsType = "vfat";
|
||||
options = [ "fmask=0022" "dmask=0022" ];
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
|
||||
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
|
||||
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
# NVIDIA GeForce GTX 1070 8 GB (Pascal, GP104): proprietary driver for the
|
||||
# gamescope Steam session and the Sway desktop.
|
||||
#
|
||||
# Driver branch: 580 (nvidiaPackages.legacy_580), NOT the nixpkgs default
|
||||
# (`production`, currently 595.x). 580 is the last branch that supports
|
||||
# Maxwell/Pascal/Volta -- NVIDIA keeps it as an LTS branch to Aug 2028 -- and a
|
||||
# newer branch simply will not drive this card. Same constraint as the Mac Pro's
|
||||
# Quadro P400; see hosts/MacPro31/nvidia.nix.
|
||||
#
|
||||
# The driver is unfree, so it is not in the binary cache: the kernel module is
|
||||
# compiled locally on every kernel bump.
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
# Selects the proprietary driver; the module blacklists nouveau/nvidiafb and
|
||||
# loads nvidia-uvm via a modprobe softdep. Naming is historical -- this option
|
||||
# drives the kernel/driver choice on Wayland hosts too, which is why it is set
|
||||
# on a machine that runs no X server.
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
package = config.boot.kernelPackages.nvidiaPackages.legacy_580;
|
||||
# Required for Wayland: sets nvidia-drm.modeset=1 (and fbdev=1), without
|
||||
# which neither gamescope nor wlroots gets a usable GBM device and both the
|
||||
# Steam session and Sway fail to start.
|
||||
modesetting.enable = true;
|
||||
# The open kernel modules need Turing or later; Pascal must use the closed
|
||||
# ones. Explicit because the option has no default on driver >= 560.
|
||||
open = false;
|
||||
};
|
||||
|
||||
# The NVIDIA module only puts these in boot.kernelModules when
|
||||
# services.xserver.enable is true, which is false on this Wayland-only host --
|
||||
# so load them explicitly rather than relying on udev modalias autoloading.
|
||||
# nvidia_uvm is deliberately absent: the module's modprobe softdep pulls it in
|
||||
# after the GPU device exists, which is the supported ordering.
|
||||
boot.kernelModules = [
|
||||
"nvidia"
|
||||
"nvidia_modeset"
|
||||
"nvidia_drm"
|
||||
];
|
||||
|
||||
# wlroots refuses the proprietary NVIDIA driver unless told to proceed. The
|
||||
# greeter's compositor (cage) and gamescope have no such check; only Sway
|
||||
# needs the flag, which the module bakes into the wrapper the session's
|
||||
# .desktop file runs.
|
||||
programs.sway.extraOptions = [ "--unsupported-gpu" ];
|
||||
|
||||
# 32-bit driver libraries for 32-bit Steam titles and Proton's 32-bit
|
||||
# prefixes: hardware.graphics.enable32Bit pulls in the matching lib32 NVIDIA
|
||||
# userspace. programs.steam (./gaming.nix) sets it too; stated here as well so
|
||||
# the GPU's 32-bit story lives with the rest of the GPU config.
|
||||
hardware.graphics.enable32Bit = true;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
# Default nix-darwin host. Minimal macOS baseline; the user environment
|
||||
# (shell, git, editor) is carried by the shared ./lyrathorpe/home modules,
|
||||
# (shell, git, editor) is carried by the shared ./home modules,
|
||||
# the same ones used by the Linux hosts. nixpkgs.hostPlatform is set by
|
||||
# mkDarwinHost in flake.nix.
|
||||
{ pkgs, username, ... }:
|
||||
@@ -80,7 +80,7 @@
|
||||
};
|
||||
|
||||
# Declarative Homebrew for packages with no nixpkgs equivalent or that must be
|
||||
# the vendor build (GUI casks, Mac App Store apps).
|
||||
# the vendor build (GUI casks).
|
||||
homebrew = {
|
||||
enable = true;
|
||||
onActivation = {
|
||||
@@ -97,6 +97,8 @@
|
||||
"llvm@21"
|
||||
"lld@21"
|
||||
"python@3.14"
|
||||
"dosbox-staging"
|
||||
"mole"
|
||||
];
|
||||
# GUI applications. macOS app bundles are managed as casks; nixpkgs darwin
|
||||
# GUI support is unreliable, so these stay on brew for continuity.
|
||||
@@ -110,6 +112,7 @@
|
||||
"bitwarden"
|
||||
"citrix-workspace"
|
||||
"curseforge"
|
||||
"darktable"
|
||||
"discord"
|
||||
"firefox"
|
||||
"freecad"
|
||||
@@ -130,24 +133,55 @@
|
||||
"signal"
|
||||
"steam"
|
||||
"thunderbird"
|
||||
"virtualbox"
|
||||
"visual-studio-code"
|
||||
"vnc-viewer"
|
||||
"vscodium"
|
||||
"winbox"
|
||||
];
|
||||
masApps = {
|
||||
Amphetamine = 937984704;
|
||||
"Apple Configurator" = 1037126344;
|
||||
"Game Controller Tester" = 1500593102;
|
||||
"Home Assistant" = 1099568401;
|
||||
Infuse = 1136220934;
|
||||
Keynote = 409183694;
|
||||
Numbers = 409203825;
|
||||
Pages = 409201541;
|
||||
PDFgear = 6469021132;
|
||||
PL2303Serial = 1624835354;
|
||||
WireGuard = 1451685025;
|
||||
# Mac App Store apps are not managed declaratively: nix-darwin 26.05 forces
|
||||
# activation to run as root, and `mas` cannot reach the App Store session
|
||||
# from root, so installs silently fail. Install them by hand with
|
||||
# `mas install <id>` from a GUI Terminal (the `mas` CLI is in
|
||||
# environment.systemPackages above).
|
||||
};
|
||||
|
||||
# Touch ID authorises sudo (and darwin-rebuild's sudo prompt) instead of a
|
||||
# typed password. sudo_local keeps the change in /etc/pam.d/sudo_local so it
|
||||
# survives macOS updates. reattach pulls in pam_reattach: pam_tid (Touch ID)
|
||||
# otherwise fails inside tmux/screen because the process is detached from the
|
||||
# GUI login session -- and terminals here auto-start tmux, so it is required.
|
||||
security.pam.services.sudo_local = {
|
||||
touchIdAuth = true;
|
||||
reattach = true;
|
||||
};
|
||||
|
||||
# Declarative macOS UI defaults -- the main reason to run nix-darwin beyond
|
||||
# package management. Applied on activation; all reversible.
|
||||
system.defaults = {
|
||||
dock = {
|
||||
show-recents = false;
|
||||
mru-spaces = false; # don't reorder spaces by use
|
||||
# Disable hot-corners
|
||||
wvous-tr-corner = 1;
|
||||
wvous-tl-corner = 1;
|
||||
wvous-bl-corner = 1;
|
||||
wvous-br-corner = 1;
|
||||
};
|
||||
finder = {
|
||||
AppleShowAllExtensions = true;
|
||||
ShowPathbar = true;
|
||||
FXPreferredViewStyle = "Nlsv"; # list view
|
||||
_FXShowPosixPathInTitle = true;
|
||||
};
|
||||
NSGlobalDomain = {
|
||||
AppleInterfaceStyle = "Dark";
|
||||
ApplePressAndHoldEnabled = false; # key-repeat instead of the accent popup
|
||||
InitialKeyRepeat = 15;
|
||||
KeyRepeat = 2;
|
||||
};
|
||||
trackpad = {
|
||||
Clicking = true; # tap to click
|
||||
TrackpadThreeFingerDrag = true;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -19,9 +19,7 @@
|
||||
defaultUser = "emmathorpe";
|
||||
wslConf.automount.root = "/mnt";
|
||||
wslConf.interop.appendWindowsPath = true;
|
||||
wslConf.interop.register = true;
|
||||
wslConf.interop.enabled = true;
|
||||
wslConf.interop.includePath = true;
|
||||
wslConf.network.generateHosts = false;
|
||||
startMenuLaunchers = true;
|
||||
docker-desktop.enable = false;
|
||||
@@ -43,6 +41,11 @@
|
||||
autoPrune.enable = true;
|
||||
};
|
||||
|
||||
# Match the flake's nixosConfigurations attribute name so `nh os switch`
|
||||
# (which selects by the local hostname) resolves without an explicit
|
||||
# -H/--hostname flag. The default would otherwise be the stock NixOS "nixos".
|
||||
networking.hostName = "emmathorpe-edaas";
|
||||
|
||||
networking.resolvconf.enable = false;
|
||||
|
||||
# Drop the systemd-ssh-proxy Include from the generated /etc/ssh/ssh_config.
|
||||
@@ -57,8 +60,19 @@
|
||||
## patch the script
|
||||
systemd.services.docker-desktop-proxy.script = lib.mkForce ''${config.wsl.wslConf.automount.root}/wsl/docker-desktop/docker-desktop-user-distro proxy --docker-desktop-root ${config.wsl.wslConf.automount.root}/wsl/docker-desktop "C:\Program Files\Docker\Docker\resources"'';
|
||||
|
||||
# NixOS-WSL's passwordless wheel default only covers `security.sudo`; the
|
||||
# sudo-rs swap in common-nixos.nix needs it set again. No console login here,
|
||||
# and no account password anyone knows.
|
||||
security.sudo-rs.wheelNeedsPassword = false;
|
||||
|
||||
features.swayDesktop.enable = false;
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
# NOTE: this user's systemd --user lingering -- so the home-manager renovate
|
||||
# timer fires without an open login session -- is enabled from the host table
|
||||
# in flake.nix (users.emmathorpe.linger = true) and applied by
|
||||
# modules/users.nix.
|
||||
|
||||
# programs.nix-ld is enabled for all NixOS hosts in common-nixos.nix.
|
||||
# This value determines the NixOS release from which the default
|
||||
# settings for stateful data, like file locations and database versions
|
||||
# on your system were taken. It's perfectly fine and recommended to leave
|
||||
@@ -12,11 +12,24 @@
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = false;
|
||||
|
||||
networking.hostName = "Emma-Asahi";
|
||||
networking.hostName = "Lyra-Asahi";
|
||||
|
||||
# No fingerprint reader on this machine; empty service still lets swaylock
|
||||
# authenticate via password.
|
||||
security.pam.services.swaylock = { };
|
||||
# Audio (PipeWire) and the swaylock PAM stack are inherited from
|
||||
# workstation.nix. hardware.enableRedistributableFirmware is also set there;
|
||||
# it is harmless here since Asahi supplies its own peripheral firmware below.
|
||||
|
||||
# Binary cache for the Asahi kernel/build artifacts, so the MBP pulls prebuilt
|
||||
# outputs instead of compiling the Asahi kernel locally.
|
||||
nix.settings = {
|
||||
substituters = [ "https://nixos-apple-silicon.cachix.org" ];
|
||||
trusted-public-keys = [
|
||||
"nixos-apple-silicon.cachix.org-1:8psDu5SA5dAD7qA0zMy5UT292TxeEPzIz8VVEr2Js20="
|
||||
];
|
||||
};
|
||||
|
||||
# Explicit rather than relying on the module default (which upstream will stop
|
||||
# defaulting to true; the eval warns otherwise).
|
||||
hardware.asahi.enable = true;
|
||||
|
||||
# Apple peripheral firmware (Wi-Fi/Bluetooth). The directory is gitignored and
|
||||
# populated out-of-band -- see README.
|
||||
@@ -0,0 +1,48 @@
|
||||
# Apple Mac Pro 3,1 (Early 2008, dual Xeon Harpertown, x86_64). Desktop host:
|
||||
# shared graphical/wired options live in ../../modules/desktop.nix; only
|
||||
# host-specific settings are here. Install notes (EFI booting, GPU, partitions):
|
||||
# see ../../docs/hosts/macpro31.md.
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./nvidia.nix
|
||||
];
|
||||
|
||||
# Dual quad-core Xeon (Harpertown/Penryn): SSE4.1 but no SSE4.2 or POPCNT,
|
||||
# i.e. x86-64-v1. Declaring it here switches off the fleet flags that need a
|
||||
# newer CPU -- currently features.claudeCode (see ../../modules/features.nix).
|
||||
features.cpu.microarchLevel = 1;
|
||||
|
||||
# The Mac Pro 3,1 has 64-bit EFI (confirmed by the owner), so boot via
|
||||
# systemd-boot like the MBP -- no GRUB/BIOS shim needed.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
# Apple's EFI does not reliably support efibootmgr NVRAM writes; leave the
|
||||
# firmware vars untouched.
|
||||
boot.loader.efi.canTouchEfiVariables = false;
|
||||
# Apple-EFI quirk: if the Mac does not pick up the bootloader at the boot
|
||||
# picker, install it to the fallback path \EFI\BOOT\BOOTX64.EFI and/or
|
||||
# "bless" the ESP from macOS. Uncomment to write the removable fallback path:
|
||||
# boot.loader.efi.efiInstallAsRemovable = true;
|
||||
|
||||
networking.hostName = "MacPro31-NixOS";
|
||||
|
||||
# Elderly host: a compressed RAM swap softens memory pressure (earlyoom in
|
||||
# workstation.nix is the backstop).
|
||||
zramSwap.enable = true;
|
||||
|
||||
# sshd (daemon, port 22, key-only policy) comes from ../../modules/ssh.nix;
|
||||
# the firewall itself is enabled in workstation.nix with a default-deny policy.
|
||||
|
||||
# Dual Harpertown Xeon microcode. Redistributable firmware (GPU/NIC blobs) is
|
||||
# enabled in workstation.nix.
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
|
||||
# GPU: the stock card (ATI Radeon HD 2600 XT / NVIDIA GeForce 8800 GT) has
|
||||
# been replaced with an NVIDIA Quadro P400. Driver, Wayland quirks and
|
||||
# GPU-enabled Docker live in ./nvidia.nix.
|
||||
|
||||
# See `man configuration.nix` / the stateVersion docs before changing.
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
# NVIDIA Quadro P400 (Pascal, GP108) on the Mac Pro 3,1: proprietary driver for
|
||||
# the Sway desktop, plus Docker with GPU/CUDA access for containers.
|
||||
#
|
||||
# Driver branch: 580 (nvidiaPackages.legacy_580), NOT the nixpkgs default
|
||||
# (`production`, currently 595.x). 580 is the last branch that supports
|
||||
# Maxwell/Pascal/Volta -- NVIDIA keeps it as an LTS branch to Aug 2028 -- and a
|
||||
# newer branch simply will not drive this card.
|
||||
#
|
||||
# The driver is unfree, so it is not in the binary cache: the kernel module is
|
||||
# compiled locally. On this machine's 2008 Xeons expect the first rebuild after
|
||||
# a kernel bump to take a long while.
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
# Selects the proprietary driver; the module blacklists nouveau/nvidiafb and
|
||||
# loads nvidia-uvm (needed by CUDA) via modprobe softdep. Naming is historical
|
||||
# -- this option drives the kernel/driver choice on Wayland hosts too, which
|
||||
# is why it is set on a machine that runs no X server.
|
||||
services.xserver.videoDrivers = [ "nvidia" ];
|
||||
|
||||
hardware.nvidia = {
|
||||
package = config.boot.kernelPackages.nvidiaPackages.legacy_580;
|
||||
# Required for Wayland: sets nvidia-drm.modeset=1 (and fbdev=1), without
|
||||
# which wlroots gets no GBM device and Sway/cage fail to start.
|
||||
modesetting.enable = true;
|
||||
# The open kernel modules need Turing or later; Pascal must use the closed
|
||||
# ones. Explicit because the option has no default on driver >= 560.
|
||||
open = false;
|
||||
};
|
||||
|
||||
# The NVIDIA module only puts these in boot.kernelModules when
|
||||
# services.xserver.enable is true, which is false on this Wayland-only host --
|
||||
# so load them explicitly rather than relying on udev modalias autoloading.
|
||||
# nvidia_uvm (needed by CUDA) is deliberately absent: the module's modprobe
|
||||
# softdep pulls it in after the GPU device exists, which is the supported
|
||||
# ordering.
|
||||
boot.kernelModules = [
|
||||
"nvidia"
|
||||
"nvidia_modeset"
|
||||
"nvidia_drm"
|
||||
];
|
||||
|
||||
# wlroots refuses the proprietary NVIDIA driver unless told to proceed. The
|
||||
# greeter's compositor (cage) has no such check; only Sway needs the flag,
|
||||
# which the module bakes into the wrapper the session's .desktop file runs.
|
||||
programs.sway.extraOptions = [ "--unsupported-gpu" ];
|
||||
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
# CDI-based GPU access for containers: generates /var/run/cdi specs from the
|
||||
# host driver at boot and turns on Docker's CDI feature. Run GPU workloads
|
||||
# with `docker run --device=nvidia.com/gpu=all ...`. The deprecated
|
||||
# virtualisation.docker.enableNvidia runtime wrapper is deliberately not used.
|
||||
hardware.nvidia-container-toolkit.enable = true;
|
||||
|
||||
# The generator needs a loaded kernel module: without one it aborts with
|
||||
# "failed to initialize NVML: Driver Not Loaded". That is guaranteed after a
|
||||
# kernel bump, where the rebuilt module cannot load until reboot -- and since
|
||||
# the unit is requiredBy docker.service and wantedBy multi-user.target, the
|
||||
# failure takes Docker down and makes `nixos-rebuild switch` exit non-zero.
|
||||
# Skip the run instead when no driver is loaded; the toolkit's udev rule
|
||||
# restarts the unit as soon as the nvidia device appears, so the CDI specs are
|
||||
# still generated on the next boot.
|
||||
systemd.services.nvidia-container-toolkit-cdi-generator.unitConfig.ConditionPathExists =
|
||||
"/proc/driver/nvidia/version";
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
# Raspberry Pi 5 (aarch64) headless server. Two roles, split into submodules:
|
||||
# ./docker.nix (Docker host with a network socket) and ./reverse-proxy.nix
|
||||
# (native nginx). The raspberry-pi-5 nixos-hardware profile (kernel, firmware,
|
||||
# device tree) and key-only sshd (../../modules/ssh.nix) are layered on in the
|
||||
# flake host table. Install notes: see ../../docs/hosts/rpi5.md.
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
./docker.nix
|
||||
./reverse-proxy.nix
|
||||
];
|
||||
|
||||
# Match the flake's nixosConfigurations attribute name so `nh os switch`
|
||||
# (which selects by the local hostname) resolves without an explicit -H flag.
|
||||
networking.hostName = "lyrathorpe-rpi5";
|
||||
|
||||
# Headless server: the Sway desktop is intentionally not set up. modules/sway.nix is
|
||||
# not imported and features.swayDesktop.enable defaults to false (declared in
|
||||
# modules/features.nix), so this host keeps plain TTY/SSH login.
|
||||
|
||||
# Raspberry Pi boots via U-Boot + extlinux, not GRUB/systemd-boot. The
|
||||
# raspberry-pi-5 nixos-hardware profile supplies the kernel, firmware and
|
||||
# device tree.
|
||||
boot.loader.grub.enable = false;
|
||||
boot.loader.generic-extlinux-compatible.enable = true;
|
||||
|
||||
# Remote administration: the daemon, port 22 and key-only policy all come from
|
||||
# ../../modules/ssh.nix.
|
||||
|
||||
# Default-deny inbound; the Docker and nginx submodules open their own ports
|
||||
# (Docker via a source-restricted nftables rule, nginx via 80/443).
|
||||
networking.firewall.enable = true;
|
||||
|
||||
# See `man configuration.nix` / the stateVersion docs before changing.
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
# Docker host with the daemon socket exposed over the network.
|
||||
#
|
||||
# SECURITY: the daemon listens on plain TCP 2375 with NO TLS and NO auth. Access
|
||||
# to that port is root-equivalent on this host (the Docker API can mount the
|
||||
# host filesystem and run privileged containers). The ONLY thing protecting it
|
||||
# is the nftables rule below, which accepts 2375 solely from the trusted LAN
|
||||
# subnet. Do not widen that subnet to anything you do not fully trust. The
|
||||
# secure upgrade path is mutual TLS on 2376 (--tlsverify with client certs);
|
||||
# that needs out-of-band cert provisioning and is intentionally not wired here.
|
||||
{ ... }:
|
||||
let
|
||||
# LAN allowed to reach the unauthenticated Docker TCP socket (see SECURITY above).
|
||||
trustedSubnet = "10.187.1.0/24";
|
||||
in
|
||||
{
|
||||
virtualisation.docker.enable = true;
|
||||
|
||||
# Expose the daemon over TCP by extending systemd socket activation rather than
|
||||
# setting daemon.settings.hosts. The NixOS docker unit starts dockerd with
|
||||
# `-H fd://` and takes its listeners from this socket; putting `hosts` in
|
||||
# daemon.json as well would conflict with that and dockerd would refuse to
|
||||
# start. Adding the TCP listener here keeps a single source of truth.
|
||||
# The leading "" resets the unit's default (unix-socket-only) ListenStream list.
|
||||
systemd.sockets.docker.socketConfig.ListenStream = [
|
||||
""
|
||||
"/run/docker.sock"
|
||||
"0.0.0.0:2375"
|
||||
];
|
||||
|
||||
# Source-restricted firewall rule for the Docker TCP port. 2375 is deliberately
|
||||
# NOT added to networking.firewall.allowedTCPPorts (that would open it to every
|
||||
# source); instead nftables accepts it only from the trusted subnet. Adjust the
|
||||
# CIDR to match the LAN that should reach the Docker API.
|
||||
networking.nftables.enable = true;
|
||||
networking.firewall.extraInputRules = ''
|
||||
ip saddr ${trustedSubnet} tcp dport 2375 accept
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# PLACEHOLDER hardware configuration for the Raspberry Pi 5.
|
||||
#
|
||||
# This file is NOT the real generated config -- it exists only so the host
|
||||
# evaluates in CI before the Pi is provisioned. The machine will not boot from
|
||||
# it as-is. On first install, regenerate this file on the device with
|
||||
# nixos-generate-config --root /mnt
|
||||
# and replace this placeholder with the output (commit it). See ../../docs/hosts/rpi5.md.
|
||||
#
|
||||
# Like every hardware-configuration.nix in this repo, this file is excluded from
|
||||
# the formatter and linters (see the pre-commit/treefmt excludes in flake.nix).
|
||||
{ modulesPath, ... }:
|
||||
{
|
||||
imports = [ (modulesPath + "/installer/scan/not-detected.nix") ];
|
||||
|
||||
nixpkgs.hostPlatform = "aarch64-linux";
|
||||
|
||||
# The Raspberry Pi 5 boots from an SD card / USB with a FAT firmware partition
|
||||
# and an ext4 root. Labels match the conventional sd-image layout; the real
|
||||
# generated config will use by-uuid device paths instead.
|
||||
fileSystems."/" = {
|
||||
device = "/dev/disk/by-label/NIXOS_SD";
|
||||
fsType = "ext4";
|
||||
};
|
||||
|
||||
fileSystems."/boot/firmware" = {
|
||||
device = "/dev/disk/by-label/FIRMWARE";
|
||||
fsType = "vfat";
|
||||
};
|
||||
|
||||
swapDevices = [ ];
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
# Native nginx reverse proxy. The proxy configuration is declarative Nix:
|
||||
# every proxied service is an entry under services.nginx.virtualHosts, so the
|
||||
# whole routing table lives in this file and is built/version-controlled with
|
||||
# the rest of the system.
|
||||
#
|
||||
# To add a proxied service, add another virtualHosts."<host>" entry following
|
||||
# the example below. To serve it over HTTPS, uncomment enableACME + forceSSL on
|
||||
# that vhost once it has a real DNS name and the ACME HTTP-01/DNS-01 challenge
|
||||
# can be satisfied (see security.acme for the account/email and DNS settings).
|
||||
{ ... }:
|
||||
{
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true; # sane proxy_set_header defaults (Host, X-Forwarded-*)
|
||||
recommendedTlsSettings = true;
|
||||
recommendedOptimisation = true;
|
||||
recommendedGzipSettings = true;
|
||||
|
||||
virtualHosts = {
|
||||
# Example reverse-proxy vhost. Replace the name and upstream with a real
|
||||
# service (e.g. a container published by the Docker host on this machine).
|
||||
"example.lan" = {
|
||||
# enableACME = true; # request a Let's Encrypt cert for this host
|
||||
# forceSSL = true; # redirect HTTP -> HTTPS once the cert exists
|
||||
locations."/" = {
|
||||
proxyPass = "http://127.0.0.1:8080";
|
||||
proxyWebsockets = true; # forward Upgrade/Connection for WebSocket apps
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Public reverse-proxy ports. 443 is opened now so flipping a vhost to TLS
|
||||
# needs no firewall change.
|
||||
networking.firewall.allowedTCPPorts = [
|
||||
80
|
||||
443
|
||||
];
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
# ThinkPad T400 (NixOS). Shared laptop options live in ../../modules/laptop.nix;
|
||||
# only host-specific settings are here. Install notes (boot variants, GPU,
|
||||
# partitions): see ./README.md.
|
||||
{ ... }:
|
||||
# partitions): see ../../docs/hosts/t400.md.
|
||||
{ config, ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
@@ -18,25 +18,26 @@
|
||||
|
||||
console.font = "Lat2-Terminus16";
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
# Low-RAM host (4 GiB max): a compressed RAM swap reduces disk paging.
|
||||
zramSwap.enable = true;
|
||||
|
||||
# This host accepts SSH, so open 22 (the firewall itself is enabled in
|
||||
# laptop.nix with a default-deny policy).
|
||||
services.openssh.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
# sshd (daemon, port 22, key-only policy) comes from ../../modules/ssh.nix;
|
||||
# the firewall itself is enabled in laptop.nix with a default-deny policy.
|
||||
|
||||
# The T400's fingerprint reader differs/may be absent; empty service still
|
||||
# lets swaylock authenticate via password.
|
||||
security.pam.services.swaylock = { };
|
||||
|
||||
# Intel Core 2 (Penryn) microcode + redistributable firmware. The latter also
|
||||
# supplies the iwlwifi blobs (Intel WiFi Link 5100/5300) and the radeon
|
||||
# firmware needed by the discrete GPU below.
|
||||
# Intel Core 2 (Penryn) microcode. Redistributable firmware (enabled in
|
||||
# workstation.nix) supplies the iwlwifi blobs (Intel WiFi Link 5100/5300) and
|
||||
# the radeon firmware needed by the discrete GPU below.
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# Battery longevity: cap charging to 75-80%. tlp itself comes from the
|
||||
# nixos-hardware lenovo-thinkpad profile; tp_smapi supplies the threshold
|
||||
# sysfs on this 2008-era ThinkPad (kernel-native natacpi is too new for it).
|
||||
boot.kernelModules = [ "tp_smapi" ];
|
||||
boot.extraModulePackages = [ config.boot.kernelPackages.tp_smapi ];
|
||||
services.tlp.settings = {
|
||||
START_CHARGE_THRESH_BAT0 = 75;
|
||||
STOP_CHARGE_THRESH_BAT0 = 80;
|
||||
};
|
||||
|
||||
# This T400 has the optional discrete GPU fitted: an ATI Mobility Radeon HD
|
||||
# 3470 (RV620), driven by the open `radeon` KMS driver. Load it in the initrd
|
||||
@@ -1,6 +1,6 @@
|
||||
# Catppuccin Mocha palette. Raw 6-digit hex (no leading "#"); consumers add a
|
||||
# "#" where their format needs it. Shared by the Sway desktop theming
|
||||
# (home/sway.nix) and the ReGreet greeter (swaywm.nix) so the two stay in sync.
|
||||
# (home/sway.nix) and the ReGreet greeter (modules/sway.nix) so the two stay in sync.
|
||||
{
|
||||
base = "1e1e2e";
|
||||
mantle = "181825";
|
||||
@@ -1,177 +0,0 @@
|
||||
# Keybindings reference
|
||||
|
||||
Every keyboard shortcut configured across this desktop, and where it is defined.
|
||||
Everything here is managed declaratively through Nix — edit the listed file and
|
||||
rebuild, never the generated dotfiles.
|
||||
|
||||
| Area | Defined in |
|
||||
| --- | --- |
|
||||
| Sway (compositor) | [`sway.nix`](./sway.nix) `config.keybindings` + `config.modes`, plus the home-manager Sway module's built-in defaults |
|
||||
| tmux | [`shell.nix`](./shell.nix) `programs.tmux` |
|
||||
| zsh line editor | [`shell.nix`](./shell.nix) `programs.zsh.historySubstringSearch` |
|
||||
| foot (terminal) | foot package defaults — only colours are themed (in `sway.nix`) |
|
||||
|
||||
**Conventions**
|
||||
|
||||
- **Super** is the `Mod4` / logo (Windows/Command) key; **Alt** is `Mod1`.
|
||||
- Letter keys are **keysyms** (the character produced), not physical positions.
|
||||
The keyboard is **Dvorak** (`us`/`dvorak`), so e.g. "Super+s" is whatever key
|
||||
types `s` in Dvorak.
|
||||
- Shortcuts apply to every Sway host (MBP, T400, Mac Pro); brightness keys are
|
||||
laptop-only, as noted.
|
||||
|
||||
---
|
||||
|
||||
## Sway
|
||||
|
||||
### Applications & session
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Super`+`Return` | Open a terminal (foot) |
|
||||
| `Super`+`Space` | App launcher (sway-launcher-desktop in a floating foot) |
|
||||
| `Super`+`d` | App launcher (same as above; module default) |
|
||||
| `Super`+`e` | File manager (nemo) |
|
||||
| `Super`+`c` | Clipboard history picker (clipman → fuzzel) |
|
||||
| `Super`+`l` | Lock screen (swaylock) |
|
||||
| `Super`+`Shift`+`q` | Close the focused window |
|
||||
| `Super`+`Shift`+`c` | Reload the Sway config |
|
||||
| `Super`+`Shift`+`e` | Exit Sway (asks for confirmation) |
|
||||
|
||||
### Focus
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Super`+`←`/`↓`/`↑`/`→` | Move focus by direction |
|
||||
| `Super`+`h`/`j`/`k` | Move focus left / down / up (vim-style) |
|
||||
| `Super`+`a` | Focus the parent container |
|
||||
| `Super`+`Alt`+`Space` | Toggle focus between tiling and floating |
|
||||
|
||||
> Note: vim focus-right would be `Super`+`l`, but that is bound to **lock** here;
|
||||
> use `Super`+`→`.
|
||||
|
||||
### Moving windows
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Super`+`Shift`+`←`/`↓`/`↑`/`→` | Move the window by direction |
|
||||
| `Super`+`Shift`+`h`/`j`/`k`/`l` | Move the window left / down / up / right |
|
||||
| `Super`+`Shift`+`Space` | Toggle the window floating |
|
||||
|
||||
Mouse (with `Super` held): left-drag moves a window, right-drag resizes it.
|
||||
|
||||
### Layout
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Super`+`b` | Split horizontally |
|
||||
| `Super`+`v` | Split vertically |
|
||||
| `Super`+`s` | Stacking layout |
|
||||
| `Super`+`w` | Tabbed layout |
|
||||
| `Super`+`f` | Toggle fullscreen |
|
||||
| `Super`+`y` | **Layout submenu**: `s` stacking · `w` tabbed · `e` toggle split · `Return`/`Esc` exit |
|
||||
|
||||
> The layout submenu's `e` (toggle split) is the home for that action since
|
||||
> `Super`+`e` now opens the file manager.
|
||||
|
||||
### Workspaces
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Super`+`1`…`0` | Switch to workspace 1…10 |
|
||||
| `Super`+`Shift`+`1`…`0` | Move the window to workspace 1…10 |
|
||||
| `Super`+`z` | Previous workspace |
|
||||
| `Super`+`x` | Next workspace |
|
||||
|
||||
### Scratchpad
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Super`+`Shift`+`-` | Move the window to the scratchpad |
|
||||
| `Super`+`-` | Show / cycle the scratchpad |
|
||||
|
||||
### Modes (submenus)
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Super`+`r` | **Resize mode**: arrow keys resize; `Return`/`Esc` exit |
|
||||
| `Super`+`y` | **Layout mode** (see Layout above) |
|
||||
| `Super`+`Shift`+`x` | **Power menu**: `l` lock · `e` log out · `s` sleep · `r` reboot · `Shift`+`s` shutdown · `Return`/`Esc` exit |
|
||||
|
||||
### Screenshots
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Print` | Select a region → swappy (annotate/save) |
|
||||
| `Shift`+`Print` | Focused window → swappy |
|
||||
|
||||
### Audio & media
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `XF86AudioRaiseVolume` / `XF86AudioLowerVolume` | Volume ±5% (wpctl) |
|
||||
| `XF86AudioMute` | Toggle output mute |
|
||||
| `XF86AudioMicMute` | Toggle microphone mute |
|
||||
| `XF86AudioPlay` | Play/pause (playerctl) |
|
||||
| `XF86AudioNext` / `XF86AudioPrev` | Next / previous track |
|
||||
|
||||
### Brightness — laptops only
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `XF86MonBrightnessUp` / `XF86MonBrightnessDown` | Backlight ±5% (brightnessctl) |
|
||||
|
||||
Present only on portable hosts (T400, MBP); desktops have no internal backlight.
|
||||
|
||||
---
|
||||
|
||||
## tmux
|
||||
|
||||
Prefix is **`Ctrl`+`b`** (default). Copy mode uses **vi** keys.
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Ctrl`+`b` then `v` | Split into left/right panes |
|
||||
| `Ctrl`+`b` then `s` | Split into top/bottom panes |
|
||||
| `Ctrl`+`h`/`j`/`k`/`l` | Move between panes — and into/out of vim splits — seamlessly (vim-tmux-navigator, no prefix) |
|
||||
| `Alt`+`←`/`→`/`↑`/`↓` | Switch pane by direction (no prefix needed) |
|
||||
| `Ctrl`+`b` then `[` | Enter copy mode (then vi motions; `Space`/`Enter` to select/copy) |
|
||||
| `Ctrl`+`b` then `z` | Zoom / unzoom the focused pane |
|
||||
| `Ctrl`+`b` then `c` | New window |
|
||||
| `Ctrl`+`b` then `n` / `p` | Next / previous window |
|
||||
| `Ctrl`+`b` then `d` | Detach |
|
||||
| `Ctrl`+`b` then `Ctrl`+`s` / `Ctrl`+`r` | Save / restore the session (resurrect; continuum also auto-saves and restores on start) |
|
||||
| Mouse | Enabled — click to focus, drag borders, scroll, select |
|
||||
|
||||
> The stock split keys `%` and `"` are unbound; use `v` / `s` above. `Ctrl`+`b`
|
||||
> then `s` is therefore a split, not the session tree.
|
||||
>
|
||||
> Sessions persist across reboots (resurrect + continuum). Terminals auto-start
|
||||
> tmux; `NO_TMUX=1 <terminal>` opens a bare shell instead.
|
||||
|
||||
---
|
||||
|
||||
## foot (terminal)
|
||||
|
||||
Only colours are themed; these are foot's default key bindings.
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `Ctrl`+`Shift`+`c` / `Ctrl`+`Shift`+`v` | Copy / paste (clipboard) |
|
||||
| `Shift`+`Insert` | Paste primary selection |
|
||||
| `Ctrl`+`Shift`+`r` | Search scrollback |
|
||||
| `Ctrl`+`+` / `Ctrl`+`-` / `Ctrl`+`0` | Font larger / smaller / reset |
|
||||
| `Ctrl`+`Shift`+`u` | URL mode (jump to/open links) |
|
||||
| `Ctrl`+`Shift`+`n` | Spawn a new terminal |
|
||||
| `Shift`+`PageUp` / `Shift`+`PageDown` | Scroll back / forward |
|
||||
|
||||
---
|
||||
|
||||
## zsh
|
||||
|
||||
| Shortcut | Action |
|
||||
| --- | --- |
|
||||
| `↑` / `↓` | History **substring** search — type a fragment first, then the arrows cycle matching past commands |
|
||||
|
||||
Bound for both CSI and SS3 cursor sequences, so it works in foot, iTerm2 and
|
||||
the Linux TTY alike.
|
||||
@@ -1,135 +0,0 @@
|
||||
# Interactive shell environment
|
||||
|
||||
Everything the shell, terminal multiplexer, git and ssh do beyond their defaults,
|
||||
and where each is defined. All of it is managed declaratively through
|
||||
home-manager — edit the listed file and rebuild, never the generated dotfiles.
|
||||
|
||||
Keyboard shortcuts have their own reference: [`KEYBINDINGS.md`](./KEYBINDINGS.md).
|
||||
|
||||
| Area | Defined in |
|
||||
| --- | --- |
|
||||
| zsh, CLI tools, tmux, ssh, auto-tmux | [`shell.nix`](./shell.nix) |
|
||||
| git (+ delta, commitizen) | [`git.nix`](./git.nix) |
|
||||
| vim | [`editor.nix`](./editor.nix) |
|
||||
| GUI apps, GTK/Firefox theming, cursor | [`desktop.nix`](./desktop.nix) (graphical hosts only) |
|
||||
|
||||
Shared by every host via [`default.nix`](./default.nix); the work box also layers
|
||||
[`../../system/modules/work/default.nix`](../../system/modules/work/default.nix)
|
||||
on top (work email, its own ssh config, extra packages).
|
||||
|
||||
---
|
||||
|
||||
## zsh
|
||||
|
||||
| Feature | Notes |
|
||||
| --- | --- |
|
||||
| oh-my-zsh | plugins `git`, `man`, `sudo` (Esc-Esc to prepend sudo), `colored-man-pages`, `extract`; theme `robbyrussell` |
|
||||
| Autosuggestion | fish-style history suggestions as you type (→ to accept) |
|
||||
| Syntax highlighting | commands coloured by validity as you type |
|
||||
| Completion | menu completion; the dump is rebuilt on every activation (see Maintenance) |
|
||||
| History | 100k in-memory/on-disk, deduped, space-prefixed commands ignored, timestamped, **shared live across sessions** |
|
||||
| History substring search | type a fragment, then ↑/↓ cycles matching past commands — works in foot, iTerm2 and the Linux TTY (both CSI and SS3 arrow encodings bound) |
|
||||
| Prompt | hostname is prefixed when over SSH |
|
||||
|
||||
**Aliases:** `ls`/`ll`/`la`/`lt` → `eza` (icons + git), `cls` → `clear`. git aliases live in git.nix (below).
|
||||
|
||||
## CLI tools
|
||||
|
||||
| Tool | What it gives you |
|
||||
| --- | --- |
|
||||
| `fzf` | `Ctrl-R` fuzzy history, `Ctrl-T` file picker, `Alt-C` fuzzy cd |
|
||||
| `zoxide` | `z <fragment>` jumps to frecent directories |
|
||||
| `direnv` + `nix-direnv` | per-project environments auto-loaded on `cd` (cached Nix dev shells) |
|
||||
| `eza` | modern `ls` (drives the ls aliases) |
|
||||
| `bat` | syntax-highlighting pager; behaves like `cat` when piped |
|
||||
| `nix-index` | `command-not-found`: an unknown command tells you which Nix package provides it (prebuilt DB, no manual indexing) |
|
||||
| `comma` (`,`) | run an uninstalled program once: `, cowsay hi` |
|
||||
| `nh` | nicer `nixos-rebuild`/`home-manager` with diffs; `$NH_FLAKE` set to the repo. No scheduled GC (it could reap paths a running generation still references) — collect garbage manually with `nh clean all` / `nix-collect-garbage -d` |
|
||||
|
||||
## tmux
|
||||
|
||||
**Auto-start:** opening any interactive terminal — foot, iTerm2, the WSL shell, the
|
||||
Linux console — drops you straight into a tmux session named `main` (attach if it
|
||||
exists, else create). Panes run a plain non-login zsh. It deliberately does **not**
|
||||
fire for SSH sessions, VS Code's integrated terminal, already-inside-tmux, or
|
||||
non-interactive shells. Escape hatch: `NO_TMUX=1 <terminal>` opens a bare shell.
|
||||
|
||||
| Setting | Value |
|
||||
| --- | --- |
|
||||
| Mode keys | vi |
|
||||
| Mouse | on |
|
||||
| Scrollback | 500000 lines |
|
||||
| `escape-time` | 10ms (the 500ms default lagged vim's ESC) |
|
||||
| `focus-events` | on (vim autoread) |
|
||||
| `base-index` / `pane-base-index` | 1 |
|
||||
| Splits | `prefix s` vertical, `prefix v` horizontal (stock `%`/`"` unbound) |
|
||||
| Pane nav | `Alt`+arrows (no prefix) |
|
||||
| Terminal | `default-terminal tmux-256color`; truecolor advertised per outer terminal (`foot*`, `xterm-256color`/iTerm2) via `terminal-features … RGB` |
|
||||
| Clipboard | `set-clipboard on`; foot `terminal-features` advertise truecolor/sync/OSC52/title/cursor |
|
||||
|
||||
**Plugins:** `sensible`, `vim-tmux-navigator` (Ctrl-h/j/k/l across vim ↔ tmux),
|
||||
`yank`, `catppuccin` (Mocha statusline), `resurrect` + `continuum`
|
||||
(sessions auto-save and restore across reboots). The statusline draws Nerd-Font
|
||||
glyphs — see Fonts.
|
||||
|
||||
## Fonts
|
||||
|
||||
**JetBrainsMono Nerd Font** is installed on every host (in `common-nixos.nix`,
|
||||
because tmux runs everywhere; the Mac installs it to `/Library/Fonts` via the
|
||||
Darwin config). foot uses it as its main font automatically. iTerm2's font is a
|
||||
GUI setting — set it to *JetBrainsMono Nerd Font* (Settings → Profiles → Text →
|
||||
Font) so the tmux statusline glyphs render instead of `?`.
|
||||
|
||||
## git
|
||||
|
||||
Pager is **delta**. **commitizen** is installed on every host; `cz` defaults to
|
||||
Conventional Commits.
|
||||
|
||||
| Aliases | |
|
||||
| --- | --- |
|
||||
| `st` `co` `sw` `br` `ci` | status / checkout / switch / branch / commit |
|
||||
| `last` `unstage` | last commit / unstage |
|
||||
| `lg` | graph log, all branches |
|
||||
| `cz` `cc` | `git cz <sub>` (e.g. `git cz c`) and `git cc` → commitizen prompt |
|
||||
|
||||
| Behaviour | |
|
||||
| --- | --- |
|
||||
| Pulls | rebase, with autostash + autosquash |
|
||||
| Fetch | prune deleted remote branches |
|
||||
| Conflicts | `zdiff3` (shows the common ancestor) |
|
||||
| Diffs | histogram algorithm, colour-moved |
|
||||
| `rerere` | remembers + replays conflict resolutions |
|
||||
| Commit editor | full diff shown (`commit.verbose`) |
|
||||
| Misc | branches sorted by date, `column.ui = auto`, `help.autocorrect = prompt`, `push.autoSetupRemote` |
|
||||
| Global ignores | `result`, `result-*`, `.direnv`, `*.swp`, `.DS_Store` |
|
||||
| Signing | SSH commit + tag signing (`mkDefault`, so a host without the key in its agent can disable it). Personal email `iam@emmathe.dev`; the work box overrides email + signing. |
|
||||
|
||||
## ssh
|
||||
|
||||
| Feature | Notes |
|
||||
| --- | --- |
|
||||
| ssh-agent | runs on Linux (launchd on macOS); keys added on **first use** so the passphrase is typed once per login session — this also feeds git commit signing |
|
||||
| macOS | `UseKeychain` caches the passphrase in the login keychain (guarded by `IgnoreUnknown`, so a non-Apple `ssh` skips it instead of erroring) |
|
||||
| Gitea remote | `code.emmathe.dev` → `HostName 10.187.1.76` (DNS-override), `Port 30009`, user `git`, dedicated key, `identitiesOnly` |
|
||||
| Defaults | the module's deprecated default block is opted out; equivalents kept under `settings."*"` |
|
||||
|
||||
The **work box keeps its own `~/.ssh/config`** (home-manager's `programs.ssh` is
|
||||
forced off there) but still runs the agent.
|
||||
|
||||
## Maintenance behaviours
|
||||
|
||||
- **zcompdump reset** — `~/.zcompdump*` is removed on every activation, so a stale
|
||||
dump (pointing at `/nix/store` paths a rebuild or a manual GC removed) can't
|
||||
break completion with `_git: function definition file not found`.
|
||||
- **GC** — no scheduled timer; collect garbage deliberately (`nh clean all` /
|
||||
`nix-collect-garbage -d`) when no important session is running.
|
||||
|
||||
## Per-host differences
|
||||
|
||||
| | Personal Linux (sway) | macOS | Work WSL (EDaaS) |
|
||||
| --- | --- | --- | --- |
|
||||
| Auto-tmux | yes (foot/TTY) | yes (iTerm2) | yes (WSL shell) |
|
||||
| git email | `iam@emmathe.dev` | `iam@emmathe.dev` | `…@citrix.com` (work) |
|
||||
| ssh config managed | yes | yes | no (keeps corporate config) |
|
||||
| ssh-agent | yes | launchd | yes (work module) |
|
||||
| GUI / theming (desktop.nix) | yes | no | no |
|
||||
@@ -1,13 +0,0 @@
|
||||
# Base home-manager profile, shared by every host (graphical or headless).
|
||||
# Graphical hosts additionally import ./desktop.nix; the work host imports
|
||||
# ../../system/modules/work/default.nix. See the host table in flake.nix.
|
||||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./shell.nix
|
||||
./git.nix
|
||||
./editor.nix
|
||||
];
|
||||
|
||||
home.stateVersion = "25.05";
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
# Editor: vim as the default $EDITOR. Wanted on every host.
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.vim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
nerdtree
|
||||
ale
|
||||
vim-fugitive
|
||||
vim-indent-guides
|
||||
catppuccin-vim
|
||||
vim-tmux-navigator # Ctrl-h/j/k/l moves between vim splits and tmux panes
|
||||
];
|
||||
settings = {
|
||||
expandtab = false;
|
||||
tabstop = 2;
|
||||
shiftwidth = 2;
|
||||
};
|
||||
extraConfig = ''
|
||||
let g:indent_guides_enable_on_vim_startup = 1
|
||||
syntax enable
|
||||
set termguicolors
|
||||
set background=dark
|
||||
colorscheme catppuccin_mocha
|
||||
au BufNewFile,BufRead *Jenkinsfile setf groovy
|
||||
'';
|
||||
};
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
# Version control: git + delta pager + commitizen. The work host layers
|
||||
# commit signing and an email override on top (see work/default.nix).
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
fullName,
|
||||
...
|
||||
}:
|
||||
{
|
||||
home.packages = [
|
||||
pkgs.commitizen
|
||||
];
|
||||
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitFull;
|
||||
settings = {
|
||||
user.name = fullName;
|
||||
# Personal identity. mkDefault so the work module overrides it on the work
|
||||
# host (and to merge cleanly with that plain definition there).
|
||||
user.email = lib.mkDefault "iam@emmathe.dev";
|
||||
push.autoSetupRemote = true;
|
||||
init.defaultBranch = "main";
|
||||
|
||||
# Rebase-centric pulls (matches the "always a branch, linear history"
|
||||
# workflow); stash/restore and reorder fixups automatically.
|
||||
pull.rebase = true;
|
||||
rebase = {
|
||||
autoStash = true;
|
||||
autoSquash = true;
|
||||
};
|
||||
|
||||
fetch.prune = true; # drop deleted remote-tracking branches
|
||||
merge.conflictStyle = "zdiff3"; # show the common ancestor in conflicts
|
||||
diff = {
|
||||
algorithm = "histogram";
|
||||
colorMoved = "default";
|
||||
};
|
||||
rerere.enabled = true; # remember + replay conflict resolutions
|
||||
commit.verbose = true; # full diff in the commit-message editor
|
||||
branch.sort = "-committerdate"; # most-recent branches first
|
||||
column.ui = "auto";
|
||||
help.autocorrect = "prompt";
|
||||
|
||||
alias = {
|
||||
st = "status";
|
||||
co = "checkout";
|
||||
sw = "switch";
|
||||
br = "branch";
|
||||
ci = "commit";
|
||||
last = "log -1 HEAD";
|
||||
unstage = "reset HEAD --";
|
||||
lg = "log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(auto)%d%C(reset)' --all";
|
||||
# commitizen (Conventional Commits, its default ruleset): `git cz c` ->
|
||||
# `cz commit`, `git cz bump`, etc. `git cc` is a shortcut for the prompt.
|
||||
cz = "!cz";
|
||||
cc = "!cz commit";
|
||||
};
|
||||
|
||||
# SSH commit signing on personal hosts too (the work module sets the same
|
||||
# on the work host). mkDefault so a host without the key in its ssh-agent
|
||||
# can override to false -- otherwise commits there would fail. Reuses the
|
||||
# existing ssh key; a dedicated personal key can be swapped in later.
|
||||
gpg.format = "ssh";
|
||||
user.signingkey = "key::ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAJMVgeRKnfX1G8coU3nAobI485aeUpGTMqH7+zbKI8o emma.thorpe@cloud.com";
|
||||
commit.gpgsign = lib.mkDefault true;
|
||||
tag.gpgsign = lib.mkDefault true;
|
||||
};
|
||||
|
||||
# Global ignore file (~/.config/git/ignore).
|
||||
ignores = [
|
||||
"result"
|
||||
"result-*"
|
||||
".direnv"
|
||||
"*.swp"
|
||||
".DS_Store"
|
||||
];
|
||||
};
|
||||
|
||||
programs.delta = {
|
||||
enable = true;
|
||||
enableGitIntegration = true;
|
||||
};
|
||||
}
|
||||
@@ -1,283 +0,0 @@
|
||||
# Interactive shell: zsh + tmux. Wanted on every host.
|
||||
{
|
||||
lib,
|
||||
pkgs,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
{
|
||||
imports = [
|
||||
# Prebuilt nix-index database -> working command-not-found
|
||||
# ("cmd not found -> which nix package provides it"), no manual indexing.
|
||||
inputs.nix-index-database.homeModules.default
|
||||
];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
enableCompletion = true;
|
||||
enableVteIntegration = true;
|
||||
autosuggestion.enable = true;
|
||||
# Bind Up/Down for history-substring-search in BOTH cursor-key modes: CSI
|
||||
# (^[[A/^[[B -- normal mode, and what the Linux TTY sends) and SS3
|
||||
# (^[OA/^[OB -- application mode, used by foot, tmux and iTerm2). Binding
|
||||
# only the default CSI form leaves it dead at the prompt in foot/iTerm2.
|
||||
historySubstringSearch = {
|
||||
enable = true;
|
||||
searchUpKey = [
|
||||
"^[[A"
|
||||
"^[OA"
|
||||
];
|
||||
searchDownKey = [
|
||||
"^[[B"
|
||||
"^[OB"
|
||||
];
|
||||
};
|
||||
history = {
|
||||
append = true; # append, don't overwrite, on shell exit
|
||||
size = 100000; # in-memory (HISTSIZE)
|
||||
save = 100000; # on-disk (SAVEHIST)
|
||||
ignoreDups = true; # drop consecutive duplicates
|
||||
ignoreSpace = true; # leading-space commands stay out of history
|
||||
expireDuplicatesFirst = true;
|
||||
share = true; # live-share history across sessions
|
||||
extended = true; # record timestamps
|
||||
};
|
||||
oh-my-zsh = {
|
||||
enable = true;
|
||||
plugins = [
|
||||
"git"
|
||||
"man"
|
||||
"sudo" # double-Esc prefixes the last command with sudo
|
||||
"colored-man-pages"
|
||||
"extract" # `extract <archive>` for any format
|
||||
];
|
||||
theme = "robbyrussell";
|
||||
};
|
||||
syntaxHighlighting.enable = true;
|
||||
initContent = lib.mkMerge [
|
||||
# Auto-start tmux in every interactive terminal -- foot, iTerm2, the WSL
|
||||
# shell, the Linux console -- so a new terminal lands straight in the
|
||||
# multiplexer (session "main": attach if present, else create). Panes run
|
||||
# a plain non-login zsh (tmux's default-command "${SHELL}"). Order 200
|
||||
# runs before oh-my-zsh/compinit so the exec replaces the shell before
|
||||
# that setup is wasted. Guards, each preventing a real breakage:
|
||||
# interactive only -> don't hijack scp / `ssh host cmd` / scripted shells
|
||||
# $TMUX empty -> a pane's zsh won't re-exec tmux (infinite loop)
|
||||
# not SSH -> don't force inbound SSH logins into a server tmux
|
||||
# not VS Code -> its integrated terminal manages itself
|
||||
# tmux on PATH -> a failed exec would otherwise kill the login shell
|
||||
# $NO_TMUX unset -> escape hatch: `NO_TMUX=1 <term>` opens a bare shell
|
||||
(lib.mkOrder 200 ''
|
||||
if [[ $- == *i* ]] \
|
||||
&& [[ -z "$TMUX" ]] \
|
||||
&& [[ -z "$NO_TMUX" ]] \
|
||||
&& [[ -z "$SSH_CONNECTION" && -z "$SSH_TTY" ]] \
|
||||
&& [[ "$TERM_PROGRAM" != "vscode" ]] \
|
||||
&& command -v tmux >/dev/null 2>&1; then
|
||||
exec tmux new-session -A -s main
|
||||
fi
|
||||
'')
|
||||
# Prefix the prompt with the hostname over SSH (mkAfter).
|
||||
(lib.mkOrder 1500 ''
|
||||
if [ "$SSH_CLIENT" ] || [ "$SSH_TTY" ]; then
|
||||
export PS1="%M $PS1"
|
||||
fi
|
||||
'')
|
||||
];
|
||||
shellAliases = {
|
||||
# eza's zsh integration also defines these; set explicitly so the
|
||||
# icons/git intent is obvious.
|
||||
ls = "eza --icons --git";
|
||||
ll = "eza --icons --git -l";
|
||||
la = "eza --icons --git -la";
|
||||
lt = "eza --icons --git --tree";
|
||||
cls = "clear";
|
||||
};
|
||||
};
|
||||
|
||||
# Fuzzy finder: Ctrl-R fuzzy history, Ctrl-T files, Alt-C cd.
|
||||
programs.fzf = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
# Frecency directory jumping: `z <fragment>`.
|
||||
programs.zoxide = {
|
||||
enable = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
# Per-project environments auto-loaded on cd, with the Nix dev-shell cache.
|
||||
programs.direnv = {
|
||||
enable = true;
|
||||
nix-direnv.enable = true;
|
||||
};
|
||||
|
||||
# Modern ls (drives the ls aliases above).
|
||||
programs.eza = {
|
||||
enable = true;
|
||||
git = true;
|
||||
icons = "auto"; # boolean form is deprecated
|
||||
};
|
||||
|
||||
# Syntax-highlighting pager, used as `bat` (acts like cat when piped).
|
||||
programs.bat.enable = true;
|
||||
|
||||
# command-not-found backed by the prebuilt nix-index DB (module imported
|
||||
# above). `comma` runs an uninstalled program once: `, cowsay hi`.
|
||||
programs.nix-index.enable = true;
|
||||
programs.nix-index-database.comma.enable = true;
|
||||
|
||||
# Nicer nixos-rebuild/home-manager (diffs) + $NH_FLAKE. No automatic clean:
|
||||
# the scheduled GC's only benefit is reclaiming disk, but it can reap store
|
||||
# paths the current generation still references (notably on nix-darwin, where
|
||||
# it broke completion by removing an in-use oh-my-zsh). GC manually instead:
|
||||
# `nh clean all` / `nix-collect-garbage -d` when nothing important is running.
|
||||
programs.nh = {
|
||||
enable = true;
|
||||
flake = "$HOME/code/nixfiles";
|
||||
};
|
||||
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
reverseSplit = true;
|
||||
# tmux-256color (not tmux-direct): the standard inside-tmux terminfo.
|
||||
# tmux-direct's capabilities desync zsh's line redraw on some terminals
|
||||
# (e.g. iTerm2 -> duplicated chars on Tab, stray newlines). Truecolor is
|
||||
# advertised per outer terminal via the RGB terminal-features below.
|
||||
terminal = "tmux-256color";
|
||||
newSession = true;
|
||||
keyMode = "vi";
|
||||
historyLimit = 500000;
|
||||
mouse = true;
|
||||
escapeTime = 10; # was the 500ms default -> laggy ESC in vim
|
||||
focusEvents = true; # let vim see focus changes (autoread)
|
||||
baseIndex = 1; # sets both base-index and pane-base-index
|
||||
|
||||
plugins = with pkgs.tmuxPlugins; [
|
||||
sensible
|
||||
vim-tmux-navigator # Ctrl-h/j/k/l across vim splits and tmux panes
|
||||
yank
|
||||
{
|
||||
# Catppuccin Mocha statusline (v2 API: flavour + window options must be
|
||||
# set before the plugin loads, which home-manager does for plugin
|
||||
# extraConfig; the status modules below go in the main extraConfig,
|
||||
# which HM appends after all plugins).
|
||||
plugin = catppuccin;
|
||||
extraConfig = ''
|
||||
set -g @catppuccin_flavor 'mocha'
|
||||
set -g @catppuccin_window_status_style 'rounded'
|
||||
'';
|
||||
}
|
||||
resurrect # save/restore sessions
|
||||
{
|
||||
plugin = continuum; # auto-save + restore on tmux start (after resurrect)
|
||||
extraConfig = ''
|
||||
set -g @continuum-restore 'on'
|
||||
'';
|
||||
}
|
||||
];
|
||||
# `reverseSplit = true` already binds s -> vertical and v -> horizontal
|
||||
# split (the dotfiles' vim-style splits).
|
||||
extraConfig = ''
|
||||
# Run a non-login shell in new panes/windows.
|
||||
set -g default-command "''${SHELL}"
|
||||
|
||||
# Drop the stock split keys in favour of the s/v binds above.
|
||||
unbind %
|
||||
unbind '"'
|
||||
|
||||
# Alt+Arrow pane navigation
|
||||
bind -n M-Left select-pane -L
|
||||
bind -n M-Right select-pane -R
|
||||
bind -n M-Up select-pane -U
|
||||
bind -n M-Down select-pane -D
|
||||
|
||||
# Truecolor for the outer terminals (foot reports xterm-ish too; iTerm2 is
|
||||
# xterm-256color). Without this, with tmux-256color as default-terminal,
|
||||
# 24-bit colour would be quantised to 256.
|
||||
set -as terminal-features ",xterm-256color:RGB"
|
||||
# Tell tmux which capabilities the foot terminal supports, so truecolor,
|
||||
# synchronised output, the system clipboard (OSC 52), window titles and
|
||||
# cursor styling all pass through.
|
||||
set -as terminal-features ",foot*:RGB"
|
||||
set -as terminal-features ",foot*:sync"
|
||||
set -as terminal-features ",foot*:clipboard"
|
||||
set -as terminal-features ",foot*:title"
|
||||
set -as terminal-features ",foot*:ccolour"
|
||||
set -as terminal-features ",foot*:cstyle"
|
||||
|
||||
# No home-manager options for these.
|
||||
set -g renumber-windows on
|
||||
set -g set-clipboard on
|
||||
|
||||
# Catppuccin v2 statusline. Must run after the plugin has loaded;
|
||||
# home-manager appends this extraConfig after the whole plugin list.
|
||||
set -g status-left-length 100
|
||||
set -g status-right-length 100
|
||||
set -g status-left ""
|
||||
set -g status-right "#{E:@catppuccin_status_application}"
|
||||
set -ag status-right "#{E:@catppuccin_status_session}"
|
||||
'';
|
||||
};
|
||||
|
||||
# Add the key to the agent on first use, so the passphrase is typed once per
|
||||
# login session rather than per commit/push (commit signing uses this agent).
|
||||
# The work box keeps its own ssh config (see work/default.nix), so this only
|
||||
# manages ~/.ssh/config on the personal hosts.
|
||||
programs.ssh = {
|
||||
enable = true;
|
||||
# The module's built-in default "*" block is being deprecated; opt out and
|
||||
# carry the defaults we want ourselves under settings."*".
|
||||
enableDefaultConfig = false;
|
||||
settings = {
|
||||
# Global defaults (rendered last, as ssh_config wants). AddKeysToAgent
|
||||
# adds the key on first use so the passphrase is typed once per session.
|
||||
"*" = {
|
||||
AddKeysToAgent = "yes";
|
||||
ForwardAgent = false;
|
||||
Compression = false;
|
||||
ServerAliveInterval = 0;
|
||||
ServerAliveCountMax = 3;
|
||||
HashKnownHosts = false;
|
||||
UserKnownHostsFile = "~/.ssh/known_hosts";
|
||||
ControlMaster = "no";
|
||||
ControlPath = "~/.ssh/master-%r@%n:%p";
|
||||
ControlPersist = "no";
|
||||
}
|
||||
# macOS: also cache the passphrase in the login keychain. UseKeychain
|
||||
# exists only in Apple's ssh; nixpkgs' openssh (which may be the `ssh` on
|
||||
# PATH) rejects it as "Bad configuration option". IgnoreUnknown (emitted
|
||||
# first by the module) makes any non-Apple ssh skip it instead of erroring,
|
||||
# while Apple's ssh still honours it. Darwin-only.
|
||||
// lib.optionalAttrs pkgs.stdenv.hostPlatform.isDarwin {
|
||||
IgnoreUnknown = "UseKeychain";
|
||||
UseKeychain = "yes";
|
||||
};
|
||||
# Gitea remote (the flake's origin) -- required on every host. HostName
|
||||
# pins the IP so it resolves without DNS. Port 30009 is non-default; pin
|
||||
# the dedicated key (identitiesOnly avoids "too many authentication
|
||||
# failures" when the agent holds several keys).
|
||||
"code.emmathe.dev" = {
|
||||
HostName = "10.187.1.76";
|
||||
User = "git";
|
||||
Port = 30009;
|
||||
IdentityFile = "~/.ssh/code.emmathe.dev";
|
||||
IdentitiesOnly = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# Run a user ssh-agent on Linux (macOS provides one via launchd). EDaaS also
|
||||
# enables this in the work module; both being true merges cleanly.
|
||||
services.ssh-agent.enable = lib.mkIf pkgs.stdenv.hostPlatform.isLinux true;
|
||||
|
||||
# Drop the zsh completion dump on every activation. A stale ~/.zcompdump
|
||||
# caches /nix/store paths to completion functions; once a rebuild or a manual
|
||||
# GC removes them, compinit fails with "_git: function definition file not
|
||||
# found" for every completion. Deleting it forces a fresh rebuild from the
|
||||
# current fpath on the next shell.
|
||||
home.activation.resetZcompdump = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
|
||||
$DRY_RUN_CMD rm -f "$HOME"/.zcompdump* "''${XDG_CACHE_HOME:-$HOME/.cache}"/zsh/.zcompdump* 2>/dev/null || true
|
||||
'';
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
username,
|
||||
fullName,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.zsh.enable = true;
|
||||
users.users.${username} = {
|
||||
isNormalUser = true;
|
||||
home = "/home/${username}";
|
||||
description = fullName;
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"docker"
|
||||
];
|
||||
shell = pkgs.zsh;
|
||||
};
|
||||
programs.firefox = lib.mkIf (config.features.swayDesktop.enable == true) {
|
||||
enable = true;
|
||||
};
|
||||
programs.thunderbird = lib.mkIf (config.features.swayDesktop.enable == true) {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
# Options shared by every NixOS host (laptops and the WSL box). Imported via
|
||||
# baseModules in flake.nix. Host- and platform-specific settings stay in the
|
||||
# per-machine configs; laptop-only settings live in ./laptop.nix.
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
time.timeZone = "Europe/London";
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
# Store hygiene. auto-optimise-store hard-links identical files in the store
|
||||
# after each build (cheap dedupe; NOT a garbage collector -- there is
|
||||
# deliberately no automatic GC timer). The larger download buffer avoids
|
||||
# "buffer full" stalls when fetching big NARs over a fast link.
|
||||
nix.settings.auto-optimise-store = true;
|
||||
nix.settings.download-buffer-size = 134217728; # 128 MiB
|
||||
|
||||
# Extra binary cache for the nix-community toolchain (home-manager, nixvim,
|
||||
# treefmt, ...). Merges with any host-specific caches (e.g. the Asahi cache on
|
||||
# the MBP) rather than replacing them.
|
||||
nix.settings.substituters = [ "https://nix-community.cachix.org" ];
|
||||
nix.settings.trusted-public-keys = [
|
||||
"nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs="
|
||||
];
|
||||
|
||||
# Run dynamically-linked foreign binaries (VS Code remote server, prebuilt
|
||||
# toolchains, language-server downloads) on every NixOS host, not just WSL.
|
||||
programs.nix-ld.enable = true;
|
||||
|
||||
# Memory-safe sudo. The two modules assert against being enabled together;
|
||||
# this one sets `security.sudo.enable = false` via mkDefault, so it is a
|
||||
# straight swap and not an addition.
|
||||
#
|
||||
# Safe here because this fleet only ever uses the stock policy -- wheel may
|
||||
# run anything, with a password -- which sudo-rs implements completely. It
|
||||
# does not cover the more exotic sudoers surface (host aliases, LDAP/SSSD
|
||||
# sudoers, most `Defaults` settings, `sudoreplay`); adding any of those means
|
||||
# going back to `security.sudo`.
|
||||
#
|
||||
# Recovery if a host ever refuses to escalate: get a root shell without sudo
|
||||
# (`wsl -u root -d NixOS` on the WSL box, the console or a serial/HDMI login
|
||||
# elsewhere) and roll back -- `nixos-rebuild switch --rollback`, or pick the
|
||||
# previous generation from the boot menu.
|
||||
security.sudo-rs.enable = true;
|
||||
|
||||
# Minimal system-level CLI available before the home-manager profile loads
|
||||
# (e.g. early boot / rescue). User-level tooling lives in home-manager.
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
fastfetch
|
||||
];
|
||||
|
||||
# Fonts on every host. The Nerd Font carries the powerline/Nerd glyphs the
|
||||
# tmux statusline uses (foot names it explicitly in home/sway.nix); Noto sans +
|
||||
# colour emoji prevent tofu in terminals/TUIs/Firefox -- important on the WSL
|
||||
# box, which does not pull the graphical hosts' default Noto stack. The Mac
|
||||
# installs the Nerd Font via the Darwin config.
|
||||
fonts.packages = with pkgs; [
|
||||
nerd-fonts.jetbrains-mono
|
||||
noto-fonts
|
||||
noto-fonts-color-emoji
|
||||
];
|
||||
# Map the generic fontconfig families so anything asking for "monospace" gets
|
||||
# the Nerd Font (with emoji fallback), not DejaVu.
|
||||
fonts.fontconfig.defaultFonts = {
|
||||
monospace = [
|
||||
"JetBrainsMono Nerd Font"
|
||||
"Noto Color Emoji"
|
||||
];
|
||||
sansSerif = [
|
||||
"Noto Sans"
|
||||
"Noto Color Emoji"
|
||||
];
|
||||
serif = [
|
||||
"Noto Serif"
|
||||
"Noto Color Emoji"
|
||||
];
|
||||
emoji = [ "Noto Color Emoji" ];
|
||||
};
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
# shared ./workstation.nix base and swaps the mobile Wi-Fi backend for wired
|
||||
# NetworkManager. A desktop host also sets `portable = false` in its host-table
|
||||
# entry (flake.nix), which drops the battery block and brightness keybindings
|
||||
# from the Sway bar -- see lyrathorpe/home/sway.nix.
|
||||
# from the Sway bar -- see home/sway.nix.
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./workstation.nix ];
|
||||
@@ -0,0 +1,77 @@
|
||||
# Feature-flag option declarations shared by every NixOS host (imported via
|
||||
# baseModules in flake.nix). Declaring the flags here -- rather than inside the
|
||||
# module that implements them -- means a host can read or set a flag without
|
||||
# importing the (often large) implementation module. In particular,
|
||||
# features.swayDesktop.enable is read by modules/users.nix on every host, but a
|
||||
# headless host (e.g. the Pi) must be able to leave it at its default without
|
||||
# pulling in modules/sway.nix. The implementation lives in modules/sway.nix,
|
||||
# gated on this flag.
|
||||
#
|
||||
# The file also carries the host capability facts those flags derive from
|
||||
# (features.cpu.*). features.claudeCode.enable is such a derived flag: it is
|
||||
# computed from the declared CPU level here and read by home/claude.nix through
|
||||
# home-manager's osConfig, so a machine that cannot run the tool never installs
|
||||
# it, on any host, without per-host opt-outs.
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
cfg = config.features;
|
||||
|
||||
# Claude Code runs on Node, whose V8 build requires SSE4.2 and POPCNT -- the
|
||||
# x86-64-v2 feature set. On an older x86_64 CPU it does not run (illegal
|
||||
# instruction), so it must not be installed there.
|
||||
claudeCodeMinLevel = 2;
|
||||
claudeCodeSupported =
|
||||
!pkgs.stdenv.hostPlatform.isx86_64 || cfg.cpu.microarchLevel >= claudeCodeMinLevel;
|
||||
in
|
||||
{
|
||||
options.features = {
|
||||
swayDesktop.enable = lib.mkEnableOption "the Sway desktop";
|
||||
|
||||
cpu.microarchLevel = lib.mkOption {
|
||||
type = lib.types.ints.between 1 4;
|
||||
default = 2;
|
||||
example = 1;
|
||||
description = ''
|
||||
The x86-64 psABI microarchitecture level the host CPU implements:
|
||||
1 = the original baseline, 2 = SSE4.2/POPCNT (Nehalem, 2008+),
|
||||
3 = AVX2, 4 = AVX-512.
|
||||
|
||||
Nix cannot detect this (evaluation is pure and hosts are often built
|
||||
elsewhere), so a machine older than the default declares its own level
|
||||
and the flags below derive from it. Ignored on non-x86_64 hosts.
|
||||
'';
|
||||
};
|
||||
|
||||
claudeCode.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = claudeCodeSupported;
|
||||
defaultText = lib.literalMD ''
|
||||
`true`, unless the host declares an x86-64 microarchitecture level
|
||||
below ${toString claudeCodeMinLevel}
|
||||
'';
|
||||
description = ''
|
||||
Whether to install Claude Code in this host's home-manager profiles
|
||||
(implemented in home/claude.nix). Defaults off on CPUs below
|
||||
x86-64-v${toString claudeCodeMinLevel}, which cannot run it; forcing it
|
||||
on such a host is an evaluation error.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config.assertions = [
|
||||
{
|
||||
assertion = cfg.claudeCode.enable -> claudeCodeSupported;
|
||||
message = ''
|
||||
features.claudeCode.enable is on, but this host declares
|
||||
features.cpu.microarchLevel = ${toString cfg.cpu.microarchLevel}.
|
||||
Claude Code needs x86-64-v${toString claudeCodeMinLevel}
|
||||
(SSE4.2/POPCNT) and will not run on an older CPU.
|
||||
'';
|
||||
}
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
# Portable NixOS hosts (X1, MBP-Asahi). Imported from the host table in
|
||||
# flake.nix. Shared graphical-workstation settings live in ./workstation.nix;
|
||||
# the only laptop-specific bit is the Wi-Fi backend. Mobile home-manager
|
||||
# components (battery block, brightness keys) are gated by the `portable` flag
|
||||
# threaded through mkHost -- see home/sway.nix.
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./workstation.nix ];
|
||||
|
||||
# Wi-Fi via iwd with its built-in DHCP/network configuration.
|
||||
networking.wireless.iwd = {
|
||||
enable = true;
|
||||
settings.General.EnableNetworkConfiguration = true;
|
||||
};
|
||||
|
||||
# Lid behaviour: suspend on battery, lock on external power (swayidle's
|
||||
# before-sleep hook locks before the suspend completes either way).
|
||||
services.logind.settings.Login = {
|
||||
HandleLidSwitch = "suspend";
|
||||
HandleLidSwitchExternalPower = "lock";
|
||||
};
|
||||
|
||||
# Bluetooth. The Asahi MBP loads Apple's BT firmware (see its host config) and
|
||||
# the T400 has an optional BT module; enable bluez on both, with blueman as the
|
||||
# GUI/tray manager for the Sway session.
|
||||
hardware.bluetooth = {
|
||||
enable = true;
|
||||
powerOnBoot = true;
|
||||
};
|
||||
services.blueman.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
# sshd for the hosts that run it (T400, Mac Pro, RPi5): enable the daemon, open
|
||||
# port 22, and apply a key-only policy. Authorized keys are owned per-user by the
|
||||
# registry (modules/users.nix), not here.
|
||||
{ ... }:
|
||||
{
|
||||
services.openssh.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
|
||||
services.openssh.settings = {
|
||||
PasswordAuthentication = false; # keys only
|
||||
KbdInteractiveAuthentication = false; # no keyboard-interactive fallback
|
||||
PermitRootLogin = "no";
|
||||
};
|
||||
}
|
||||
@@ -7,13 +7,13 @@
|
||||
|
||||
let
|
||||
cfg = config.features.swayDesktop;
|
||||
# Catppuccin Mocha (shared with the Sway desktop, see lyrathorpe/home/sway.nix).
|
||||
ctp = import ./catppuccin-mocha.nix;
|
||||
# Catppuccin Mocha (shared with the Sway desktop, see home/sway.nix).
|
||||
ctp = import ../lib/catppuccin-mocha.nix;
|
||||
in
|
||||
{
|
||||
options = {
|
||||
features.swayDesktop.enable = lib.mkEnableOption "Enable Sway Desktop";
|
||||
};
|
||||
# The features.swayDesktop.enable option is declared in
|
||||
# modules/features.nix (so headless hosts can read/set it without
|
||||
# importing this module). This module only provides its implementation.
|
||||
config = lib.mkIf cfg.enable {
|
||||
programs.sway = {
|
||||
enable = true;
|
||||
@@ -0,0 +1,38 @@
|
||||
# System user accounts, built from the registry (users/registry.nix) for the
|
||||
# host's `hostUsers` set. See README "Users".
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
hostUsers,
|
||||
userRegistry,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
programs.zsh.enable = true;
|
||||
|
||||
users.users = lib.mapAttrs (
|
||||
name: spec:
|
||||
let
|
||||
id = userRegistry.${name};
|
||||
in
|
||||
{
|
||||
isNormalUser = true;
|
||||
home = "/home/${name}";
|
||||
description = id.fullName;
|
||||
inherit (id) extraGroups;
|
||||
openssh.authorizedKeys.keys = id.sshAuthorizedKeys;
|
||||
shell = pkgs.zsh;
|
||||
}
|
||||
# linger opt-in (host table); left unmanaged when unset.
|
||||
// lib.optionalAttrs (spec ? linger) { inherit (spec) linger; }
|
||||
) hostUsers;
|
||||
|
||||
programs.firefox = lib.mkIf config.features.swayDesktop.enable {
|
||||
enable = true;
|
||||
};
|
||||
programs.thunderbird = lib.mkIf config.features.swayDesktop.enable {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
# Form-factor-agnostic base for the physical graphical NixOS machines. Imported
|
||||
# by both ./laptop.nix and ./desktop.nix; those add only the bits that differ
|
||||
# between portable and desktop hosts (chiefly the networking backend).
|
||||
#
|
||||
# The bootloader is NOT set here -- it is firmware-specific, not form-factor:
|
||||
# UEFI hosts (MBP, Mac Pro 3,1) use systemd-boot, the BIOS-only T400 uses GRUB.
|
||||
# Each machine config declares its own.
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
features.swayDesktop.enable = true;
|
||||
|
||||
console.keyMap = "dvorak";
|
||||
|
||||
# Intel thermal management. x86 only -- the Asahi MBP governs its own SoC
|
||||
# thermals, and thermald is an Intel-platform daemon.
|
||||
services.thermald.enable = lib.mkIf pkgs.stdenv.hostPlatform.isx86_64 true;
|
||||
|
||||
# Default-deny inbound. Hosts that run a listening service open their own
|
||||
# ports next to where the service is enabled (e.g. sshd -> 22 on X1).
|
||||
networking.firewall.enable = true;
|
||||
|
||||
# Disk hygiene for the physical hosts. fstrim reclaims unused SSD blocks on a
|
||||
# weekly timer; cleanOnBoot wipes /tmp at every boot.
|
||||
services.fstrim.enable = true;
|
||||
boot.tmp.cleanOnBoot = true;
|
||||
|
||||
# Userspace OOM killer: act on memory pressure early instead of letting the
|
||||
# kernel OOM-thrash. Matters on the 4 GiB T400 and the elderly Mac Pro.
|
||||
services.earlyoom.enable = true;
|
||||
|
||||
# Firmware updates via LVFS. No-op on the Asahi MBP (Apple-managed firmware),
|
||||
# useful for UEFI/SSD updates on the x86 hosts.
|
||||
services.fwupd.enable = true;
|
||||
|
||||
# Audio. PipeWire with the PulseAudio shim covers every graphical host; no
|
||||
# per-machine audio config is needed.
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# swaylock PAM stack. None of these machines has working fingerprint auth, so
|
||||
# an empty service is enough -- swaylock falls back to password.
|
||||
security.pam.services.swaylock = { };
|
||||
|
||||
# Redistributable firmware (GPU/Wi-Fi/NIC blobs) for the x86 hosts. Harmless
|
||||
# on the Asahi MBP, which supplies its own peripheral firmware out-of-band.
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
# statix lint config. Two default lints are disabled because they flag this
|
||||
# repo's intentional house style, not bugs:
|
||||
# repeated_keys - we use `foo.a = ...; foo.b = ...;` (dotted) over nesting.
|
||||
# empty_pattern - module files use `{ ... }:` / `{ }:` deliberately.
|
||||
disabled = [
|
||||
"repeated_keys",
|
||||
"empty_pattern",
|
||||
]
|
||||
@@ -1,60 +0,0 @@
|
||||
# Mac Pro 3,1 (Early 2008) — install notes
|
||||
|
||||
Flake host: `lyrathorpe-macpro31`. Desktop (`portable = false`, imports
|
||||
`../../modules/desktop.nix`). Files: `configuration.nix`,
|
||||
`hardware-configuration.nix`.
|
||||
|
||||
## Hardware configuration
|
||||
|
||||
`hardware-configuration.nix` here is a hand-written **placeholder**. On the real
|
||||
machine, run `nixos-generate-config`, replace the file, and commit it. It assumes
|
||||
by-label partitions — ESP `ESP` (vfat, mounted at `/boot`), root `nixos` (ext4),
|
||||
and `swap` — so either label them at install time or swap in the generated UUIDs.
|
||||
|
||||
## Bootloader
|
||||
|
||||
The Mac Pro 3,1 has **64-bit EFI**, so it uses **systemd-boot** (no GRUB/CSM
|
||||
shim). `canTouchEfiVariables = false` because Apple's firmware does not reliably
|
||||
accept `efibootmgr` NVRAM writes.
|
||||
|
||||
Apple-EFI quirk: if the firmware boot picker does not show NixOS after install,
|
||||
either
|
||||
|
||||
- uncomment `boot.loader.efi.efiInstallAsRemovable = true;` in
|
||||
`configuration.nix` (installs the fallback `\EFI\BOOT\BOOTX64.EFI`), and/or
|
||||
- "bless" the ESP from macOS.
|
||||
|
||||
Partition the disk GPT with an ESP (vfat).
|
||||
|
||||
## Graphics
|
||||
|
||||
The stock card varies between units — **ATI Radeon HD 2600 XT** or **NVIDIA
|
||||
GeForce 8800 GT**. No proprietary driver is hardcoded; Sway relies on in-tree KMS:
|
||||
|
||||
- ATI Radeon HD 2600 XT → `radeon` (or `amdgpu`) KMS
|
||||
- NVIDIA GeForce 8800 GT → `nouveau` KMS
|
||||
|
||||
These come up automatically. If a card needs forcing, set
|
||||
`services.xserver.videoDrivers` and/or add the module to
|
||||
`boot.initrd.kernelModules` for early KMS (see the comment in
|
||||
`configuration.nix`).
|
||||
|
||||
## Networking
|
||||
|
||||
Wired Ethernet via NetworkManager (from `desktop.nix`) — the Mac Pro has two
|
||||
gigabit ports.
|
||||
|
||||
## Login
|
||||
|
||||
Graphical login via a Wayland greeter — `greetd` running ReGreet inside the
|
||||
`cage` kiosk compositor — configured centrally in `lyrathorpe/swaywm.nix` for
|
||||
every Sway host (gated on `features.swayDesktop.enable`). The greeter is forced
|
||||
to the Dvorak layout to match the console and Sway session. Set the user
|
||||
password (`passwd lyrathorpe`) after install, or the greeter cannot
|
||||
authenticate. Requires working KMS (radeon/nouveau — see Graphics).
|
||||
|
||||
## Apply
|
||||
|
||||
```sh
|
||||
sudo nixos-rebuild switch --flake .#lyrathorpe-macpro31
|
||||
```
|
||||
@@ -1,58 +0,0 @@
|
||||
# Apple Mac Pro 3,1 (Early 2008, dual Xeon Harpertown, x86_64). Desktop host:
|
||||
# shared graphical/wired options live in ../../modules/desktop.nix; only
|
||||
# host-specific settings are here. Install notes (EFI booting, GPU, partitions):
|
||||
# see ./README.md.
|
||||
{ ... }:
|
||||
|
||||
{
|
||||
imports = [
|
||||
./hardware-configuration.nix
|
||||
];
|
||||
|
||||
# The Mac Pro 3,1 has 64-bit EFI (confirmed by the owner), so boot via
|
||||
# systemd-boot like the MBP -- no GRUB/BIOS shim needed.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
# Apple's EFI does not reliably support efibootmgr NVRAM writes; leave the
|
||||
# firmware vars untouched.
|
||||
boot.loader.efi.canTouchEfiVariables = false;
|
||||
# Apple-EFI quirk: if the Mac does not pick up the bootloader at the boot
|
||||
# picker, install it to the fallback path \EFI\BOOT\BOOTX64.EFI and/or
|
||||
# "bless" the ESP from macOS. Uncomment to write the removable fallback path:
|
||||
# boot.loader.efi.efiInstallAsRemovable = true;
|
||||
|
||||
networking.hostName = "MacPro31-NixOS";
|
||||
|
||||
# This host accepts SSH, so open 22 (the firewall itself is enabled in
|
||||
# workstation.nix with a default-deny policy).
|
||||
services.openssh.enable = true;
|
||||
networking.firewall.allowedTCPPorts = [ 22 ];
|
||||
|
||||
services.pipewire = {
|
||||
enable = true;
|
||||
pulse.enable = true;
|
||||
};
|
||||
|
||||
# No fingerprint hardware; empty service still lets swaylock authenticate via
|
||||
# password.
|
||||
security.pam.services.swaylock = { };
|
||||
|
||||
# Dual Harpertown Xeon microcode + redistributable firmware (e.g. GPU/NIC
|
||||
# blobs).
|
||||
hardware.cpu.intel.updateMicrocode = true;
|
||||
hardware.enableRedistributableFirmware = true;
|
||||
|
||||
# GPU note: the stock card varies between units -- ATI Radeon HD 2600 XT or
|
||||
# NVIDIA GeForce 8800 GT. Sway needs a working KMS/modesetting driver; do NOT
|
||||
# install a proprietary blob here. Depending on the installed card, rely on
|
||||
# the open kernel driver:
|
||||
# - ATI Radeon HD 2600 XT -> "radeon" (older) or "amdgpu" KMS
|
||||
# - NVIDIA GeForce 8800 GT -> "nouveau" KMS
|
||||
# These come up automatically via the in-tree drivers + KMS, and the graphics
|
||||
# stack itself is enabled by swaywm.nix. If a card needs to be forced, add it
|
||||
# here, e.g. `services.xserver.videoDrivers = [ "radeon" ];` (or "nouveau"),
|
||||
# and/or `boot.initrd.kernelModules = [ "radeon" ];` in
|
||||
# hardware-configuration.nix for early KMS.
|
||||
|
||||
# See `man configuration.nix` / the stateVersion docs before changing.
|
||||
system.stateVersion = "26.05";
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
# ThinkPad T400 — install notes
|
||||
|
||||
Flake host: `lyrathorpe-t400`. Files: `configuration.nix`, the `boot-*.nix`
|
||||
variants, and `hardware-configuration.nix`.
|
||||
|
||||
## Hardware configuration
|
||||
|
||||
`hardware-configuration.nix` here is a hand-written **placeholder**. On the real
|
||||
machine, run `nixos-generate-config`, replace the file, and commit it. It assumes
|
||||
by-label partitions — root `nixos` (ext4) and `swap` — so either label them at
|
||||
install time or swap in the generated UUIDs.
|
||||
|
||||
## Bootloader — import the module matching the flashed firmware
|
||||
|
||||
`configuration.nix` imports exactly one boot module. Default is `boot-bios.nix`;
|
||||
switch by commenting it out and uncommenting the relevant alternative.
|
||||
|
||||
| Firmware | Module | Notes |
|
||||
| --- | --- | --- |
|
||||
| Stock Lenovo BIOS, or coreboot + **SeaBIOS** payload | `boot-bios.nix` | GRUB on the MBR. Set `device` to the real install disk (`/dev/sda` by default). MBR/legacy layout. |
|
||||
| coreboot + **GRUB** payload | `boot-coreboot-grub.nix` | GRUB is config-only (`device = "nodev"`); NixOS does **not** write to a disk. Your coreboot `grub.cfg` (in the flash chip) must `search` for and `configfile` the on-disk `/boot/grub/grub.cfg`, or chainload the disk's GRUB. |
|
||||
| coreboot + **Tianocore/edk2 (UEFI)** payload | `boot-coreboot-uefi.nix` | systemd-boot. `canTouchEfiVariables = true` (coreboot honours NVRAM writes). The module **declares its own ESP** (`/boot` vfat, label `ESP`) — when you regenerate `hardware-configuration.nix`, do **not** let it also define `/boot`. Create + label an `ESP` vfat partition (GPT). |
|
||||
|
||||
## Graphics
|
||||
|
||||
This unit has the optional **discrete ATI Mobility Radeon HD 3470 (RV620)**. The
|
||||
open `radeon` KMS driver is loaded in the initrd for early modesetting; firmware
|
||||
comes from `enableRedistributableFirmware`.
|
||||
|
||||
The T400 has switchable graphics (discrete ATI + Intel GMA 4500MHD). Select
|
||||
**Discrete** in the firmware's graphics setting so only the ATI is live. If you
|
||||
run **Integrated** instead, the Intel `i915` driver takes over with no config
|
||||
change and `radeon` stays idle.
|
||||
|
||||
## Login
|
||||
|
||||
Graphical login via a Wayland greeter — `greetd` running ReGreet inside the
|
||||
`cage` kiosk compositor — configured centrally in `lyrathorpe/swaywm.nix` for
|
||||
every Sway host (gated on `features.swayDesktop.enable`). The greeter is forced
|
||||
to the Dvorak layout to match the console and Sway session. Set the user
|
||||
password (`passwd lyrathorpe`) after install, or the greeter cannot
|
||||
authenticate. Requires working radeon/i915 KMS (see Graphics).
|
||||
|
||||
## Apply
|
||||
|
||||
```sh
|
||||
sudo nixos-rebuild switch --flake .#lyrathorpe-t400
|
||||
```
|
||||
@@ -1,21 +0,0 @@
|
||||
# Options shared by every NixOS host (laptops and the WSL box). Imported via
|
||||
# baseModules in flake.nix. Host- and platform-specific settings stay in the
|
||||
# per-machine configs; laptop-only settings live in ./laptop.nix.
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
time.timeZone = "Europe/London";
|
||||
i18n.defaultLocale = "en_GB.UTF-8";
|
||||
|
||||
# Minimal system-level CLI available before the home-manager profile loads
|
||||
# (e.g. early boot / rescue). User-level tooling lives in home-manager.
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
fastfetch
|
||||
];
|
||||
|
||||
# Terminal font with powerline/Nerd glyphs. Installed on every host because
|
||||
# the tmux statusline (which uses these glyphs) runs everywhere, not just on
|
||||
# the Sway/graphical hosts. foot names it explicitly (home/sway.nix); the Mac
|
||||
# installs it via the Darwin config.
|
||||
fonts.packages = [ pkgs.nerd-fonts.jetbrains-mono ];
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
# Portable NixOS hosts (X1, MBP-Asahi). Imported from the host table in
|
||||
# flake.nix. Shared graphical-workstation settings live in ./workstation.nix;
|
||||
# the only laptop-specific bit is the Wi-Fi backend. Mobile home-manager
|
||||
# components (battery block, brightness keys) are gated by the `portable` flag
|
||||
# threaded through mkHost -- see lyrathorpe/home/sway.nix.
|
||||
{ ... }:
|
||||
{
|
||||
imports = [ ./workstation.nix ];
|
||||
|
||||
# Wi-Fi via iwd with its built-in DHCP/network configuration.
|
||||
networking.wireless.iwd = {
|
||||
enable = true;
|
||||
settings.General.EnableNetworkConfiguration = true;
|
||||
};
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
{ pkgs, lib, ... }:
|
||||
|
||||
{
|
||||
# The work box keeps its own (corporate) ~/.ssh/config; don't let the personal
|
||||
# programs.ssh (shell.nix) take it over. The ssh-agent below still runs.
|
||||
programs.ssh.enable = lib.mkForce false;
|
||||
|
||||
programs.git = {
|
||||
settings = {
|
||||
commit.gpgsign = true;
|
||||
tag.gpgsign = true;
|
||||
gpg.format = "ssh";
|
||||
user.signingkey = "key::ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAJMVgeRKnfX1G8coU3nAobI485aeUpGTMqH7+zbKI8o emma.thorpe@cloud.com";
|
||||
user.email = "emma.thorpe@citrix.com";
|
||||
};
|
||||
};
|
||||
home.packages = [
|
||||
pkgs.kubectl
|
||||
pkgs.argo-rollouts
|
||||
pkgs.tenv
|
||||
pkgs.kubernetes-helm
|
||||
pkgs.azure-cli
|
||||
pkgs.kubelogin
|
||||
pkgs.curl
|
||||
pkgs.notation
|
||||
pkgs.powershell
|
||||
pkgs.nuget
|
||||
pkgs.gedit
|
||||
pkgs.lens
|
||||
pkgs.python3
|
||||
pkgs.gnumake
|
||||
pkgs.gcc
|
||||
pkgs.libiconv
|
||||
pkgs.autoconf
|
||||
pkgs.automake
|
||||
pkgs.pkg-config
|
||||
pkgs.wget
|
||||
pkgs.claude-code
|
||||
pkgs.google-cloud-sdk
|
||||
];
|
||||
services.ssh-agent.enable = true;
|
||||
home.shellAliases = {
|
||||
docker = "/run/current-system/sw/bin/docker";
|
||||
};
|
||||
programs.tmux = {
|
||||
extraConfig = ''
|
||||
set -g status-right "#(/run/current-system/sw/bin/bash $HOME/code/kube-tmux/kube.tmux 250 red black)"
|
||||
'';
|
||||
};
|
||||
programs.go = {
|
||||
enable = true;
|
||||
};
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
# Form-factor-agnostic base for the physical graphical NixOS machines. Imported
|
||||
# by both ./laptop.nix and ./desktop.nix; those add only the bits that differ
|
||||
# between portable and desktop hosts (chiefly the networking backend).
|
||||
#
|
||||
# The bootloader is NOT set here -- it is firmware-specific, not form-factor:
|
||||
# UEFI hosts (MBP, Mac Pro 3,1) use systemd-boot, the BIOS-only T400 uses GRUB.
|
||||
# Each machine config declares its own.
|
||||
{ ... }:
|
||||
{
|
||||
features.swayDesktop.enable = true;
|
||||
|
||||
console.keyMap = "dvorak";
|
||||
|
||||
# Default-deny inbound. Hosts that run a listening service open their own
|
||||
# ports next to where the service is enabled (e.g. sshd -> 22 on X1).
|
||||
networking.firewall.enable = true;
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
# Daily automated review and triage of Renovate dependency PRs awaiting Emma's
|
||||
# review.
|
||||
#
|
||||
# Host-scoped: imported only from work.nix (the EDaaS/WSL host), so the timer
|
||||
# exists on this machine alone. A systemd *user* timer runs Claude Code headless
|
||||
# once a day; it queries GitHub via the project-scoped github MCP server and
|
||||
# writes a risk-graded summary to the journal (read with
|
||||
# `journalctl --user -u renovate-review`).
|
||||
#
|
||||
# Triage policy:
|
||||
# * PRs that are clearly low risk (patch/minor bumps to tooling, infra, test
|
||||
# or framework libs; symmetric diff; CI green; no application logic) AND not
|
||||
# already approved are AUTO-APPROVED headlessly. These repos enable Renovate
|
||||
# automerge, so an approval lets the PR merge itself with no human in the
|
||||
# loop. This is intentional and was explicitly requested.
|
||||
# * Everything else (medium/high risk, failing/pending CI, stale branches,
|
||||
# anything touching application logic or needing judgement) is left
|
||||
# untouched and surfaced to Emma.
|
||||
#
|
||||
# The run records two state files under $XDG_STATE_HOME/renovate-review for the
|
||||
# once-a-day interactive-shell reminder defined below (programs.zsh.initContent):
|
||||
# `last-run` (date of the last successful run) and `needs-review.txt` (the PRs
|
||||
# that need Emma's eyes).
|
||||
#
|
||||
# Caveats (the foundation this stands on, none of it owned by this flake):
|
||||
# * Auth is Vertex AI via gcloud Application Default Credentials
|
||||
# (~/.config/gcloud/application_default_credentials.json). When that token
|
||||
# can no longer refresh the run fails; re-auth with `gcloud auth login`.
|
||||
# * The Vertex project, region and model are hardcoded below, copied from the
|
||||
# interactive environment (the corporate launcher injects them; they live in
|
||||
# no config file). If IT changes them, update them here. Claude Code handles
|
||||
# its own network egress, so no proxy is set.
|
||||
# * The github MCP server is defined in ~/code/.mcp.json, so the job runs with
|
||||
# that directory as its working directory.
|
||||
{
|
||||
config,
|
||||
pkgs,
|
||||
lib,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# The review instructions handed to headless Claude: queue -> drop archived
|
||||
# repos -> grade risk -> auto-approve the clearly-safe ones, surface the rest.
|
||||
reviewPrompt = ''
|
||||
Daily Renovate PR review and triage for Emma-Thorpe_citrix.
|
||||
|
||||
1. github MCP search_pull_requests, query: `is:open is:pr review-requested:Emma-Thorpe_citrix author:app/jenkins-stf-jm` (jenkins-stf-jm[bot] is this org's Renovate bot), perPage 50.
|
||||
2. Build the archived-repo exclusion set: github MCP search_repositories with query `org:csg-citrix-storefront archived:true`, perPage 100, paginate all pages (~128). Collect each archived repo full_name. Do NOT use the `archived:false` qualifier on the PR search itself; it is mis-indexed and returns zero. Filter by the repo set instead.
|
||||
3. Drop any PR whose repository is in the archived set (e.g. csg-citrix-storefront/traefik-fips is archived; a PR to an archived repo cannot merge and is noise).
|
||||
4. For each remaining PR: pull_request_read method=get (diff size, mergeable_state, labels, age), method=get_status (CI), and method=get_reviews (existing approvals). Read the body's dependency table for what is bumped.
|
||||
5. Grade risk Low / Medium / High. LOW means ALL of: only patch or minor version bumps; the packages are tooling, observability, infrastructure, test, or framework/runtime libraries (not business logic); the diff is small and symmetric (version strings / lockfiles only); CI is passing; nothing security-policy-loosening. Anything that is a major bump, touches application logic, has failing or pending CI, is a stale branch needing rebase, or that you are not confident about is NOT Low.
|
||||
6. AUTO-APPROVE the safe ones: for every PR that is Low risk AND has passing CI AND is not already approved by Emma-Thorpe_citrix, submit an approving review with pull_request_review_write (method=create, event=APPROVE, body: a one-line note that this is an automated approval of a low-risk dependency update). Approve only these. NEVER call merge. NEVER approve a Medium/High PR or one you are unsure about. (Note: these repos automerge on approval, so approval effectively merges it.)
|
||||
7. Leave for Emma, without approving: every Medium/High risk PR, anything with failing or pending CI, stale branches, and anything needing human judgement.
|
||||
8. Print a markdown table (PR linked, repo, change summary, size, CI, risk, action: Auto-approved / Needs review / Held) and terse notes. State how many PRs were excluded as archived.
|
||||
9. As the FINAL lines of your output, emit machine-readable triage lines, one per PR, with these EXACT prefixes and nothing else on the line:
|
||||
- For each PR you auto-approved: APPROVED> owner/repo#NUMBER short title
|
||||
- For each PR that needs Emma's review: NEEDS> owner/repo#NUMBER (Risk) one-line reason — https://github.com/owner/repo/pull/NUMBER
|
||||
If no PR needs Emma's review, emit no NEEDS> lines at all.
|
||||
If the post-filter search returns zero PRs, say so in one line and emit no NEEDS> lines.
|
||||
'';
|
||||
|
||||
# Hold the prompt in its own store file rather than inline, so its literal
|
||||
# backticks and `$` don't trip shellcheck (SC2016) in the wrapper below.
|
||||
promptFile = pkgs.writeText "renovate-review-prompt.md" reviewPrompt;
|
||||
|
||||
# Tools the headless run is permitted to use without interactive prompts.
|
||||
# Read-only github MCP calls, plus review_write so it can submit APPROVE
|
||||
# reviews on low-risk PRs. Deliberately NOT included: any merge tool.
|
||||
allowedTools = lib.concatStringsSep "," [
|
||||
"mcp__github-mcp__search_pull_requests"
|
||||
"mcp__github-mcp__search_repositories"
|
||||
"mcp__github-mcp__pull_request_read"
|
||||
"mcp__github-mcp__pull_request_review_write"
|
||||
];
|
||||
|
||||
# Where the run records state for the interactive-shell reminder.
|
||||
stateDir = "$HOME/.local/state/renovate-review";
|
||||
|
||||
renovate-review = pkgs.writeShellApplication {
|
||||
name = "renovate-review";
|
||||
runtimeInputs = [ config.programs.claude-code.package ];
|
||||
text = ''
|
||||
# The github MCP server is project-scoped to ~/code; run from there.
|
||||
cd "$HOME/code"
|
||||
|
||||
# Claude Code auth + endpoint: Vertex AI. These are injected into the
|
||||
# interactive shell by the corporate launcher (not present in any config
|
||||
# file), so a systemd-spawned process must set them explicitly. Do NOT set
|
||||
# HTTP(S)_PROXY: Claude Code self-provisions its own network egress to
|
||||
# Vertex; forcing a proxy here points it at a per-session socket that does
|
||||
# not exist outside an interactive launch and breaks connectivity.
|
||||
export CLAUDE_CODE_USE_VERTEX=1
|
||||
export ANTHROPIC_VERTEX_PROJECT_ID=claude-code-citrix
|
||||
export CLOUD_ML_REGION=global
|
||||
export ANTHROPIC_MODEL='claude-opus-4-8[1m]'
|
||||
|
||||
# Capture the run so we can both log it (journal) and persist the triage
|
||||
# for the shell reminder. If claude exits non-zero, errexit aborts here and
|
||||
# the state files are left stale, so the reminder will flag a missed run.
|
||||
out="$(claude -p "$(cat ${promptFile})" \
|
||||
--allowedTools ${lib.escapeShellArg allowedTools} \
|
||||
--output-format text)"
|
||||
|
||||
printf '%s\n' "$out"
|
||||
|
||||
# Persist state for programs.zsh.initContent's daily reminder. needs-review
|
||||
# gets the PRs Claude flagged for Emma (the NEEDS> lines, prefix stripped);
|
||||
# it is empty when nothing needs her attention. grep || true: no matches is
|
||||
# the all-clear case, not an error.
|
||||
mkdir -p "${stateDir}"
|
||||
printf '%s\n' "$out" | grep '^NEEDS> ' | sed 's/^NEEDS> //' > "${stateDir}/needs-review.txt" || true
|
||||
date +%F > "${stateDir}/last-run"
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
systemd.user.services.renovate-review = {
|
||||
Unit.Description = "Daily Renovate PR review (headless Claude Code)";
|
||||
Service = {
|
||||
Type = "oneshot";
|
||||
ExecStart = lib.getExe renovate-review;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.timers.renovate-review = {
|
||||
Unit.Description = "Schedule the daily Renovate PR review";
|
||||
Timer = {
|
||||
OnCalendar = "*-*-* 08:47:00";
|
||||
# Run on next boot if the machine was off at the scheduled time.
|
||||
Persistent = true;
|
||||
# Avoid firing exactly on the minute boundary.
|
||||
RandomizedDelaySec = "5m";
|
||||
};
|
||||
Install.WantedBy = [ "timers.target" ];
|
||||
};
|
||||
|
||||
# Interactive-shell reminder: nudge once per calendar day about the daily
|
||||
# Renovate timer -- whether it actually ran, and any PRs that need Emma's eyes
|
||||
# (the auto-approved ones need no nudge). Throttled via a `reminded-on` marker
|
||||
# so it prints in the first shell/tmux pane of the day, not every pane. mkOrder
|
||||
# 1600 runs after shell.nix's tmux re-exec (order 200), so it fires inside the
|
||||
# tmux pane where Emma actually reads it.
|
||||
programs.zsh.initContent = lib.mkOrder 1600 ''
|
||||
if [[ $- == *i* ]]; then
|
||||
__rr_dir="$HOME/.local/state/renovate-review"
|
||||
__rr_today=$(date +%F)
|
||||
if [[ "$(cat "$__rr_dir/reminded-on" 2>/dev/null)" != "$__rr_today" ]]; then
|
||||
__rr_last=$(cat "$__rr_dir/last-run" 2>/dev/null)
|
||||
if [[ "$__rr_last" != "$__rr_today" ]]; then
|
||||
print -P "%F{yellow}renovate:%f last review ''${__rr_last:-never} (not today) -- check: systemctl --user status renovate-review"
|
||||
fi
|
||||
if [[ -s "$__rr_dir/needs-review.txt" ]]; then
|
||||
print -P "%F{red}renovate:%f $(grep -c . "$__rr_dir/needs-review.txt") PR(s) need your review:"
|
||||
sed 's/^/ - /' "$__rr_dir/needs-review.txt"
|
||||
print -P " -> journalctl --user -u renovate-review -e"
|
||||
elif [[ "$__rr_last" == "$__rr_today" ]]; then
|
||||
print -P "%F{green}renovate:%f reviewed today -- low-risk auto-approved, nothing for you."
|
||||
fi
|
||||
mkdir -p "$__rr_dir" && print -r -- "$__rr_today" > "$__rr_dir/reminded-on"
|
||||
fi
|
||||
unset __rr_dir __rr_today __rr_last
|
||||
fi
|
||||
'';
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
# Work (EDaaS/WSL) home profile: corporate toolchain + tmux tweaks. Git identity
|
||||
# comes from the registry (users/registry.nix), not here.
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
inputs,
|
||||
...
|
||||
}:
|
||||
|
||||
{
|
||||
# Host-scoped extras for this machine only (the EDaaS/WSL host).
|
||||
imports = [
|
||||
./renovate-review.nix # daily headless Renovate PR review (systemd user timer)
|
||||
];
|
||||
|
||||
# The work box keeps its own (corporate) ~/.ssh/config; don't let the personal
|
||||
# programs.ssh (shell.nix) take it over. The ssh-agent below still runs.
|
||||
programs.ssh.enable = lib.mkForce false;
|
||||
|
||||
home.packages = [
|
||||
pkgs.kubectl
|
||||
pkgs.argo-rollouts
|
||||
pkgs.tenv
|
||||
pkgs.kubernetes-helm
|
||||
pkgs.azure-cli
|
||||
pkgs.kubelogin
|
||||
pkgs.curl
|
||||
pkgs.notation
|
||||
pkgs.powershell
|
||||
pkgs.nuget
|
||||
pkgs.gedit
|
||||
pkgs.python3
|
||||
pkgs.gnumake
|
||||
pkgs.gcc
|
||||
pkgs.libiconv
|
||||
pkgs.autoconf
|
||||
pkgs.automake
|
||||
pkgs.pkg-config
|
||||
pkgs.wget
|
||||
pkgs.google-cloud-sdk
|
||||
# Day-to-day Kubernetes / Helm / Terraform accelerators for this box.
|
||||
pkgs.k9s # cluster TUI
|
||||
pkgs.kubectx # kubectx + kubens (context/namespace switch)
|
||||
pkgs.stern # multi-pod log tail
|
||||
pkgs.dyff # semantic YAML/manifest diffs (Helm release drift)
|
||||
pkgs.tflint # Terraform linter (catches what terraformls won't)
|
||||
pkgs.terraform-docs # generate Terraform module docs
|
||||
pkgs.yq-go # jq for YAML
|
||||
pkgs.gcx # Grafana Cloud CLI (dashboards, SLOs, synthetics, alerts)
|
||||
|
||||
# WSL ships no xdg-open, so anything that shells out to a browser dies with
|
||||
# `exec: "xdg-open,x-www-browser,www-browser": executable file not found`.
|
||||
# kubelogin's interactive login is the one that bites: it is the login mode
|
||||
# the shared cluster kubeconfig uses. Hand the URL to Windows instead.
|
||||
# (wslu, the usual answer, is gone from nixpkgs -- upstream archived it.)
|
||||
(pkgs.writeShellScriptBin "xdg-open" ''
|
||||
url="$1"
|
||||
if command -v powershell.exe >/dev/null 2>&1; then
|
||||
exec powershell.exe -NoProfile -Command "Start-Process '$url'"
|
||||
fi
|
||||
exec explorer.exe "$url"
|
||||
'')
|
||||
];
|
||||
|
||||
# Honoured by tools that read $BROWSER rather than calling xdg-open.
|
||||
home.sessionVariables.BROWSER = "xdg-open";
|
||||
services.ssh-agent.enable = true;
|
||||
|
||||
# Colourised kubectl. enableAlias points `kubectl` at kubecolor, which parses
|
||||
# the output of the real kubectl underneath and passes anything it does not
|
||||
# recognise straight through, so every flag and subcommand still works. It
|
||||
# drops colour automatically when stdout is not a terminal, leaving pipes into
|
||||
# grep/jq/yq byte-identical. zsh integration reuses kubectl's own completions.
|
||||
# Note the alias does apply to `KUBECONFIG=... kubectl ...`: zsh expands
|
||||
# aliases after a variable-assignment prefix.
|
||||
programs.kubecolor = {
|
||||
enable = true;
|
||||
enableAlias = true;
|
||||
enableZshIntegration = true;
|
||||
};
|
||||
|
||||
# gcx (above) keeps its OAuth tokens in the system keychain and has no
|
||||
# plaintext fallback, so this WSL box needs something owning
|
||||
# org.freedesktop.secrets. See home/secret-service.nix for why
|
||||
# home-manager's services.gnome-keyring cannot be used on a headless host,
|
||||
# and for the security trade-off of an auto-unlocked keyring.
|
||||
services.headlessSecretService.enable = true;
|
||||
home.shellAliases = {
|
||||
docker = "/run/current-system/sw/bin/docker";
|
||||
};
|
||||
|
||||
# Source the (nix-unmanaged) Jenkins credentials file into every zsh, so the
|
||||
# JENKINS_UCE_/JENKINS_STF_ tokens are exported for all shells and anything they
|
||||
# launch -- the Jenkins MCP servers read them via ${JENKINS_*} expansion.
|
||||
# envExtra lands in ~/.zshenv, which zsh sources for login, interactive, and
|
||||
# non-interactive shells alike. Guarded so a missing file never breaks a shell;
|
||||
# the file holds secrets, so it is kept out of the world-readable nix store.
|
||||
programs.zsh.envExtra = ''
|
||||
[ -f "$HOME/.jenkinsenv" ] && . "$HOME/.jenkinsenv"
|
||||
[ -f "$HOME/.splunkenv" ] && . "$HOME/.splunkenv"
|
||||
'';
|
||||
programs.tmux = {
|
||||
# kube context/namespace in the status line. kube-tmux is pinned as a flake
|
||||
# input (it is not in nixpkgs), so the script is always present in the store.
|
||||
extraConfig = ''
|
||||
set -g status-right "#(${pkgs.bash}/bin/bash ${inputs.kube-tmux}/kube.tmux 250 red black)"
|
||||
'';
|
||||
};
|
||||
programs.go = {
|
||||
enable = true;
|
||||
};
|
||||
|
||||
# LSP servers only relevant to work: C# (omnisharp) and Helm charts (helm_ls).
|
||||
# The shared editor (home/editor.nix) carries the universal ones;
|
||||
# these are gated to this host so the heavy omnisharp closure stays off the
|
||||
# personal machines. Tree-sitter grammars (highlighting) remain global there.
|
||||
programs.nixvim.plugins.lsp.servers = {
|
||||
omnisharp.enable = true;
|
||||
helm_ls.enable = true;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
# Lyra's personal home extras, imported on her hosts (not the work box). Keeps
|
||||
# personal data out of the shared home/ modules. See README "Users".
|
||||
{ pkgs, lib, ... }:
|
||||
{
|
||||
# Personal ssh host shortcut.
|
||||
programs.ssh.settings."dockerpi.inf.cbg.emmaisvery.gay" = {
|
||||
User = "emmathorpe";
|
||||
};
|
||||
|
||||
# Night-light location for gammastep (the service itself is enabled by
|
||||
# home/sway.nix on graphical hosts). Linux-guarded so Darwin, which imports
|
||||
# this module but has no gammastep, skips it.
|
||||
services.gammastep = lib.mkIf pkgs.stdenv.hostPlatform.isLinux {
|
||||
latitude = 51.5;
|
||||
longitude = -0.13;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
# User identity registry -- pure data, keyed by username. See README "Users".
|
||||
# (`identity.username` is injected by mkHost, so it is not repeated here.)
|
||||
{
|
||||
lyrathorpe = {
|
||||
fullName = "Lyra Thorpe";
|
||||
email = "iam@emmathe.dev";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"docker"
|
||||
];
|
||||
sshAuthorizedKeys = [
|
||||
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDxHvdMTOzpFWUFMtCP7C/4tIOUO3GIO2QPvaifSnWH lyrathorpe@Lyra-MBA"
|
||||
];
|
||||
signingKey = "key::ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPDxHvdMTOzpFWUFMtCP7C/4tIOUO3GIO2QPvaifSnWH lyrathorpe@Lyra-MBA";
|
||||
};
|
||||
|
||||
emmathorpe = {
|
||||
fullName = "Emma Thorpe";
|
||||
email = "emma.thorpe@citrix.com";
|
||||
extraGroups = [
|
||||
"wheel"
|
||||
"docker"
|
||||
];
|
||||
# No personal key on file yet; add one if SSH login as emmathorpe is wanted.
|
||||
sshAuthorizedKeys = [ ];
|
||||
signingKey = "key::ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAJMVgeRKnfX1G8coU3nAobI485aeUpGTMqH7+zbKI8o emma.thorpe@cloud.com";
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user