blob: 841cb8b33339e4bdd3ff140bba8a8b4d6a5545e0 [file] [log] [blame]
gio36b23b32024-08-25 12:20:54 +04001input: {
2 name: string @name(Hostname)
3 username: string @name(Username)
gio29f6b872024-09-08 16:14:58 +04004 authKey?: string @name(Auth Key) @role(VPNAuthKey) @usernameField(username) @enabledField(vpnEnabled)
gio36b23b32024-08-25 12:20:54 +04005 cpuCores: int | *1 @name(CPU Cores)
6 memory: string | *"2Gi" @name(Memory)
giof6ad2982024-08-23 17:42:49 +04007 vpnEnabled?: bool @name(Enable VPN)
8 codeServerEnabled?: bool @name(Install VSCode Server)
gio36b23b32024-08-25 12:20:54 +04009}
10
11name: "Virutal Machine"
12namespace: "app-vm"
13readme: "Virtual Machine"
14description: "Virtual Machine"
15icon: """
gio7fbd4ad2024-08-27 10:06:39 +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
22 domain: global.domain
gio36b23b32024-08-25 12:20:54 +040023 cpuCores: input.cpuCores
24 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: {
31 enabled: true
32 loginServer: "https://headscale.\(global.domain)"
33 authKey: input.authKey
34 }
35 }
36 }
37 if input.codeServerEnabled != _|_ {
38 codeServerEnabled: input.codeServerEnabled
gio36b23b32024-08-25 12:20:54 +040039 }
gio36b23b32024-08-25 12:20:54 +040040 }
41 }
42}