From 305a0e61f839de12f5aebaee6e1469e138c86fd7 Mon Sep 17 00:00:00 2001 From: "Simen A. W. Olsen" Date: Tue, 27 Oct 2026 11:50:21 +0100 Subject: feat: gate updates behind vet supply-chain checks update now holds inputs and skills back by a cooldown, has Claude review third-party diffs, and reports CVE changes before switching. Homebrew taps are pinned through nix-homebrew, and npm/pnpm get install policies. --- modules/darwin/default.nix | 4 ++++ modules/darwin/homebrew.nix | 11 +++++------ modules/home/default.nix | 1 + modules/home/supply-chain.nix | 26 ++++++++++++++++++++++++++ modules/home/zsh.nix | 28 ++++++++++++++++++++++------ 5 files changed, 58 insertions(+), 12 deletions(-) create mode 100644 modules/home/supply-chain.nix (limited to 'modules') diff --git a/modules/darwin/default.nix b/modules/darwin/default.nix index d23e795..1ccb7c9 100644 --- a/modules/darwin/default.nix +++ b/modules/darwin/default.nix @@ -144,5 +144,9 @@ # Specific toolsets rclone + + # Supply-chain checks: vet gates `update`, nvd shows what a switch changes + (pkgs.callPackage ../../pkgs/vet { }) + nvd ]; } diff --git a/modules/darwin/homebrew.nix b/modules/darwin/homebrew.nix index 51749e1..3175e97 100644 --- a/modules/darwin/homebrew.nix +++ b/modules/darwin/homebrew.nix @@ -1,19 +1,18 @@ -{ ... }: +{ config, ... }: { homebrew = { enable = true; + # Taps are pinned in flake.lock (nix-homebrew in flake.nix), so upgrading + # moves to the versions vet let through and never past them. onActivation = { - autoUpdate = true; + autoUpdate = false; upgrade = true; cleanup = "zap"; }; - taps = [ - "simenandre/tools" - "anomalyco/tap" - ]; + taps = builtins.attrNames config.nix-homebrew.taps; # Note: most CLI tools live in nixpkgs (modules/darwin/default.nix). # These stay in brew on purpose: shell completions, the macOS container diff --git a/modules/home/default.nix b/modules/home/default.nix index 5331684..e815c7c 100644 --- a/modules/home/default.nix +++ b/modules/home/default.nix @@ -10,6 +10,7 @@ ./herdr.nix ./onepassword.nix ./starship.nix + ./supply-chain.nix ./tmux.nix ./lazygit.nix ./twm.nix diff --git a/modules/home/supply-chain.nix b/modules/home/supply-chain.nix new file mode 100644 index 0000000..43c5f3b --- /dev/null +++ b/modules/home/supply-chain.nix @@ -0,0 +1,26 @@ +{ pkgs, lib, ... }: + +let + # Most registry compromises are caught and unpublished within days, so a + # week-old version has had time to be noticed. Lifecycle scripts are + # already blocked by pnpm unless a project allows them. + pnpmConfig = '' + minimumReleaseAge: 10080 + trustPolicy: no-downgrade + blockExoticSubdeps: true + ''; +in +{ + # pnpm reads $XDG_CONFIG_HOME/pnpm/config.yaml, and on macOS falls back to + # ~/Library/Preferences/pnpm when XDG_CONFIG_HOME is unset (GUI apps, editors). + xdg.configFile."pnpm/config.yaml".text = pnpmConfig; + home.file."Library/Preferences/pnpm/config.yaml" = lib.mkIf pkgs.stdenv.isDarwin { + text = pnpmConfig; + }; + + # An env var rather than ~/.npmrc, which `npm login` must be able to write. + # pnpm ignores it. Explicit `npm run