A Clojure-inspired Lisp that compiles to Nix.
Files
README.md

A feeble man sought power through the grotesque act of grafting. "One day we'll return together, to our home, bathed in rays of gold."

Godrick #

Godrick is a Clojure-inspired Lisp that compiles to Nix, providing full interop between Nix and Godrick code.

Example #

A NixOS module in Godrick:

(defmodule ["services" "greeter"]
           {:enable (lib.mkEnableOption "the greeter")
            :name (option lib.types.str "world" "Who to greet.")}
           {:environment {:etc {:greeting {:text "hello ${cfg.name}\n"}}
                          :systemPackages (from pkgs ["hello" "cowsay"])}})

The Nix it compiles to:

{ config, lib, pkgs, ... }:
let
  cfg = config.services.greeter;
in
{
  options = {
    services = {
      greeter = {
        enable = lib.mkEnableOption "the greeter";
        name = lib.mkOption {
          type = lib.types.str;
          default = "world";
          description = "Who to greet.";
        };
      };
    };
  };
  config = lib.mkIf cfg.enable {
    environment = {
      etc = { greeting = { text = "hello ${cfg.name}\n"; }; };
      systemPackages = [ pkgs.hello pkgs.cowsay ];
    };
  };
}

Documentation #

DOCS.md is the full guide to the language, the tools, and working on Godrick itself.