Skip to content

Commit

Permalink
Added toolchain.toml file
Browse files Browse the repository at this point in the history
  • Loading branch information
velllu committed Dec 22, 2023
1 parent a3fd506 commit d38a58c
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .envrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
use flake .
use flake .
79 changes: 40 additions & 39 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 21 additions & 27 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
{
inputs = {
naersk.url = "github:nix-community/naersk/master";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
rust-overlay.url = "github:oxalica/rust-overlay";
};

outputs = { self, nixpkgs, utils, naersk }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
naersk-lib = pkgs.callPackage naersk { };
in
{
defaultPackage = naersk-lib.buildPackage ./.;
devShell = with pkgs; mkShell {
buildInputs = [
cargo rustc rustfmt pre-commit rust-analyzer rustPackages.clippy
libxkbcommon libGL wayland xorg.libXcursor xorg.libXrandr xorg.libXi xorg.libX11
];

LD_LIBRARY_PATH = builtins.concatStringsSep ":" [
"${pkgs.xorg.libX11}/lib"
"${pkgs.xorg.libXi}/lib"
"${pkgs.libGL}/lib"
];

RUST_SRC_PATH = rustPlatform.rustLibSrc;
};
});
}
outputs = {
self,
nixpkgs,
rust-overlay,
}: let
system = "x86_64-linux";
pkgs = import nixpkgs {
inherit system;
overlays = [rust-overlay.overlays.default];
};
toolchain = pkgs.rust-bin.fromRustupToolchainFile ./toolchain.toml;
in {
devShells.${system}.default = pkgs.mkShell {
packages = [
toolchain
];
};
};
}
3 changes: 3 additions & 0 deletions toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "stable"
profile = "complete"

0 comments on commit d38a58c

Please sign in to comment.