stylix: conditionally load external modules in testbeds (#1698)
Conditionally load external modules in testbeds to preserve testbed integrity by preventing unrelated code from running and potentially invalidating its meaning. Any performance benefit is merely a side effect of this more targeted module loading. Link: https://github.com/nix-community/stylix/pull/1698 Reviewed-by: awwpotato <awwpotato@voidq.com> Reviewed-by: Flameopathic <64027365+Flameopathic@users.noreply.github.com>
This commit is contained in:
parent
2e2e96f6b0
commit
24499b0049
1 changed files with 16 additions and 6 deletions
|
|
@ -3,6 +3,7 @@
|
|||
inputs,
|
||||
lib,
|
||||
modules ? import ./autoload.nix { inherit pkgs lib; },
|
||||
testbedFieldSeparator ? ":",
|
||||
}:
|
||||
let
|
||||
makeTestbed =
|
||||
|
|
@ -19,15 +20,24 @@ let
|
|||
inputs.self.nixosModules.stylix
|
||||
inputs.home-manager.nixosModules.home-manager
|
||||
testbed
|
||||
|
||||
# modules for external targets
|
||||
inputs.nvf.nixosModules.default
|
||||
inputs.nixvim.nixosModules.nixvim
|
||||
inputs.spicetify-nix.nixosModules.spicetify
|
||||
]
|
||||
++ map (name: import ./graphical-environments/${name}.nix) (
|
||||
import ./available-graphical-environments.nix { inherit lib; }
|
||||
);
|
||||
)
|
||||
++
|
||||
lib.mapAttrsToList
|
||||
(
|
||||
target:
|
||||
lib.optionalAttrs (
|
||||
lib.hasPrefix "testbed${testbedFieldSeparator}${target}" name
|
||||
)
|
||||
)
|
||||
{
|
||||
inherit (inputs.nixvim.nixosModules) nixvim;
|
||||
inherit (inputs.spicetify-nix.nixosModules) spicetify;
|
||||
|
||||
nvf = inputs.nvf.nixosModules.default;
|
||||
};
|
||||
};
|
||||
in
|
||||
pkgs.writeShellApplication {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue