nix: use fenix instead of rust-overlay

This commit is contained in:
Youwen Wu 2024-09-12 01:26:38 -07:00
parent 435d7a0407
commit 63a6c65901
Signed by: youwen5
GPG key ID: 865658ED1FE61EC3
2 changed files with 42 additions and 39 deletions

View file

@ -1,5 +1,26 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1726116637,
"narHash": "sha256-tU2GhwU887mPg6C4c2k+CEBAnKY6R0tSeQYtoqjZmLM=",
"owner": "nix-community",
"repo": "fenix",
"rev": "96a04a213838c5001619ad57400c5a176fa040b1",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@ -64,45 +85,28 @@
"type": "github"
}
},
"nixpkgs_3": {
"locked": {
"lastModified": 1718428119,
"narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"fenix": "fenix",
"flake-utils": "flake-utils",
"naersk": "naersk",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay"
"nixpkgs": "nixpkgs_2"
}
},
"rust-overlay": {
"inputs": {
"nixpkgs": "nixpkgs_3"
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1726021481,
"narHash": "sha256-4J4E+Fh+77XIYnq2RVtg+ENWXpu6t74P0jKN/f2RQmI=",
"owner": "oxalica",
"repo": "rust-overlay",
"rev": "1c2c120246c51a644c20ba2a36a33d3bd4860d70",
"lastModified": 1725985110,
"narHash": "sha256-0HKj+JI6rtxaE6Kzcd6HyFNbEFJRsLy5DoNgVF1pyRM=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "bcc708992104c2059f310fbc3ac00bfc377f9ea8",
"type": "github"
},
"original": {
"owner": "oxalica",
"repo": "rust-overlay",
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},

View file

@ -4,7 +4,10 @@
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rust-overlay.url = "github:oxalica/rust-overlay";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
naersk.url = "github:nix-community/naersk";
};
@ -12,20 +15,18 @@
{
nixpkgs,
flake-utils,
rust-overlay,
fenix,
naersk,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs { inherit system overlays; };
pkgs = import nixpkgs { inherit system; };
naersk' = pkgs.callPackage naersk { };
defaultBuildOpts = {
cargo = pkgs.rust-bin.stable.latest.default;
rustc = pkgs.rust-bin.stable.latest.default;
cargo = fenix.packages.${system}.stable.cargo;
rustc = fenix.packages.${system}.stable.rustc;
src = ./.;
nativeBuildInputs = with pkgs; [ pkg-config ];
@ -38,10 +39,8 @@
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
pkg-config
rust-bin.stable.latest.rust-analyzer
rust-bin.stable.latest.default
openssl
rust-bin.stable.latest.rustfmt
fenix.packages.${system}.stable.completeToolchain
];
};
packages = {