My nixOS config
Find a file
Sergei Poljanski 285933d22c
networking: recover the WWAN modem after a cold boot
After a cold boot the EM160R-GL often drops off the PCIe link 10-20s
after probe ("Unable to change power state from D3cold to D0", config
space reads all-ones) and never brings up its wwan ports. Until now
only a hibernate/resume cycle brought it back.

An ACPI _RST through the PCI reset attribute does the same at runtime.
The rescan after it catches the firmware mid-boot, under the generic
Qualcomm ID 17cb:0304, which has no FCC unlock script, so ModemManager
fails with "Couldn't set operating mode". A second rescan once the
firmware is up gets 1eac:100d back and the modem enables normally.

The service does nothing if wwan ports show up within 60s of boot.
The recovery sequence was verified by hand on 7.2.11; the service has
not yet run it on a real cold boot.

Assisted-by: Claude:opus-5-5
2026-10-20 20:37:11 +04:00
modules networking: recover the WWAN modem after a cold boot 2026-10-20 20:37:11 +04:00
patches patches: add traced mutter touch-cancel patches 2026-10-20 12:10:06 +04:00
secrets sops: introduce sops-nix (age), ssh keys from encrypted tarball, .example secrets 2026-07-14 12:24:21 +04:00
.gitignore sops: introduce sops-nix (age), ssh keys from encrypted tarball, .example secrets 2026-07-14 12:24:21 +04:00
.sops.yaml sops: introduce sops-nix (age), ssh keys from encrypted tarball, .example secrets 2026-07-14 12:24:21 +04:00
configuration.nix desktop: add an xfce-x11 boot specialisation 2026-10-20 12:10:06 +04:00
flake.lock flake: update inputs 2026-10-20 20:37:10 +04:00
flake.nix lemonade: XDNA2 NPU LLM serving via nix-amd-ai 2026-07-11 22:36:00 +04:00
hardware-configuration.nix ThinkPad T14 G2 AMD -> P14s G6 AMD 2026-05-07 17:55:07 +03:00
README.md readme: add Assisted-by 2026-07-14 12:44:17 +04:00

NixOS

Assisted-by: Claude (claude-opus-4-5 → claude-opus-4-6 → claude-opus-4-7 → claude-opus-4-8 → claude-fable-5)

Flake-based NixOS configuration for a ThinkPad P14s Gen 6 (AMD), tracking nixos-unstable.

Highlights

  • Secure Boot via lanzaboote
  • Secrets: sops-nix with age — xray config, WireGuard, SSH keys, private routes/hosts; encrypted files stay out of the repo (only .example structure files are tracked), decrypted to /run/secrets at activation
  • Desktop: GNOME on Wayland, AMD GPU
  • Local LLMs: Ollama with ROCm (gfx1151) + Lemonade for XDNA2 NPU serving via nix-amd-ai
  • Networking: Xray VLESS+Reality with sing-box TUN, WireGuard, WWAN modem
  • Gaming: Steam with gamescope, declarative Flatpaks via nix-flatpak
  • Litecoin Core (MWEB): vendored package build, revived after removal from nixpkgs
  • Power: AMD P-State tuning, zram swap ahead of disk swap

Layout

flake.nix              # inputs and host definition
configuration.nix      # entry point, imports modules
modules/               # one module per concern (boot, desktop, ollama, xray, ...)
secrets/               # sops-encrypted (age) secrets, gitignored; .example files document structure

Usage

sudo nixos-rebuild switch --flake /etc/nixos#meow

Fresh install: restore secrets/ and the age key (/var/lib/sops-nix/key.txt) from out-of-band backup first.

TODO

  • Evaluate Home Manager