4 Commits
Author SHA1 Message Date
Emma Thorpe ff5fe16728 chore: minor cleanups (lens unfree name, LSP doc, editorconfig, docker subnet)
CI / flake (pull_request) Successful in 3m30s
- flake.nix: drop the dead "lens" unfree entry; pkgs.lens is named
  "lens-desktop", which is the name the predicate actually matches.
- home/README.md: the Nix LSP is nil_ls, not nil.
- .editorconfig: remove the rule block that duplicated the [*] defaults.
- hosts/RPi5/docker.nix: name the trusted Docker subnet in a let binding
  rather than repeating the literal CIDR.

Deferred from the audit bundle: the .gitignore firmware entry (documented,
low value) and the per-eval nixpkgs-unstable overlay import (inherently
per-system, no clean hoist).

Closes #53
2026-06-29 13:29:25 +01:00
Emma Thorpe e275be3660 chore: gitignore the local tf-inspect scratch project
tf-inspect/ is a separate project living untracked in the repo root; ignore
it so it stops showing in git status and cannot be lost to git clean.

Closes #52
2026-06-29 13:29:25 +01:00
Emma Thorpe b605515f05 fix(work): guard the kube-tmux status line on the script's presence
The tmux status-right shelled out to $HOME/code/kube-tmux/kube.tmux by
absolute path; on a checkout without that external repo every status refresh
errored. Wrap it in a file-existence test so it degrades quietly.

Closes #50
2026-06-29 13:29:25 +01:00
Emma Thorpe e42f368d72 refactor(ssh): consolidate sshd enable and port 22 into modules/ssh.nix
The daemon enable and the firewall port were duplicated in each sshd host
(T400, Mac Pro, RPi5). Move both into modules/ssh.nix so importing it both
hardens and enables sshd; drop the per-host copies. No build change: the
three hosts evaluate to identical derivations.

Closes #51
2026-06-29 13:29:24 +01:00
10 changed files with 43 additions and 45 deletions
-6
View File
@@ -8,12 +8,6 @@ indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
[*.{nix,yaml,yml,json,md,sh,toml}]
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
+3
View File
@@ -2,3 +2,6 @@ modules/firmware/*
# vim swap files
*.swp
# Local scratch project, not part of this flake.
tf-inspect/
+1 -2
View File
@@ -93,8 +93,7 @@
# Unfree packages permitted to be built (replaces blanket allowUnfree).
unfreePackages = [
"claude-code"
"lens"
"lens-desktop"
"lens-desktop" # the name of pkgs.lens (used on the work host)
];
# Per-user identity, keyed by username. See README "Users".
+17 -17
View File
@@ -110,23 +110,23 @@ 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` (Nix), `lua_ls`, `pyright` (Python), `terraformls` |
| Indentation | 2-wide hard tabs (`noexpandtab`, `tabstop`/`shiftwidth` = 2); line numbers on |
| Filetypes | `*Jenkinsfile` → groovy |
| 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
+2 -4
View File
@@ -26,10 +26,8 @@
# workstation.nix is the backstop).
zramSwap.enable = true;
# 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 ];
# 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.
+4 -7
View File
@@ -25,15 +25,12 @@
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
# Remote administration. Key-only policy and the authorized key come from
# ../../modules/ssh.nix; here we just enable the daemon and open the port.
services.openssh.enable = true;
# Remote administration: the daemon, port 22 and key-only policy all come from
# ../../modules/ssh.nix.
# Default-deny inbound. Open only SSH here; the Docker and nginx submodules
# open their own ports (Docker via a source-restricted nftables rule, nginx
# via 80/443). List-valued, so these merge with the submodule definitions.
# 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;
networking.firewall.allowedTCPPorts = [ 22 ];
# See `man configuration.nix` / the stateVersion docs before changing.
system.stateVersion = "26.05";
+5 -1
View File
@@ -8,6 +8,10 @@
# 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;
@@ -29,6 +33,6 @@
# CIDR to match the LAN that should reach the Docker API.
networking.nftables.enable = true;
networking.firewall.extraInputRules = ''
ip saddr 10.187.1.0/24 tcp dport 2375 accept
ip saddr ${trustedSubnet} tcp dport 2375 accept
'';
}
+2 -4
View File
@@ -21,10 +21,8 @@
# 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.
# Intel Core 2 (Penryn) microcode. Redistributable firmware (enabled in
# workstation.nix) supplies the iwlwifi blobs (Intel WiFi Link 5100/5300) and
+6 -3
View File
@@ -1,8 +1,11 @@
# Key-only sshd hardening, imported by hosts that run sshd (T400, Mac Pro,
# RPi5). Authorized keys are owned per-user by the registry (modules/users.nix),
# not here.
# 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
+3 -1
View File
@@ -48,8 +48,10 @@
docker = "/run/current-system/sw/bin/docker";
};
programs.tmux = {
# kube-tmux is an external checkout; guard on its presence so the status
# line degrades gracefully (no per-refresh error) when it isn't cloned.
extraConfig = ''
set -g status-right "#(/run/current-system/sw/bin/bash $HOME/code/kube-tmux/kube.tmux 250 red black)"
set -g status-right "#(if [ -f $HOME/code/kube-tmux/kube.tmux ]; then /run/current-system/sw/bin/bash $HOME/code/kube-tmux/kube.tmux 250 red black; fi)"
'';
};
programs.go = {