File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 system ? builtins . currentSystem ,
33 pkgs ? import <nixpkgs> { inherit system ; } ,
44 nixosModules ,
5- } : {
6- sonarr-basic = import ./sonarr-basic.nix { inherit system pkgs nixosModules ; } ;
7- radarr-basic = import ./radarr-basic.nix { inherit system pkgs nixosModules ; } ;
8- lidarr-basic = import ./lidarr-basic.nix { inherit system pkgs nixosModules ; } ;
9- prowlarr-basic = import ./prowlarr-basic.nix { inherit system pkgs nixosModules ; } ;
10- sabnzbd-basic = import ./sabnzbd-basic.nix { inherit system pkgs nixosModules ; } ;
11- full-stack = import ./full-stack.nix { inherit system pkgs nixosModules ; } ;
12- nginx-integration = import ./nginx-integration.nix { inherit system pkgs nixosModules ; } ;
13- postgresql-integration = import ./postgresql-integration.nix { inherit system pkgs nixosModules ; } ;
14- mullvad-integration = import ./mullvad-integration.nix { inherit system pkgs nixosModules ; } ;
15- }
5+ } : let
6+ # Get all .nix files in the current directory except default.nix
7+ testFiles = builtins . filter
8+ ( name : name != "default.nix" && pkgs . lib . hasSuffix ".nix" name )
9+ ( builtins . attrNames ( builtins . readDir ./. ) ) ;
10+
11+ # Convert filename to test name (e.g., "sonarr-basic.nix" -> "sonarr-basic")
12+ testNameFromFile = file : pkgs . lib . removeSuffix ".nix" file ;
13+
14+ # Import each test file with the required arguments
15+ importTest = file : import ( ./. + "/${ file } " ) { inherit system pkgs nixosModules ; } ;
16+ in
17+ # Create an attribute set of all tests
18+ builtins . listToAttrs (
19+ map ( file : {
20+ name = testNameFromFile file ;
21+ value = importTest file ;
22+ } ) testFiles
23+ )
You can’t perform that action at this time.
0 commit comments