Restructure CUE packages

A bunch of stuff that wasn't schema definitions ended up in the `schema`
package.  Rather than split values up in a bunch of top-level packages,
I think it would be better to have a package-per-app model.
master
Dustin 2024-01-17 16:23:49 -06:00
parent 52642d37d9
commit 41e9fa85d2
8 changed files with 12 additions and 11 deletions

View File

@ -1,10 +1,5 @@
package nut package nut
#CollectdNut: {
ups: [...string]
load_plugin: bool | *true
}
collectd: { collectd: {
templates: [ templates: [
{ {

View File

@ -0,0 +1,6 @@
package schema
#CollectdNut: {
ups: [...string]
load_plugin: bool | *true
}

View File

@ -1,4 +1,4 @@
package nut package schema
#Ups: { #Ups: {
driver: string driver: string

View File

@ -1,6 +1,6 @@
package nut package nut
import "du5t1n.me/cfg/schema/app/containerudev" import "du5t1n.me/cfg/app/containerudev"
templates: containerudev.templates + [ templates: containerudev.templates + [
{ {

6
env/prod/nut.cue vendored
View File

@ -1,8 +1,8 @@
package prod package prod
import n "du5t1n.me/cfg/schema/app/nut" import "du5t1n.me/cfg/app/nut/schema"
nut: n.#Nut & { nut: schema.#Nut & {
listen: { listen: {
address: "::" address: "::"
port: 3493 port: 3493
@ -58,6 +58,6 @@ nut: n.#Nut & {
let _nut = nut let _nut = nut
collectd: nut: n.#CollectdNut & { collectd: nut: schema.#CollectdNut & {
ups: [for k, v in _nut.ups {k + "@localhost"}] ups: [for k, v in _nut.ups {k + "@localhost"}]
} }

View File

@ -1,7 +1,7 @@
package nut0 package nut0
import ( import (
"du5t1n.me/cfg/schema/app/nut" "du5t1n.me/cfg/app/nut"
) )
render: nut.templates + nut.collectd.templates render: nut.templates + nut.collectd.templates