Skip to content
This repository has been archived by the owner on Mar 30, 2023. It is now read-only.

make JSON writing optional #7

Merged
merged 1 commit into from
Feb 11, 2019
Merged

Conversation

zimbatm
Copy link
Contributor

@zimbatm zimbatm commented Feb 7, 2019

allow to pass writeJSON = false; and get the raw data instead.

This is useful if one wants to avoid writing secrets in the /nix/store. It also speeds up the rendering quite a bit.

Eg:

./render.sh

#!/usr/bin/env bash
set -euo pipefail

imageTag=foobar

toYAML() {
  ruby -ryaml -rjson -e 'puts YAML.dump(JSON.load(ARGF))'
}

nix-instantiate ./default.nix \
  --eval --strict --json \
  --argstr imageTag "$imageTag" \
  | toYAML 

default.nix

{ imageTag ? "latest" }:
let
  # where kubenix is added as an overlay
  pkgs = import ../nix {};

  configuration = import ./configuration.nix { inherit imageTag; };

  manifest = pkgs.kubenix.buildResources {
    inherit configuration;
    writeJSON = false;
  };
in
  manifest

allow to pass `writeJSON = false;` and get the raw data instead. This is
useful if one wants to avoid writing secrets in the /nix/store. Instead,
use `nix-instantiate --strict --eval --json`.
@zimbatm zimbatm mentioned this pull request Feb 7, 2019
@offlinehacker offlinehacker merged commit 9acf125 into xtruder:master Feb 11, 2019
@zimbatm zimbatm deleted the write-json branch February 13, 2019 10:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants