From cace6f44687dab499a886c901166f412c0d68e5f Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Fri, 5 Apr 2024 00:19:18 +0200 Subject: [PATCH] setup rust toolchain --- flake.lock | 65 +++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 32 ++++++++++++++++++++++ rust-toolchain.toml | 3 +++ 3 files changed, 100 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 rust-toolchain.toml diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..7112d9a --- /dev/null +++ b/flake.lock @@ -0,0 +1,65 @@ +{ + "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1712211755, + "narHash": "sha256-KIJA4OvXFDXEeu7wstFDCxqZEfjaPQIowpzNww48TUw=", + "owner": "nix-community", + "repo": "fenix", + "rev": "39763c6e23a8423af316b85a74bad0cc5bc88d86", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1712163089, + "narHash": "sha256-Um+8kTIrC19vD4/lUCN9/cU9kcOsD1O1m+axJqQPyMM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fd281bd6b7d3e32ddfa399853946f782553163b5", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-unstable", + "type": "indirect" + } + }, + "root": { + "inputs": { + "fenix": "fenix", + "nixpkgs": "nixpkgs" + } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1712156296, + "narHash": "sha256-St7ZQrkrr5lmQX9wC1ZJAFxL8W7alswnyZk9d1se3Us=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "8e581ac348e223488622f4d3003cb2bd412bf27e", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..b458c0f --- /dev/null +++ b/flake.nix @@ -0,0 +1,32 @@ +{ + description = "Doggo flake"; + + inputs = { + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixpkgs.url = "nixpkgs/nixos-unstable"; + }; + + outputs = { self, fenix, nixpkgs }: + let + pkgs = nixpkgs.legacyPackages.x86_64-linux; + in { + devShell.x86_64-linux = with pkgs; + mkShell { + nativeBuildInputs = [ + just + (fenix.packages.x86_64-linux.fromToolchainFile { + dir = ./.; + sha256 = "sha256-3St/9/UKo/6lz2Kfq2VmlzHyufduALpiIKaaKX4Pq0g="; + }) + ]; + + buildInputs = [ + ]; + }; + + formatter.x86_64-linux = nixpkgs.legacyPackages.x86_64-linux.nixfmt; + }; +} diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..02cb8fc --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "stable" +profile = "default"