diff --git a/flake.lock b/flake.lock index 4de942a1582..1b8ac53f317 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1717827974, + "narHash": "sha256-ixopuTeTouxqTxfMuzs6IaRttbT8JqRW5C9Q/57WxQw=", + "owner": "nix-community", + "repo": "fenix", + "rev": "ab655c627777ab5f9964652fe23bbb1dfbd687a8", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-compat": { "flake": false, "locked": { @@ -52,11 +73,29 @@ }, "root": { "inputs": { + "fenix": "fenix", "flake-compat": "flake-compat", "flake-utils": "flake-utils", "nixpkgs": "nixpkgs" } }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1717583671, + "narHash": "sha256-+lRAmz92CNUxorqWusgJbL9VE1eKCnQQojglRemzwkw=", + "owner": "rust-lang", + "repo": "rust-analyzer", + "rev": "48bbdd6a74f3176987d5c809894ac33957000d19", + "type": "github" + }, + "original": { + "owner": "rust-lang", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } + }, "systems": { "locked": { "lastModified": 1681028828, diff --git a/flake.nix b/flake.nix index 678337540cc..8384a2c2625 100644 --- a/flake.nix +++ b/flake.nix @@ -6,11 +6,16 @@ url = "github:edolstra/flake-compat"; flake = false; }; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; }; outputs = { self, nixpkgs, flake-utils, + fenix, ... }: flake-utils.lib.eachDefaultSystem (system: let @@ -18,6 +23,18 @@ in { packages.atuin = pkgs.callPackage ./atuin.nix { inherit (pkgs.darwin.apple_sdk.frameworks) Security SystemConfiguration AppKit; + rustPlatform = let + toolchain = + fenix.packages.${system}.fromToolchainFile + { + file = ./rust-toolchain.toml; + sha256 = "sha256-7QfkHty6hSrgNM0fspycYkRcB82eEqYa4CoAJ9qA3tU="; + }; + in + pkgs.makeRustPlatform { + cargo = toolchain; + rustc = toolchain; + }; }; packages.default = self.outputs.packages.${system}.atuin;