Skip to content

byteshiva/nix-executable-pkl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pkl CLI on NixOS

This repository provides a streamlined setup for using the Pkl CLI tool on NixOS, utilizing Nix flakes for easy configuration.

Getting Started

Prerequisites

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

Setup

  1. Clone this repository:
git clone https://github.com/byteshiva/nix-executable-pkl.git
cd nix-executable-pkl
  1. Enter the development environment:
nix develop
  1. 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
  1. 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

Sample Configuration

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!

Releases

No releases published

Packages

No packages published

Languages