Use fenix

This commit is contained in:
Andrey Golovizin 2021-11-07 12:45:14 +01:00
parent 12082258f5
commit 068d9bdfeb
2 changed files with 50 additions and 6 deletions

39
flake.lock generated
View file

@ -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",

View file

@ -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
];
};
}