-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathflake.nix
51 lines (41 loc) · 1.29 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
{
description = "Rust CLI and API bindings for yeelight WiFi Light Inter-Operation";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-parts.url = "github:hercules-ci/flake-parts";
pre-commit-hooks.url = "github:hercules-ci/pre-commit-hooks.nix/flakeModule";
pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-parts, pre-commit-hooks, ... }@inputs:
flake-parts.lib.mkFlake { inherit inputs; } {
imports = [
pre-commit-hooks.flakeModule
];
systems = nixpkgs.lib.systems.flakeExposed;
perSystem = { config, self', inputs', pkgs, system, ... }: {
pre-commit.settings.hooks = {
nixpkgs-fmt.enable = true;
rustfmt.enable = true;
clippy.enable = true;
};
devShells.default = pkgs.mkShell {
name = "cargo";
buildInputs = with pkgs; [
cargo
cargo-edit
cargo-release
cargo-outdated
clippy
rust-analyzer
rustc
rustfmt
lldb
];
shellHook = ''
${config.pre-commit.installationScript}
'';
};
packages.default = pkgs.callPackage ./default.nix { };
};
};
}