This commit is contained in:
Dario48 2026-02-21 00:51:37 +01:00
commit 1f0a783560
9 changed files with 1045 additions and 0 deletions

58
flake.nix Normal file
View file

@ -0,0 +1,58 @@
{
description = "Description for the project";
inputs = {
flake-parts.url = "github:hercules-ci/flake-parts";
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
devshell.url = "github:numtide/devshell";
};
outputs =
inputs@{
flake-parts,
nixpkgs,
...
}:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
inputs.devshell.flakeModule
];
systems = nixpkgs.lib.systems.flakeExposed;
perSystem =
{
self',
pkgs,
system,
lib,
...
}:
{
packages.parser = pkgs.stdenv.mkDerivation {
pname = "feng parser";
version = "1.0";
src = ./grammar;
buildInputs = with pkgs; [
clang
peg
];
buildPhase = ''
peg -o peg.c grammar.peg
clang parser.c -o parser
'';
installPhase = ''
mkdir -p $out/bin
install parser $out/bin/parser
'';
};
devShells.default = pkgs.mkShell {
buildInputs = [
self'.packages.parser
];
};
};
flake = {
};
};
}