From d38a58c19bbbae3ce3ea5ca137b807619a2b17f5 Mon Sep 17 00:00:00 2001 From: velllu <91963404+velllu@users.noreply.github.com> Date: Fri, 22 Dec 2023 23:52:11 +0100 Subject: [PATCH] Added `toolchain.toml` file --- .envrc | 2 +- flake.lock | 79 +++++++++++++++++++++++++------------------------- flake.nix | 48 ++++++++++++++---------------- toolchain.toml | 3 ++ 4 files changed, 65 insertions(+), 67 deletions(-) create mode 100644 toolchain.toml diff --git a/.envrc b/.envrc index 07fd338..a5dbbcb 100644 --- a/.envrc +++ b/.envrc @@ -1 +1 @@ -use flake . \ No newline at end of file +use flake . diff --git a/flake.lock b/flake.lock index e36b879..ea9a329 100644 --- a/flake.lock +++ b/flake.lock @@ -1,45 +1,46 @@ { "nodes": { - "naersk": { + "flake-utils": { "inputs": { - "nixpkgs": "nixpkgs" + "systems": "systems" }, "locked": { - "lastModified": 1698420672, - "narHash": "sha256-/TdeHMPRjjdJub7p7+w55vyABrsJlt5QkznPYy55vKA=", - "owner": "nix-community", - "repo": "naersk", - "rev": "aeb58d5e8faead8980a807c840232697982d47b9", + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", "type": "github" }, "original": { - "owner": "nix-community", - "ref": "master", - "repo": "naersk", + "owner": "numtide", + "repo": "flake-utils", "type": "github" } }, "nixpkgs": { "locked": { - "lastModified": 1701174899, - "narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=", + "lastModified": 1703068421, + "narHash": "sha256-WSw5Faqlw75McIflnl5v7qVD/B3S2sLh+968bpOGrWA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e", + "rev": "d65bceaee0fb1e64363f7871bc43dc1c6ecad99f", "type": "github" }, "original": { - "id": "nixpkgs", - "type": "indirect" + "owner": "NixOS", + "ref": "nixos-23.11", + "repo": "nixpkgs", + "type": "github" } }, "nixpkgs_2": { "locked": { - "lastModified": 1701174899, - "narHash": "sha256-1W+FMe8mWsJKXoBc+QgKmEeRj33kTFnPq7XCjU+bfnA=", + "lastModified": 1681358109, + "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "010c7296f3b19a58b206fdf7d68d75a5b0a09e9e", + "rev": "96ba1c52e54e74c3197f4d43026b3f3d92e83ff9", "type": "github" }, "original": { @@ -51,9 +52,27 @@ }, "root": { "inputs": { - "naersk": "naersk", - "nixpkgs": "nixpkgs_2", - "utils": "utils" + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1703211258, + "narHash": "sha256-ye9HcJ9WH/QCq6R4GC3FvLnIDpa2Kje4nXya9j/mhA4=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "b8c487832712f4e3e6f9e81b70e6654eb907abfc", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" } }, "systems": { @@ -70,24 +89,6 @@ "repo": "default", "type": "github" } - }, - "utils": { - "inputs": { - "systems": "systems" - }, - "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 3317772..7c336bb 100644 --- a/flake.nix +++ b/flake.nix @@ -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; - }; - }); -} \ No newline at end of file + 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 + ]; + }; + }; +} diff --git a/toolchain.toml b/toolchain.toml new file mode 100644 index 0000000..08f05f9 --- /dev/null +++ b/toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "stable" +profile = "complete"