-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
69 lines (64 loc) · 1.82 KB
/
Copy pathflake.nix
File metadata and controls
69 lines (64 loc) · 1.82 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
{
description = "Shunting yard in rust";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
naersk.url = "github:nix-community/naersk/master";
treefmt-nix.url = "github:numtide/treefmt-nix";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
self,
nixpkgs,
naersk,
flake-utils,
treefmt-nix,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import nixpkgs { inherit system; };
project = "Shunting yard.rs";
naersk-lib = pkgs.callPackage naersk { };
in
{
defaultPackage = naersk-lib.buildPackage ./.;
devShells.default = pkgs.mkShell {
name = project;
LSP_SERVER = "rust_analyzer";
packages = with pkgs; [
lldb
rustc
cargo
rustfmt
rustPackages.clippy
rust-analyzer
(writeShellScriptBin "clippy" ''
cargo clippy -- -W clippy::all -W clippy::pedantic
'')
(writeShellScriptBin "clippy-mad" ''
cargo clippy -- -W clippy::all -W clippy::pedantic -W clippy::nursery -W clippy::restriction
'')
(writeShellScriptBin "clippy-fix" ''
cargo clippy --fix -- -W clippy::all -W clippy::pedantic
'')
manim
(pkgs.python3.withPackages (python-pkgs: [
python-pkgs.manim
]))
];
shellHook = ''
echo -e '(¬_¬") Entered ${project} :D'
'';
};
formatter = treefmt-nix.lib.mkWrapper pkgs {
projectRootFile = "flake.nix";
programs = {
nixfmt.enable = true;
rustfmt.enable = true;
black.enable = true;
};
};
}
);
}