diff --git a/flake.lock b/flake.lock index e9d73de..13215dc 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,26 @@ { "nodes": { + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": "rust-analyzer-src" + }, + "locked": { + "lastModified": 1636266227, + "narHash": "sha256-jpzbQyCOPsF0LH9YLURtB7IPByBu7O68eH3gM6wtNnk=", + "owner": "nix-community", + "repo": "fenix", + "rev": "bac0e0578a1968fd7640c2f884e9c14c22856fd1", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, "flake-utils": { "locked": { "lastModified": 1634851050, @@ -52,10 +73,28 @@ }, "root": { "inputs": { + "fenix": "fenix", "flake-utils": "flake-utils", "naersk": "naersk", "nixpkgs": "nixpkgs" } + }, + "rust-analyzer-src": { + "flake": false, + "locked": { + "lastModified": 1636213292, + "narHash": "sha256-o3BRalwpM+Rpb35zwE7G+SGv0FB4Bqdv20RAAOTKAzA=", + "owner": "rust-analyzer", + "repo": "rust-analyzer", + "rev": "2c29bd738be862efe9e6c07a0b6ef95cbe37de15", + "type": "github" + }, + "original": { + "owner": "rust-analyzer", + "ref": "nightly", + "repo": "rust-analyzer", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index bc27d5e..8e2d570 100644 --- a/flake.nix +++ b/flake.nix @@ -3,19 +3,27 @@ inputs = { nixpkgs.url = "nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + }; naersk = { url = "github:nmattia/naersk"; inputs.nixpkgs.follows = "nixpkgs"; }; }; - outputs = { self, nixpkgs, flake-utils, naersk }: + outputs = { self, nixpkgs, flake-utils, fenix, naersk }: flake-utils.lib.eachDefaultSystem ( system: let pkgs = import nixpkgs { inherit system; }; - naersk-lib = naersk.lib."${system}"; + rustToolchain = fenix.packages."${system}".stable.defaultToolchain; + naersk-lib = naersk.lib.${system}.override { + cargo = rustToolchain; + rustc = rustToolchain; + }; in rec { packages.azirevpn = naersk-lib.buildPackage { @@ -30,11 +38,8 @@ devShell = pkgs.mkShell { name = "azirevpn-env"; buildInputs = [ - pkgs.cargo - pkgs.clippy + rustToolchain pkgs.rust-analyzer - pkgs.rustc - pkgs.rustfmt ]; }; }