Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export nickel schema to nix? #191

Open
abueide opened this issue Mar 23, 2024 · 1 comment
Open

Export nickel schema to nix? #191

abueide opened this issue Mar 23, 2024 · 1 comment

Comments

@abueide
Copy link

abueide commented Mar 23, 2024

Hi,

Is there a straightforward way to export a nickel expression containing a list of my machines to a simple nix expression like you can with json, toml etc? It'd be cool to have my systems defined in a nickel expression then be able to export them to json for my ci/cd pipeline and to nix for my actual build configurations.

let { SystemSchema, .. } = import "system-schema.ncl" in
let { NetworkSchema, .. } = import "../networks/network-schema.ncl" in
let abyslNetworks = import "../networks/networks.ncl" in
{
    zitadel | SystemSchema = { host = "zitadel", ip = "10.0.22.2", networks = [ abyslNetworks.public ] },
}
@YorikSar
Copy link
Collaborator

Nix is not a great format for data transfer between systems. I’d recommend exporting data to JSON and loading it from it in Nix using builtins.fromJSON.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants