From b3e11ed4a99bca48e47d7d7df6535c80dc73c79e Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 27 Feb 2025 21:03:30 -0500 Subject: [PATCH] tests: central darwin stubbing Until we can figure out how to resolve issue with stdenv. Makes it easier to revert when automatic stubbing is fixed for darwin stdenv --- tests/default.nix | 67 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 64 insertions(+), 3 deletions(-) diff --git a/tests/default.nix b/tests/default.nix index a7d571e3d..b15491421 100644 --- a/tests/default.nix +++ b/tests/default.nix @@ -61,10 +61,71 @@ let }; in outer; + darwinBlacklist = let + # List of packages that need to be scrubbed on Darwin + # Packages are scrubbed in linux and expected in test output + packagesToScrub = [ + "alot" + "antidote" + "atuin" + "bash-completion" + "carapace" + "delta" + "direnv" + "espanso" + "gh" + "ghostty" + "gnupg" + "granted" + "i3status" + "kitty" + "lesspipe" + "mu" + "msmtp" + "nheko" + "nix" + "nix-index" + "nix-your-shell" + "ollama" + "openstackclient" + "papis" + "pay-respects" + "pls" + "pyenv" + "sagemath" + "scmpuff" + "sm64ex" + "thefuck" + "wezterm" + "yubikey-agent" + "zellij" + "zplug" + ]; + + inner = self: super: + lib.mapAttrs (name: value: + if lib.elem name packagesToScrub then + # Apply scrubbing to this specific package + scrubDerivation name value + else + value) super; + + outer = self: super: + inner self super // { + buildPackages = super.buildPackages.extend inner; + }; + in outer; + scrubbedPkgs = - let rawScrubbedPkgs = lib.makeExtensible (final: scrubDerivations pkgs); - in builtins.traceVerbose "eval scrubbed nixpkgs" - (rawScrubbedPkgs.extend whitelist); + # TODO: fix darwin stdenv stubbing + if isDarwin then + let rawPkgs = lib.makeExtensible (final: pkgs); + in builtins.traceVerbose "eval scrubbed darwin nixpkgs" + (rawPkgs.extend darwinBlacklist) + else + let rawScrubbedPkgs = lib.makeExtensible (final: scrubDerivations pkgs); + in builtins.traceVerbose "eval scrubbed nixpkgs" + (rawScrubbedPkgs.extend whitelist); modules = import ../modules/modules.nix { inherit lib pkgs;