Skip to content

Commit c18483a

Browse files
chore: sync from personal branch (sanitized)
Recent commits synced: 3fc55be Merge remote-tracking branch 'origin/personal' into personal 95eeff9 feat: force Claude Code max effort level via env vars 1e057cb refactor: make Framework 16 NVIDIA dGPU toggleable, disable for ama-tech-001 12f5f01 fix: disable Goodix fingerprint autosuspend to prevent EC log overflow 3dd76be feat: add Google Workspace CLI (gws) and relocate google-cloud-sdk to common Auto-synced by GitHub Actions (personal info stripped)
1 parent 25ba7c5 commit c18483a

7 files changed

Lines changed: 151 additions & 60 deletions

File tree

devenv.lock

Lines changed: 70 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
"devenv": {
44
"locked": {
55
"dir": "src/modules",
6-
"lastModified": 1773034036,
7-
"narHash": "sha256-J03ioow4WAtkKmZQ04cCXhar4UwW2RrpXzk7msFJUUA=",
6+
"lastModified": 1776863933,
7+
"narHash": "sha256-v9NoQFSln9n5zqVWUWUc9PajsMaGmga51HOAJqMx7Qw=",
88
"owner": "cachix",
99
"repo": "devenv",
10-
"rev": "32c9ecdacbd7093ae096e5ca312c4497e3758159",
10+
"rev": "863b4204725efaeeb73811e376f928232b720646",
1111
"type": "github"
1212
},
1313
"original": {
@@ -17,16 +17,75 @@
1717
"type": "github"
1818
}
1919
},
20+
"flake-compat": {
21+
"flake": false,
22+
"locked": {
23+
"lastModified": 1767039857,
24+
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
25+
"owner": "NixOS",
26+
"repo": "flake-compat",
27+
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
28+
"type": "github"
29+
},
30+
"original": {
31+
"owner": "NixOS",
32+
"repo": "flake-compat",
33+
"type": "github"
34+
}
35+
},
36+
"git-hooks": {
37+
"inputs": {
38+
"flake-compat": "flake-compat",
39+
"gitignore": "gitignore",
40+
"nixpkgs": [
41+
"nixpkgs"
42+
]
43+
},
44+
"locked": {
45+
"lastModified": 1776796298,
46+
"narHash": "sha256-PcRvlWayisPSjd0UcRQbhG8Oqw78AcPE6x872cPRHN8=",
47+
"owner": "cachix",
48+
"repo": "git-hooks.nix",
49+
"rev": "3cfd774b0a530725a077e17354fbdb87ea1c4aad",
50+
"type": "github"
51+
},
52+
"original": {
53+
"owner": "cachix",
54+
"repo": "git-hooks.nix",
55+
"type": "github"
56+
}
57+
},
58+
"gitignore": {
59+
"inputs": {
60+
"nixpkgs": [
61+
"git-hooks",
62+
"nixpkgs"
63+
]
64+
},
65+
"locked": {
66+
"lastModified": 1709087332,
67+
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
68+
"owner": "hercules-ci",
69+
"repo": "gitignore.nix",
70+
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
71+
"type": "github"
72+
},
73+
"original": {
74+
"owner": "hercules-ci",
75+
"repo": "gitignore.nix",
76+
"type": "github"
77+
}
78+
},
2079
"nixpkgs": {
2180
"inputs": {
2281
"nixpkgs-src": "nixpkgs-src"
2382
},
2483
"locked": {
25-
"lastModified": 1772749504,
26-
"narHash": "sha256-eqtQIz0alxkQPym+Zh/33gdDjkkch9o6eHnMPnXFXN0=",
84+
"lastModified": 1776852779,
85+
"narHash": "sha256-WwO/ITisCXwyiRgtktZgv3iGhAGO+IB5Av4kKCwezR0=",
2786
"owner": "cachix",
2887
"repo": "devenv-nixpkgs",
29-
"rev": "08543693199362c1fddb8f52126030d0d374ba2e",
88+
"rev": "ec3063523dcd911aeadb50faa589f237cdab5853",
3089
"type": "github"
3190
},
3291
"original": {
@@ -39,11 +98,11 @@
3998
"nixpkgs-src": {
4099
"flake": false,
41100
"locked": {
42-
"lastModified": 1772173633,
43-
"narHash": "sha256-MOH58F4AIbCkh6qlQcwMycyk5SWvsqnS/TCfnqDlpj4=",
101+
"lastModified": 1776329215,
102+
"narHash": "sha256-a8BYi3mzoJ/AcJP8UldOx8emoPRLeWqALZWu4ZvjPXw=",
44103
"owner": "NixOS",
45104
"repo": "nixpkgs",
46-
"rev": "c0f3d81a7ddbc2b1332be0d8481a672b4f6004d6",
105+
"rev": "b86751bc4085f48661017fa226dee99fab6c651b",
47106
"type": "github"
48107
},
49108
"original": {
@@ -56,10 +115,11 @@
56115
"root": {
57116
"inputs": {
58117
"devenv": "devenv",
118+
"git-hooks": "git-hooks",
59119
"nixpkgs": "nixpkgs"
60120
}
61121
}
62122
},
63123
"root": "root",
64124
"version": 7
65-
}
125+
}

flake.lock

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,11 @@
107107
};
108108

109109
# Tech profile helper — full power-user setup (350+ packages, AI orchestration)
110-
mkTechHost = { hostname, username, system ? "x86_64-linux", extraModules ? [ ] }: nixpkgs.lib.nixosSystem {
110+
# enableDGPU: threaded through specialArgs so framework-16.nix and host files can
111+
# gate NVIDIA configuration when the expansion bay is physically absent.
112+
mkTechHost = { hostname, username, system ? "x86_64-linux", enableDGPU ? false, extraModules ? [ ] }: nixpkgs.lib.nixosSystem {
111113
inherit system;
112-
specialArgs = { inherit inputs username; };
114+
specialArgs = { inherit inputs username enableDGPU; };
113115
modules = [
114116
# Host-specific configuration
115117
./hosts/${hostname}
@@ -196,16 +198,24 @@
196198
username = "guyfawkes";
197199
};
198200

199-
# Framework Laptop 16 (AMD Ryzen AI 9 HX 370 + NVIDIA RTX 5070) — Amatino
201+
# Framework Laptop 16 (AMD Ryzen AI 9 HX 370, optional RTX 5070 bay) — Amatino
200202
# Build: nixos-rebuild switch --flake .#ama-tech-001
201-
ama-tech-001 = mkTechHost {
202-
hostname = "ama-tech-001";
203-
username = "guyfawkes";
204-
extraModules = [
205-
# NixOS Hardware module for Framework 16 with AMD AI 300 + NVIDIA
206-
nixos-hardware.nixosModules.framework-16-amd-ai-300-series-nvidia
207-
];
208-
};
203+
# Flip enableDGPU to true when the NVIDIA expansion bay is installed.
204+
ama-tech-001 =
205+
let
206+
enableDGPU = false;
207+
in
208+
mkTechHost {
209+
hostname = "ama-tech-001";
210+
username = "guyfawkes";
211+
inherit enableDGPU;
212+
extraModules = [
213+
# Pick the nixos-hardware variant matching the expansion bay state
214+
(if enableDGPU
215+
then nixos-hardware.nixosModules.framework-16-amd-ai-300-series-nvidia
216+
else nixos-hardware.nixosModules.framework-16-amd-ai-300-series)
217+
];
218+
};
209219

210220
# ── Business workstations ──────────────────────────────────────
211221

hosts/ama-tech-001/default.nix

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Framework Laptop 16 host configuration
2-
# AMD Ryzen AI 9 HX 370 + NVIDIA RTX 5070 + 64GB DDR5-5600
3-
{ config, pkgs, inputs, username, lib, ... }:
2+
# AMD Ryzen AI 9 HX 370 + 64GB DDR5-5600
3+
# Optional: NVIDIA RTX 5070 Expansion Bay (toggle via enableDGPU in flake.nix)
4+
{ config, pkgs, inputs, username, enableDGPU ? false, lib, ... }:
45

56
{
67
imports = [
@@ -16,7 +17,8 @@
1617
networking.hostName = "ama-tech-001";
1718

1819
# NVIDIA PRIME Bus IDs (from lspci: c1:00.0 = NVIDIA, c2:00.0 = AMD)
19-
hardware.nvidia.prime = {
20+
# Only applied when the expansion bay is installed.
21+
hardware.nvidia.prime = lib.mkIf enableDGPU {
2022
amdgpuBusId = "PCI:194:0:0";
2123
nvidiaBusId = "PCI:193:0:0";
2224
};

modules/hardware/framework-16.nix

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Framework Laptop 16 — extras beyond nixos-hardware
2-
# AMD Ryzen AI 9 HX 370 + NVIDIA RTX 5070 Expansion Bay
2+
# AMD Ryzen AI 9 HX 370 + optional NVIDIA RTX 5070 Expansion Bay
33
#
4-
# Base hardware support (AMD GPU params, fingerprint, PPD, QMK, fwupd,
5-
# PRIME offload, Blackwell open modules) comes from:
6-
# nixos-hardware.nixosModules.framework-16-amd-ai-300-series-nvidia
7-
# imported in flake.nix. This file adds NVIDIA tuning, workarounds, and extras.
8-
{ config, pkgs, lib, inputs, ... }:
4+
# Base hardware support (AMD GPU params, fingerprint, PPD, QMK, fwupd, PRIME
5+
# offload if applicable, Blackwell open modules) comes from the matching
6+
# nixos-hardware module, chosen in flake.nix based on enableDGPU.
7+
# This file adds shared Framework 16 tuning plus NVIDIA bits gated on enableDGPU.
8+
{ config, pkgs, lib, inputs, enableDGPU ? false, ... }:
99

1010
{
1111
# Disable nixos-hardware's amd_pstate module — it sets amd_pstate=active for
@@ -26,9 +26,6 @@
2626
boot.blacklistedKernelModules = [ "ucsi_acpi" ];
2727

2828
boot.kernelParams = [
29-
# NVIDIA VRAM preservation across suspend/resume
30-
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
31-
"nvidia.NVreg_TemporaryFilePath=/var/tmp"
3229
# Guided mode: OS sets min/max bounds, firmware picks optimal frequency.
3330
# Passive/active modes fail on Strix Point — firmware ignores CPPC requests.
3431
# Guided cooperates with the firmware's autonomous frequency control.
@@ -39,6 +36,10 @@
3936
"amdgpu.cwsr_enable=0"
4037
# Force NVMe to stay at full PCIe link speed (prevents Gen 3 fallback)
4138
"pcie_aspm=off"
39+
] ++ lib.optionals enableDGPU [
40+
# NVIDIA VRAM preservation across suspend/resume
41+
"nvidia.NVreg_PreserveVideoMemoryAllocations=1"
42+
"nvidia.NVreg_TemporaryFilePath=/var/tmp"
4243
# Explicitly disable NVIDIA dynamic power management (RTD3).
4344
# Open kernel modules (565+) default to 0x03 (fine-grained) on laptops,
4445
# which causes UCSI link drops on the USB-C DP alt-mode path.
@@ -53,7 +54,7 @@
5354
# can cause DRM contention during VT switches and suspend/resume.
5455
# Must use modprobe options — kernel cmdline param is silently overridden
5556
# because NixOS appends fbdev=1 AFTER our params (last-wins).
56-
boot.extraModprobeConfig = ''
57+
boot.extraModprobeConfig = lib.optionalString enableDGPU ''
5758
options nvidia-drm fbdev=0
5859
'';
5960

@@ -79,14 +80,24 @@
7980
''
8081
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e8d", ATTRS{idProduct}=="0717", ATTR{power/autosuspend}="-1"
8182
''
83+
# Disable USB autosuspend on the Goodix fingerprint sensor (27c6:609c).
84+
# The Goodix firmware's USB runtime PM is flaky: it auto-suspends after 2s
85+
# idle and fails to wake cleanly, causing repeated xhci resets ("usb 3-4.1:
86+
# reset full-speed USB device") that correlate with cros-ec LPC channel
87+
# overflow ("cros-ec-dev: Some logs may have been dropped"). Observed in
88+
# every boot regardless of whether fprintd is active. Default is
89+
# autosuspend=2s with control=auto, which is far too aggressive.
90+
''
91+
SUBSYSTEM=="usb", ATTRS{idVendor}=="27c6", ATTRS{idProduct}=="609c", ATTR{power/autosuspend}="-1"
92+
''
8293
# Auto-switch power profile on AC plug/unplug via systemd service trigger
8394
''
8495
SUBSYSTEM=="power_supply", ATTR{type}=="Mains", ACTION=="change", TAG+="systemd", ENV{SYSTEMD_WANTS}="set-power-profile-ac.service"
8596
''
8697
];
8798

8899
# NVIDIA tuning (driver, modesetting, offload, open modules handled by nixos-hardware)
89-
hardware.nvidia = {
100+
hardware.nvidia = lib.mkIf enableDGPU {
90101
package = config.boot.kernelPackages.nvidiaPackages.production;
91102
modesetting.enable = true; # Required for Wayland
92103
# RTD3 fine-grained PM disabled — causes UCSI link drops on the rear USB-C
@@ -98,14 +109,15 @@
98109
nvidiaSettings = true;
99110
};
100111

101-
# Vulkan + VA-API support for AMD iGPU and NVIDIA dGPU
112+
# Vulkan + VA-API support for AMD iGPU (plus NVIDIA dGPU when present)
102113
hardware.graphics = {
103114
enable = true;
104115
enable32Bit = true; # Steam/gaming compatibility
105116
extraPackages = with pkgs; [
106117
libva
107118
vulkan-loader
108119
vulkan-validation-layers
120+
] ++ lib.optionals enableDGPU [
109121
nvidia-vaapi-driver
110122
];
111123
extraPackages32 = with pkgs.pkgsi686Linux; [
@@ -268,8 +280,9 @@
268280
# Framework-specific packages
269281
environment.systemPackages = with pkgs; [
270282
framework-tool
271-
nvtopPackages.nvidia
272283
powertop
284+
] ++ lib.optionals enableDGPU [
285+
nvtopPackages.nvidia
273286
];
274287

275288
# Build settings for 12-core AMD / 64GB RAM

0 commit comments

Comments
 (0)