File tree Expand file tree Collapse file tree 2 files changed +146
-0
lines changed Expand file tree Collapse file tree 2 files changed +146
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ description = "cddl-codegen: Generate Rust, WASM and JSON code from CDDL specifications" ;
3+
4+ inputs = {
5+ nixpkgs . url = "github:NixOS/nixpkgs/nixos-unstable" ;
6+ flake-utils . url = "github:numtide/flake-utils" ;
7+ rust-overlay = {
8+ url = "github:oxalica/rust-overlay" ;
9+ inputs . nixpkgs . follows = "nixpkgs" ;
10+ } ;
11+ } ;
12+
13+ outputs = {
14+ nixpkgs ,
15+ flake-utils ,
16+ rust-overlay ,
17+ ...
18+ } :
19+ flake-utils . lib . eachDefaultSystem (
20+ system : let
21+ pkgs = import nixpkgs {
22+ overlays = [ ( import rust-overlay ) ] ;
23+ inherit system ;
24+ } ;
25+
26+ rustToolchain = pkgs . rust-bin . nightly . latest . default ;
27+
28+ nativeBuildInputs = with pkgs ; [
29+ rustToolchain
30+ pkg-config
31+ which
32+ ] ;
33+ in {
34+ devShells . default = pkgs . mkShell {
35+ buildInputs = nativeBuildInputs ;
36+ } ;
37+
38+ packages . default = pkgs . rustPlatform . buildRustPackage {
39+ pname = "cddl-codegen" ;
40+ version = "0.1.0" ;
41+ src = ./. ;
42+
43+ cargoLock = {
44+ lockFile = ./Cargo.lock ;
45+ allowBuiltinFetchGit = true ;
46+ } ;
47+
48+ # the regular tests don't run yet
49+ checkPhase = ''
50+ cargo test comment_ast
51+ '' ;
52+
53+ inherit nativeBuildInputs ;
54+
55+ meta = with pkgs . lib ; {
56+ description = "Codegen serialization logic for CBOR automatically from a CDDL specification" ;
57+ homepage = "https://github.com/dcSpark/cddl-codegen" ;
58+ license = licenses . mit ;
59+ maintainers = [ ] ;
60+ } ;
61+ } ;
62+ }
63+ ) ;
64+ }
You can’t perform that action at this time.
0 commit comments