|
| 1 | +{ withSystem, ... }: |
1 | 2 | { |
2 | | - config, |
3 | | - lib, |
4 | | - ... |
5 | | -}: |
6 | | -{ |
7 | | - options.mcl.host-info = with lib; { |
8 | | - type = mkOption { |
9 | | - type = types.nullOr ( |
10 | | - types.enum [ |
11 | | - "desktop" |
12 | | - "server" |
13 | | - ] |
14 | | - ); |
15 | | - default = null; |
16 | | - example = [ "desktop" ]; |
17 | | - description = '' |
18 | | - Whether this host is a desktop or a server. |
19 | | - ''; |
20 | | - }; |
| 3 | + flake.modules.nixos.mcl-host-info = |
| 4 | + { |
| 5 | + config, |
| 6 | + lib, |
| 7 | + ... |
| 8 | + }: |
| 9 | + { |
| 10 | + options.mcl.host-info = with lib; { |
| 11 | + type = mkOption { |
| 12 | + type = types.nullOr ( |
| 13 | + types.enum [ |
| 14 | + "desktop" |
| 15 | + "server" |
| 16 | + "container" |
| 17 | + ] |
| 18 | + ); |
| 19 | + default = null; |
| 20 | + example = [ "desktop" ]; |
| 21 | + description = '' |
| 22 | + Whether this host is a desktop or a server. |
| 23 | + ''; |
| 24 | + }; |
21 | 25 |
|
22 | | - isVM = mkOption { |
23 | | - type = types.nullOr types.bool; |
24 | | - default = null; |
25 | | - example = [ "false" ]; |
26 | | - description = '' |
27 | | - Whether this configuration is a VM variant. |
28 | | - ''; |
29 | | - }; |
| 26 | + isDebugVM = mkOption { |
| 27 | + type = types.nullOr types.bool; |
| 28 | + default = null; |
| 29 | + example = [ "false" ]; |
| 30 | + description = '' |
| 31 | + Whether this configuration is a VM variant with extra debug |
| 32 | + functionality. |
| 33 | + ''; |
| 34 | + }; |
| 35 | + |
| 36 | + configPath = mkOption { |
| 37 | + type = types.nullOr types.path; |
| 38 | + default = null; |
| 39 | + example = [ "machines/server/solunska-server" ]; |
| 40 | + description = '' |
| 41 | + The configuration path for this host relative to the repo root. |
| 42 | + ''; |
| 43 | + }; |
30 | 44 |
|
31 | | - configPath = mkOption { |
32 | | - type = types.nullOr types.string; |
33 | | - default = null; |
34 | | - example = [ "machines/server/solunska-server" ]; |
35 | | - description = '' |
36 | | - The configuration path for this host relative to the repo root. |
37 | | - ''; |
| 45 | + sshKey = mkOption { |
| 46 | + type = types.nullOr types.str; |
| 47 | + default = ""; |
| 48 | + example = "ssh-ed25519 AAAAC3Nza"; |
| 49 | + description = '' |
| 50 | + The public ssh key for this host. |
| 51 | + ''; |
| 52 | + }; |
| 53 | + }; |
| 54 | + config = { |
| 55 | + assertions = [ |
| 56 | + { |
| 57 | + assertion = config.mcl.host-info.type != null; |
| 58 | + message = "mcl.host-info.type must be defined for every host"; |
| 59 | + } |
| 60 | + { |
| 61 | + assertion = config.mcl.host-info.isDebugVM != null; |
| 62 | + message = "mcl.host-info.isDebugVM must be defined for every host"; |
| 63 | + } |
| 64 | + { |
| 65 | + assertion = config.mcl.host-info.configPath != null; |
| 66 | + message = "mcl.host-info.configPath must be defined for every host"; |
| 67 | + } |
| 68 | + ]; |
| 69 | + }; |
38 | 70 | }; |
39 | | - }; |
40 | | - config = { |
41 | | - assertions = [ |
42 | | - { |
43 | | - assertion = config.mcl.host-info.type != null; |
44 | | - message = "mcl.host-info.type must be defined for every host"; |
45 | | - } |
46 | | - { |
47 | | - assertion = config.mcl.host-info.isVM != null; |
48 | | - message = "mcl.host-info.isVM must be defined for every host"; |
49 | | - } |
50 | | - { |
51 | | - assertion = config.mcl.host-info.configPath != null; |
52 | | - message = "mcl.host-info.configPath must be defined for every host"; |
53 | | - } |
54 | | - ]; |
55 | | - }; |
56 | 71 | } |
0 commit comments