blob: 7416e28ef57bc53aa01c0c0715b59ebd49341518 [file] [log] [blame]
gio36b23b32024-08-25 12:20:54 +04001input: {
gio9bd87ca2025-04-20 08:05:34 +04002 name: string @name(Hostname)
3 username: string @name(Username)
4 authKey?: string @name(Auth Key) @role(VPNAuthKey) @usernameField(username) @enabledField(vpnEnabled)
5 cpuCores: int | *1 @name(CPU Cores)
6 memory: string | *"2Gi" @name(Memory)
7 vpnEnabled?: bool @name(Enable VPN)
8 codeServerEnabled?: bool @name(Install VSCode Server)
gio36b23b32024-08-25 12:20:54 +04009}
10
gio9bd87ca2025-04-20 08:05:34 +040011name: "Virtual Machine"
12namespace: "app-vm"
13readme: "Virtual Machine"
gio36b23b32024-08-25 12:20:54 +040014description: "Virtual Machine"
15icon: """
giod2d2df02025-05-03 19:15:17 +040016 <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 2048 2048"><path fill="currentColor" d="M1280 384H640V256h640zm0 1024H640v-128h640zm0 256H640v-128h640zM1408 0q27 0 50 10t40 27t28 41t10 50v1792H384V128q0-27 10-50t27-40t41-28t50-10zm0 128H512v1664h896z"/></svg>"""
gio36b23b32024-08-25 12:20:54 +040017
gio7fbd4ad2024-08-27 10:06:39 +040018out: {
19 vm: {
20 "\(input.name)": {
21 username: input.username
gio9bd87ca2025-04-20 08:05:34 +040022 domain: global.domain
gio36b23b32024-08-25 12:20:54 +040023 cpuCores: input.cpuCores
gio9bd87ca2025-04-20 08:05:34 +040024 memory: input.memory
giof6ad2982024-08-23 17:42:49 +040025 if input.vpnEnabled != _|_ {
26 if !input.vpnEnabled {
27 vpn: enabled: false
gio29f6b872024-09-08 16:14:58 +040028 }
giof6ad2982024-08-23 17:42:49 +040029 if input.vpnEnabled {
30 vpn: {
gio9bd87ca2025-04-20 08:05:34 +040031 enabled: true
giof6ad2982024-08-23 17:42:49 +040032 loginServer: "https://headscale.\(global.domain)"
gio9bd87ca2025-04-20 08:05:34 +040033 authKey: input.authKey
giof6ad2982024-08-23 17:42:49 +040034 }
35 }
36 }
37 if input.codeServerEnabled != _|_ {
gioa1f29472025-05-14 13:05:05 +040038 codeServer: {
39 enabled: input.codeServerEnabled
40 }
gio36b23b32024-08-25 12:20:54 +040041 }
gio36b23b32024-08-25 12:20:54 +040042 }
43 }
44}