-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
77 lines (70 loc) · 1.86 KB
/
flake.nix
File metadata and controls
77 lines (70 loc) · 1.86 KB
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
65
66
67
68
69
70
71
72
73
74
75
76
77
{
description = "MDValidate";
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
treefmt.url = "github:numtide/treefmt-nix";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{
self,
nixpkgs,
flake-utils,
treefmt,
fenix,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
toolchain = fenix.packages.${system}.toolchainOf {
channel = "1.90";
sha256 = "sha256-SJwZ8g0zF2WrKDVmHrVG3pD2RGoQeo24MEXnNx5FyuI=";
};
treefmtEval = treefmt.lib.evalModule pkgs {
projectRootFile = "flake.nix";
programs.nixfmt.enable = true;
programs.yamlfmt.enable = true;
programs.typstyle.enable = true;
programs.black.enable = true;
programs.toml-sort.enable = true;
};
in
{
packages = rec {
default = mdv;
mdv = pkgs.callPackage ./nix/build.nix { static = true; };
};
devShells.default = pkgs.mkShell {
packages =
(with pkgs; [
nil
nixd
nixfmt
typst
mermaid-cli
fira-mono
cargo-release
stdenv.cc.cc.lib
bun
just
])
++ [
toolchain.defaultToolchain
];
shellHook = ''
export PATH=$PATH:target/debug
export LD_LIBRARY_PATH=${pkgs.stdenv.cc.cc.lib}/lib:$LD_LIBRARY_PATH
'';
};
formatter = treefmtEval.config.build.wrapper;
checks = {
formatting = treefmtEval.config.build.check self;
};
}
);
}