Skip to content
lomenzelPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nix-Nix

A pure Nix parser and interpreter implemented entirely in Nix.

nix-nix parses Nix expressions into an Abstract Syntax Tree (AST) using nix-parsec and evaluates them inside a custom tree-walking evaluation environment. It provides both safe evaluation (returning { success, value, error } without throwing runtime crashes) and raw evaluation modes.

Usage

Add nix-nix to your flake.nix inputs:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    nix-nix.url = "github:<owner>/nix-nix";
  };

  outputs = { self, nixpkgs, nix-nix, ... }:
      packages.armv7l-linux = let
        pkgs = import nixpkgs {
            system = "armv7l-linux";
            overlays = [ nix-nix.overlays.default ];
        };
      in
      { default = 
        pkgs.runCommand "hello-world" {} ''
            touch $out
            echo ${(pkgs.lib.evalString {a = "hallo";} "a + \" welt\"").value} > $out
        '';
      };
  };
}

the env is optional, so evalString "(x: x + 1) 1" does also work

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages