Skip to content

Commit c5e45ed

Browse files
Dluraknik-rev
authored andcommitted
Improve the flake
1 parent cdbb11e commit c5e45ed

File tree

2 files changed

+21
-13
lines changed

2 files changed

+21
-13
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

flake.nix

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@
33
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
44
};
55

6-
outputs =
7-
{
8-
nixpkgs,
9-
flake-utils,
10-
...
11-
}:
6+
outputs = {
7+
nixpkgs,
8+
flake-utils,
9+
...
10+
}:
1211
flake-utils.lib.eachDefaultSystem (
13-
system:
14-
let
12+
system: let
1513
pkgs = import nixpkgs {
1614
inherit system;
1715
};
1816
manifest = pkgs.lib.importTOML ./Cargo.toml;
1917
buildInputs = with pkgs; [
20-
# required for the flake
21-
pkgs.makeWrapper
18+
# required for the derivation
19+
makeWrapper
2220

2321
# makes it more performant
2422
libGL
@@ -30,10 +28,18 @@
3028
xorg.libX11
3129
libxkbcommon
3230
];
33-
in
34-
{
31+
in {
3532
devShells.default = pkgs.mkShell {
36-
inherit buildInputs;
33+
buildInputs =
34+
buildInputs
35+
++ (with pkgs; [
36+
cargo
37+
rustc
38+
rustfmt
39+
rustPackages.clippy
40+
rust-analyzer
41+
bacon
42+
]);
3743
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
3844
};
3945
packages.default = pkgs.rustPlatform.buildRustPackage {
@@ -50,6 +56,7 @@
5056
--suffix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath buildInputs}
5157
'';
5258
};
59+
formatter = pkgs.alejandra;
5360
}
5461
);
5562
}

0 commit comments

Comments
 (0)