-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
31 lines (31 loc) · 1.33 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
description = "cpp parser inspired with boost.spirit, without dependencies and poison";
inputs = {
nixpkgs.url = "nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
cppbm.url = "github:zerhud/cppbm";
cppbm.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = params@{ self, nixpkgs, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
tref = params.cppbm.packages."${system}".tref;
der = pkgs.gcc13Stdenv.mkDerivation {
name = "ascip";
buildInputs = [ tref ];
nativeBuildInputs = [pkgs.clang_17];
installPhase = "mkdir -p \"$out/include\" && cp ascip.hpp -t \"$out/include\" && cp -rt \"$out/include\" ascip";
buildPhase = "g++ -std=c++23 -fwhole-program -march=native ./test.cpp -o ascip_test && ./ascip_test";
meta.description = "ascip is a clean cpp ascii parser, it doesn't requires any changes in using code, has no dependecies. single header file.";
src = ./.;
};
in rec {
devShell = der.overrideAttrs(finalAttrs: previousAttrs: {
nativeBuildInputs = previousAttrs.nativeBuildInputs ++ [ pkgs.jetbrains.clion ];
});
packages.default = der;
packages.ascip = der;
defaultPackage = der;
});
}