aboutsummaryrefslogtreecommitdiffstats
path: root/modules/home/supply-chain.nix
diff options
context:
space:
mode:
authorSimen A. W. Olsen <hello@simenandre.no>2026-10-27 11:50:21 +0100
committerSimen A. W. Olsen <hello@simenandre.no>2026-10-27 11:50:21 +0100
commit305a0e61f839de12f5aebaee6e1469e138c86fd7 (patch)
treec3c7ff3dd1180a785e02a848ad3e4655d68cea20 /modules/home/supply-chain.nix
parent163c2dee18ab2b197fe1fcf00cf32214b804fda6 (diff)
downloaddotfiles-305a0e61f839de12f5aebaee6e1469e138c86fd7.tar.gz
dotfiles-305a0e61f839de12f5aebaee6e1469e138c86fd7.zip
feat: gate updates behind vet supply-chain checksHEADmain
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.
Diffstat (limited to 'modules/home/supply-chain.nix')
-rw-r--r--modules/home/supply-chain.nix26
1 files changed, 26 insertions, 0 deletions
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 <script>` still runs.
+ home.sessionVariables.npm_config_ignore_scripts = "true";
+
+ home.packages = [ pkgs.osv-scanner ];
+}