{"id":50972144,"url":"https://github.com/wearetechnative/nivis","last_synced_at":"2026-06-19T03:30:30.874Z","repository":{"id":364979969,"uuid":"1269995503","full_name":"wearetechnative/nivis","owner":"wearetechnative","description":"experimental terraform nix mariage","archived":false,"fork":false,"pushed_at":"2026-06-15T20:44:29.000Z","size":1428,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-15T21:24:53.418Z","etag":null,"topics":["aws","azure","iac","nix","nixos","opentofu","terraform"],"latest_commit_sha":null,"homepage":"https://wearetechnative.github.io/nivis/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wearetechnative.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":"docs/ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-15T09:31:26.000Z","updated_at":"2026-06-15T20:44:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/wearetechnative/nivis","commit_stats":null,"previous_names":["wearetechnative/nixform","wearetechnative/terrae-nivis","wearetechnative/nivis"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wearetechnative/nivis","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fnivis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fnivis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fnivis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fnivis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wearetechnative","download_url":"https://codeload.github.com/wearetechnative/nivis/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wearetechnative%2Fnivis/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34516549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","azure","iac","nix","nixos","opentofu","terraform"],"created_at":"2026-06-19T03:30:29.226Z","updated_at":"2026-06-19T03:30:30.869Z","avatar_url":"https://github.com/wearetechnative.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"docs/assets/banner.png\" alt=\"Nivis: All your base belongs to Nix\" width=\"100%\"\u003e\n\u003c/p\u003e\n\n# Nivis\n\nNivis lets you manage real infrastructure from Nix: Terraform/OpenTofu **provider\nresources are first-class Nix values**. You write your infra in a flake; a thin\nGo executor speaks the provider plugin protocol directly to **unmodified provider\nbinaries** and applies it. No HCL, no separate state language, Nix is the\nconfiguration, the provider does the work.\n\nThe capability that sets Nivis apart is the **round trip**: a provider-created\nresource returns computed values (an IP, an ID, a generated name) back **into\nNix**, which re-evaluates to produce dependent configuration, repeating to a\nfixpoint. So a value generated by your cloud can become the input to the next\nresource, or the body of a file, computed in Nix. (See it end to end in the\n[AWS tutorial](docs/TUTORIAL-AWS-S3.md).)\n\n\u003e **Status:** early but real. The round trip works across two\n\u003e providers, and real providers (AWS today) apply/update/replace/destroy. Expect\n\u003e rough edges; the contracts (the IR, the flake interface) are the stable parts.\n\n## Quickstart\n\nYou need **Nix** (with flakes). Run Nivis straight from the flake, no checkout:\n\n```sh\nnix run github:wearetechnative/nivis#nivis -- --version\n```\n\nThen point it at a flake that describes your infra. A minimal one:\n\n```nix\n{\n  inputs.nivis.url = \"github:wearetechnative/nivis\";\n\n  outputs = { self, nivis }:\n    let lib = nivis.lib; in {\n      # `nivis` evaluates this attribute by default.\n      nivis.plan = ledger: lib.toIR {\n        providers.aws = lib.mkProvider {\n          source = \"registry.opentofu.org/hashicorp/aws\";\n          config.region = \"eu-central-1\";\n        };\n        resources = [\n          (lib.mkResource {\n            provider = \"aws\"; type = \"aws_s3_bucket\"; name = \"demo\";\n            config.force_destroy = true;\n          })\n        ];\n        inherit ledger;\n      };\n    };\n}\n```\n\nFrom that directory:\n\n```sh\nnivis plan      # show what will change   (+ create  ~ update  -/+ replace  = no change)\nnivis apply     # apply, resolving across phases to a fixpoint\nnivis state show \u003cresource-id\u003e\nnivis destroy\n```\n\n(`nivis` shells out to `nix` to evaluate your config, and fetches + checksum-\nverifies real providers from the OpenTofu registry on first use.)\n\n- **New here?** The **[getting-started guide](docs/GETTING-STARTED.md)** walks the\n  offline demo (in-repo fake providers, no cloud) and schema codegen (`nivis gen`).\n- **Real infra?** The **[AWS S3 tutorial](docs/TUTORIAL-AWS-S3.md)** builds a\n  bucket and a file whose contents Nix generates from the bucket's name (the\n  round trip), from an empty directory.\n- **Installing `nivis`** (`nix shell`, `nix profile`): see\n  **[docs/INSTALL.md](docs/INSTALL.md)**.\n- **How does it compare?** An honest **[comparison](docs/COMPARISON.md)** with\n  Terranix, OpenTofu/Terraform, Pulumi, NixOps, CDK and CloudFormation, including\n  where Nivis is still young.\n- Browse it all on the **[docs site](https://wearetechnative.github.io/nivis/)**.\n\n## How it works (one paragraph)\n\nNix evaluates your configuration to a JSON **IR**. Values that aren't known until\napply-time are emitted as typed placeholders, a `__ref` (another resource's\noutput) or a `__derived` (a value Nix *computed* from an output). The executor\ningests the IR, drives the providers, gathers their apply-time outputs into a\n**ledger**, then **re-evaluates Nix** with that ledger injected so placeholders\nresolve; deeper chains take more phases, to a fixpoint. The full reasoning and\nwhy this (not an `Output\u003cT\u003e` promise model) is the honest, Nix-shaped approach\nis in **[docs/OVERVIEW.md](docs/OVERVIEW.md)** and\n**[docs/DESIGN.md](docs/DESIGN.md)**.\n\n## The Nix library\n\n`nivis.lib` is pure (builtins only, no nixpkgs, so it evaluates without the\nbinary cache):\n\n- `mkResource { provider; type; name; config; }`: a resource, with output\n  references (`refAttr`) for wiring one resource into another.\n- `mkData { provider; type; name; config; }`: a datasource (existing infra to\n  read, not create); its outputs feed resources via `refAttr`, read per phase.\n  See **[docs/DATASOURCES.md](docs/DATASOURCES.md)**.\n- `mkProvider { source; config; }`: a provider, config (incl. nested blocks) in\n  Nix; flows into the provider's `Configure`.\n- `str`/`derived`: build values from provider outputs (the round trip).\n- `mkVars`: declare typed config variables with defaults (required when no\n  default), resolved from `--var` / `--var-file` / `NIVIS_VAR_*` (an explicit\n  `--var` wins). Read them as `vars.\u003cname\u003e` in the plan.\n- `drv`/`drvFile`: mark a Nix build output (a derivation) so `nivis apply`\n  realises it before use; `drv d` uses `d.passthru.filePath` when present,\n  `drvFile d \"sub/path\"` names a file explicitly. (See the EC2 tutorial.)\n- `toIR`: serialize to the IR; `mkResources` (`count`/`for_each`) and\n  `evalModules` (module composition).\n\n`nivis gen --provider \u003cbinary\u003e --out \u003cdir\u003e` generates typed constructors from any\nprovider's schema, including nested blocks (with the right list-vs-single shape).\nThe generated constructor doubles as the per-provider argument reference.\n\n## Stable contracts\n\nVersioned interfaces, change the spec before the shape:\n\n- **The IR**: `docs/IR-CONTRACT.md` + `docs/ir-schema.json` (the normative JSON\n  Schema). Both the Nix `toIR` producer and the Go consumer validate against it.\n- **The flake interface**: `nivis.plan = ledger → IR`, evaluated each phase with\n  the outputs ledger injected.\n\n## Contributing / building from source\n\nNivis is built with the standard Go toolchain; the flake (`nix build .#nivis`,\n`nix run .#nivis`) is the packaged path. From a checkout:\n\n```sh\ngo build -o bin/nivis ./cmd/nivis     # the CLI\ngo test ./...                         # Go unit + e2e (uses the in-repo fakes)\nbash tests/run-nix-tests.sh           # Nix property tests + IR conformance\nbash tests/check-docs-ssot.sh         # docs single-source-of-truth\n```\n\nThe repo follows a spec-driven process guided by `openspec/` (the per-change\nspecs). Releases: `docs/RELEASING.md`.\n\n## License\n\nNivis's own code is **Apache-2.0** (`LICENSE`). See `LICENSING.md` for the\nbreakdown and `NOTICE` for attributions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearetechnative%2Fnivis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwearetechnative%2Fnivis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwearetechnative%2Fnivis/lists"}