-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
64 lines (59 loc) · 1.77 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
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 = "Pie language";
inputs = {
cargo2nix.url = "github:cargo2nix/cargo2nix/release-0.11.0";
utils.follows = "cargo2nix/flake-utils";
nixpkgs.follows = "cargo2nix/nixpkgs";
tree-sitter-pie = {
url = "path:./tree-sitter-pie";
inputs = {
nixpkgs.follows = "nixpkgs";
cargo2nix.follows = "cargo2nix";
utils.follows = "utils";
};
};
};
outputs = { self, nixpkgs, utils, cargo2nix, tree-sitter-pie }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [cargo2nix.overlays.default];
};
rustPkgs = pkgs.rustBuilder.makePackageSet {
rustVersion = "1.71.0";
packageFun = import ./Cargo.nix;
# Generated Cargo.nix says
# "unknown".tree-sitter-pie."0.0.1" = overridableMkRustCrate (profileName: rec {
# src = fetchCrateLocal workspaceSrc;
# which is whole project directory
packageOverrides = pkgs: pkgs.rustBuilder.overrides.all ++ [
(pkgs.rustBuilder.rustLib.makeOverride {
name = "tree-sitter-pie";
overrideAttrs = drv: {
src = ./tree-sitter-pie;
};
})
];
};
in rec {
packages = {
pie = (rustPkgs.workspace.pie {});
default = packages.pie;
};
devShells = {
default = rustPkgs.workspaceShell {
packages = [
pkgs.rust-analyzer
pkgs.rustfmt
pkgs.tree-sitter
pkgs.gnuplot
pkgs.nodejs_18
pkgs.nodePackages.typescript-language-server
];
};
tree-sitter = tree-sitter-pie.devShells.${system}.default;
};
}
);
}