flake.nix: switch from mozillapkgs to fenix

This commit is contained in:
Astro 2021-12-17 01:05:51 +01:00
parent 41a57cd5f1
commit 5eef211c59
2 changed files with 48 additions and 21 deletions

View File

@ -1,18 +1,23 @@
{ {
"nodes": { "nodes": {
"mozillapkgs": { "fenix": {
"flake": false, "inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": { "locked": {
"lastModified": 1634833229, "lastModified": 1639635878,
"narHash": "sha256-uDbVCkW91/AY87mTwm8XrX2E133LTFqwYsYNNxBcY9M=", "narHash": "sha256-5jlR5qTo1hOI8Xsc6yAizflH+Pe7YbBk+GnfccgZu9o=",
"owner": "mozilla", "owner": "nix-community",
"repo": "nixpkgs-mozilla", "repo": "fenix",
"rev": "6070a8ee799f629cb1d0004821f77ceed94d3992", "rev": "5766a5d883b884cab3a1215eee197356f41ef9ce",
"type": "github" "type": "github"
}, },
"original": { "original": {
"owner": "mozilla", "owner": "nix-community",
"repo": "nixpkgs-mozilla", "repo": "fenix",
"type": "github" "type": "github"
} }
}, },
@ -52,12 +57,29 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"mozillapkgs": "mozillapkgs", "fenix": "fenix",
"naersk": "naersk", "naersk": "naersk",
"nixpkgs": "nixpkgs", "nixpkgs": "nixpkgs",
"utils": "utils" "utils": "utils"
} }
}, },
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1639175515,
"narHash": "sha256-Yj38u9BpKfyGrcSEaoSEnOns885xn/Ask6lR5rsxS8k=",
"owner": "rust-analyzer",
"repo": "rust-analyzer",
"rev": "d03397fe1173eaeb2e04c9e55ac223289e7e08ee",
"type": "github"
},
"original": {
"owner": "rust-analyzer",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
},
"utils": { "utils": {
"locked": { "locked": {
"lastModified": 1634851050, "lastModified": 1634851050,

View File

@ -2,19 +2,21 @@
inputs = { inputs = {
utils.url = "github:numtide/flake-utils"; utils.url = "github:numtide/flake-utils";
naersk.url = "github:nmattia/naersk"; naersk.url = "github:nmattia/naersk";
mozillapkgs.url = "github:mozilla/nixpkgs-mozilla"; naersk.inputs.nixpkgs.follows = "nixpkgs";
mozillapkgs.flake = false; fenix.url = "github:nix-community/fenix";
fenix.inputs.nixpkgs.follows = "nixpkgs";
}; };
outputs = { self, nixpkgs, utils, naersk, mozillapkgs }: outputs = { self, nixpkgs, utils, fenix, naersk }:
utils.lib.eachDefaultSystem (system: let utils.lib.eachDefaultSystem (system: let
pkgs = nixpkgs.legacyPackages."${system}"; pkgs = nixpkgs.legacyPackages."${system}";
mozilla = pkgs.callPackage (mozillapkgs + "/package-set.nix") {};
rust = (mozilla.rustChannelOf { rust = fenix.packages.${system}.complete.withComponents [
channel = "stable"; "cargo"
date = "2021-10-04"; "rustc"
sha256 = "0swglfa63i14fpgg98agx4b5sz0nckn6phacfy3k6imknsiv8mrg"; "rust-src" # just for rust-analyzer
}).rust; "clippy"
];
# Override the version used in naersk # Override the version used in naersk
naersk-lib = naersk.lib."${system}".override { naersk-lib = naersk.lib."${system}".override {
@ -52,8 +54,11 @@
# `nix develop` # `nix develop`
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
nativeBuildInputs = with defaultPackage; nativeBuildInputs = [
nativeBuildInputs ++ buildInputs; fenix.packages.${system}.rust-analyzer
] ++ (with defaultPackage;
nativeBuildInputs ++ buildInputs
);
}; };
}) // { }) // {
overlay = final: prev: { overlay = final: prev: {