From 66c98949ab49978975691952c3db21a5f558b0a8 Mon Sep 17 00:00:00 2001 From: Bernardo Magri Date: Tue, 19 May 2026 19:03:29 +0100 Subject: [PATCH] chore(features): drop orphan userPackages reader MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `features/default.nix` had a let-block that read `~/.config/home-manager/user-packages.json` at eval time via `builtins.pathExists` + `builtins.readFile`, parsed it as JSON, and filtered to valid pkgs — then never appended the result to `home.packages` or anywhere else. The `userPackages` variable was completely orphan. Two problems with the dead code: (1) it was an undocumented hidden mechanism (no docs mentioned `user-packages.json`), (2) it made flake evaluation impurely depend on a user's home directory for no payoff — flake outputs would silently differ between machines depending on the presence of that file, even though nothing in the build used it. Removed the let-block entirely. The nomarchyLib import stays. Found during Pillar 8 audit of features/apps. --- features/default.nix | 8 -------- 1 file changed, 8 deletions(-) diff --git a/features/default.nix b/features/default.nix index f5962ed..3516fa6 100644 --- a/features/default.nix +++ b/features/default.nix @@ -2,14 +2,6 @@ let nomarchyLib = import ../lib { inherit lib; }; - userPackagesFile = "${config.home.homeDirectory}/.config/home-manager/user-packages.json"; - userPackages = if builtins.pathExists userPackagesFile then - let - pkgNames = builtins.fromJSON (builtins.readFile userPackagesFile); - # Filter to only packages that exist in pkgs to prevent build failures - validPkgs = builtins.filter (name: builtins.hasAttr name pkgs) pkgNames; - in builtins.map (name: pkgs.${name}) validPkgs - else []; in { imports = [