|
1 | 1 | inputs: |
2 | 2 | let |
3 | | - # inherits |
| 3 | + |
4 | 4 | inherit (inputs.nixpkgs-lib) |
5 | 5 | lib |
6 | 6 | ; |
|
9 | 9 | mapAttrs |
10 | 10 | ; |
11 | 11 |
|
12 | | - inherit (lib.fileset) |
13 | | - toSource |
14 | | - unions |
15 | | - ; |
16 | | - |
17 | | - # sources |
18 | | - |
19 | | - # Used for derivations where facts is the primary directory. |
20 | | - factsSrc = toSource { |
21 | | - root = ../..; |
22 | | - fileset = unions [ |
23 | | - ../../facts |
24 | | - ../../switch-configuration |
25 | | - ]; |
26 | | - }; |
27 | | - |
28 | | - # Used for derivations where switch-configuration is the primary directory. |
29 | | - switchConfigurationSrc = toSource { |
30 | | - root = ../..; |
31 | | - fileset = unions [ |
32 | | - ../../facts |
33 | | - ../../switch-configuration |
34 | | - ]; |
35 | | - }; |
36 | | - |
37 | | - # Used for derivations where openwrt is the primary directory. |
38 | | - openwrtSrc = toSource { |
39 | | - root = ../..; |
40 | | - fileset = unions [ |
41 | | - ../../facts |
42 | | - ../../openwrt |
43 | | - ../../tests |
44 | | - ]; |
45 | | - }; |
46 | 12 | in |
47 | 13 | mapAttrs (system: pkgs: { |
48 | | - core = pkgs.testers.runNixOSTest (import ./core.nix { inherit inputs lib; }); |
49 | | - routers = pkgs.testers.runNixOSTest (import ./routers.nix { inherit inputs; }); |
50 | | - router-border = pkgs.testers.runNixOSTest (import ./router-border.nix { inherit inputs lib; }); |
51 | | - loghost = pkgs.testers.runNixOSTest (import ./loghost.nix { inherit inputs; }); |
52 | | - monitor = pkgs.testers.runNixOSTest (import ./monitor.nix { inherit inputs; }); |
53 | | - wasgeht = pkgs.testers.runNixOSTest (import ./wasgeht.nix { inherit inputs; }); |
54 | | - |
55 | | - pytest-facts = |
56 | | - let |
57 | | - testPython = ( |
58 | | - pkgs.python3.withPackages ( |
59 | | - pythonPackages: with pythonPackages; [ |
60 | | - pylint |
61 | | - pytest |
62 | | - jinja2 |
63 | | - pandas |
64 | | - ] |
65 | | - ) |
66 | | - ); |
67 | | - in |
68 | | - (pkgs.runCommand "pytest-facts" |
69 | | - { |
70 | | - src = factsSrc; |
71 | | - buildInputs = [ testPython ]; |
72 | | - } |
73 | | - '' |
74 | | - cd $src/facts |
75 | | - pylint --persistent n *.py |
76 | | - pytest -vv -p no:cacheprovider |
77 | | - touch $out |
78 | | - '' |
79 | | - ); |
80 | | - |
81 | | - perl-switches = pkgs.stdenv.mkDerivation (finalAttrs: { |
82 | | - pname = "perl-switches"; |
83 | | - version = "0.1.0"; |
84 | | - |
85 | | - src = switchConfigurationSrc; |
86 | | - |
87 | | - nativeBuildInputs = with pkgs; [ |
88 | | - gnumake |
89 | | - perl |
90 | | - ]; |
91 | | - |
92 | | - buildPhase = '' |
93 | | - cd switch-configuration |
94 | | - make .lint |
95 | | - make .build-switch-configs |
96 | | - ''; |
97 | | - |
98 | | - installPhase = '' |
99 | | - touch $out |
100 | | - ''; |
101 | | - }); |
102 | | - |
103 | | - openwrt-golden = pkgs.stdenv.mkDerivation (finalAttrs: { |
104 | | - pname = "openwrt-golden"; |
105 | | - version = "0.1.0"; |
106 | | - |
107 | | - src = openwrtSrc; |
108 | | - |
109 | | - buildInputs = [ |
110 | | - pkgs.diffutils |
111 | | - pkgs.gomplate |
112 | | - ]; |
113 | | - |
114 | | - buildPhase = '' |
115 | | - cd tests/unit/openwrt |
116 | | - mkdir -p $out/tmp/ath79 |
117 | | - ''; |
118 | | - |
119 | | - installPhase = '' |
120 | | - ./test.sh -t ath79 -o $out |
121 | | - ''; |
122 | | - }); |
123 | 14 |
|
124 | 15 | formatting = inputs.self.formatterModule.${system}.config.build.check inputs.self; |
125 | 16 |
|
|
0 commit comments