### Install Nickel with Homebrew Source: https://nickel-lang.org/getting-started On macOS, use Homebrew to install the Nickel binary. After installation, start an interactive session by running `nickel repl`. ```bash brew install nickel nickel repl nickel> ``` -------------------------------- ### Install Nickel with Nix Source: https://nickel-lang.org/getting-started Install the Nickel binary globally using `nix profile install` for more extensive use. After installation, you can run `nickel repl` to start an interactive session. ```bash nix profile install nixpkgs#nickel nickel repl nickel> ``` -------------------------------- ### Install Nickel with Cargo Source: https://nickel-lang.org/getting-started For Rust developers, install the Nickel CLI using Cargo. This command fetches and builds the `nickel-lang-cli` crate. Afterwards, run `nickel repl` to enter the interactive mode. ```bash cargo install nickel-lang-cli nickel repl nickel> ``` -------------------------------- ### Run Nickel REPL with Nix Source: https://nickel-lang.org/getting-started Use `nix run` to execute Nickel directly from Nixpkgs, passing `repl` as an argument to start an interactive session. Requires Nix version 2.4.0 or higher and experimental features enabled. ```bash nix run --experimental-features "flakes nix-command" nixpkgs#nickel -- repl nickel> ``` -------------------------------- ### Basic Nickel Configuration Record Source: https://nickel-lang.org/getting-started This snippet demonstrates a basic Nickel configuration for a fictional app, showcasing records, strings, multiline strings, arrays, and nested objects. It's useful for defining application metadata, scripts, and dependencies. ```nickel { name = "example", description = m%" This is an awesome software I'm developing. Please use it! "%, version = "0.1.1", main = "index.js", keywords = ["example", "config"], scripts = { test = m%" test.sh --option --install example --version \"0.1.1\" "%, do_stuff = "do_stuff.sh subcommand", }, contributors = [{ name = "John Doe", email = "johndoe@example.com" }, { name = "Ivy Lane", url = "https://example.com/ivylane" }], dependencies = { dep1 = "^1.0.0", dep3 = "6.7" } } ``` -------------------------------- ### Run Nickel REPL with Docker Source: https://nickel-lang.org/getting-started Use Docker to run a Nickel REPL session from a specified image. The `--rm` flag ensures the container is removed after exit, and `-it` provides an interactive terminal. ```bash docker run --rm -it ghcr.io/tweag/nickel:1.10.0 repl nickel> ``` -------------------------------- ### Export Nickel Configuration to YAML Source: https://nickel-lang.org/getting-started Exports a Nickel configuration file to YAML format. This is useful for generating static configuration files. ```bash nickel export example.ncl --format yaml ``` ```yaml --- contributors: - email: johndoe@example.com name: John Doe - name: Ivy Lane url: https://example.com/ivylane dependencies: dep1: ^1.0.0 dep3: "6.7" description: "This is awesome software I'm developing.\nPlease use it!" keywords: - example - config main: index.js name: example scripts: do_stuff: do_stuff.sh subcommand test: "test.sh --option --install example --version \"0.1.1\"" version: 0.1.1 ``` -------------------------------- ### Import YAML into Nickel Configuration Source: https://nickel-lang.org/getting-started Imports data from a YAML file into a Nickel configuration. This allows for gradual migration of existing configuration files. ```nickel { # [...] scripts = { test = m%" test.sh --option --install example --version "0.1.1" "%, do_stuff = "do_stuff.sh subcommand", }, contributors = import "contributors.yaml", # [...] } ``` -------------------------------- ### Reuse Values with String Interpolation in Nickel Source: https://nickel-lang.org/getting-started Demonstrates reusing values like 'name' and 'version' within other fields, such as 'scripts.test', using string interpolation. This ensures consistency when values are updated. ```nickel name = "example", version = "0.1.1", scripts = { test = m%" test.sh --option --install %{name} --version "%{version}" "%, ``` -------------------------------- ### Updated Configuration After Version Bump Source: https://nickel-lang.org/getting-started Shows the resulting configuration after updating the 'version' field and how string interpolation automatically updates related fields like 'scripts.test'. ```yaml # [...] scripts: do_stuff: do_stuff.sh subcommand test: "test.sh --option --install example --version \"0.1.2\"" version: 0.1.2 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.