File: flake.nix

package info (click to toggle)
rust-cddl 0.9.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 956 kB
  • sloc: makefile: 2
file content (64 lines) | stat: -rw-r--r-- 1,593 bytes parent folder | download | duplicates (2)
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
  description = "A Rust implementation of the Concise data definition language (CDDL)";

  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
    rust-overlay = {
      url = "github:oxalica/rust-overlay";
      inputs.nixpkgs.follows = "nixpkgs";
    };
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = {
    nixpkgs,
    rust-overlay,
    flake-utils,
    ...
  }:
    flake-utils.lib.eachDefaultSystem (
      system: let
        overlays = [(import rust-overlay)];
        pkgs = import nixpkgs {
          inherit system overlays;
        };

        rustToolchain = pkgs.rust-bin.stable.latest.default;
        nativeBuildInputs = with pkgs; [
          rustToolchain
          pkg-config
        ];

        buildInputs = with pkgs; [
          glibc
        ];
      in {
        packages.default = pkgs.rustPlatform.buildRustPackage {
          inherit nativeBuildInputs buildInputs;
          pname = "cddl";
          version = "0.9.5";

          src = ./.;

          cargoLock = {
            lockFile = ./Cargo.lock;
            allowBuiltinFetchGit = true;
          };

          meta = with pkgs.lib; {
            description = "Parser for the Concise data definition language (CDDL)";
            homepage = "https://cddl.anweiss.tech";
            license = licenses.mit;
            maintainers = ["Andrew Weiss <andrew.weiss@outlook.com>"];
          };
        };

        devShells.default = pkgs.mkShell {
          buildInputs = [
            nativeBuildInputs
            buildInputs
          ];
        };
      }
    );
}