This repository provides a streamlined setup for using the Pkl CLI tool on NixOS, utilizing Nix flakes for easy configuration.
Make sure you have Nix installed. If not, you can install it using the following command:
sh <(curl -L https://nixos.org/nix/install) --daemon
- Clone this repository:
git clone https://github.com/byteshiva/nix-executable-pkl.git
cd nix-executable-pkl
- Enter the development environment:
nix develop
- Run the sample Pkl configuration:
# Evaluate Pkl configuration file
jpkl eval bird.pkl
# Evaluate Pkl configuration file and output in JSON format
jpkl eval -f json bird.pkl
# Evaluate Pkl configuration file and output in XML (plist) format
jpkl eval -f plist bird.pkl
- Customize the configuration:
Edit the bird.pkl
file to modify the sample Pkl configuration. Rerun the jpkl eval
commands to see the changes.
jpkl eval bird.pkl
The provided bird.pkl
file contains a simple configuration for a bird. Here's an example:
name = "Swallow"
job {
title = "Sr. Nest Maker"
company = "Nests R Us"
yearsOfExperience = 2
}
Feel free to experiment with different configurations to see how Pkl handles them.
Happy configuring!