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": {
"mozillapkgs": {
"flake": false,
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1634833229,
"narHash": "sha256-uDbVCkW91/AY87mTwm8XrX2E133LTFqwYsYNNxBcY9M=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "6070a8ee799f629cb1d0004821f77ceed94d3992",
"lastModified": 1639635878,
"narHash": "sha256-5jlR5qTo1hOI8Xsc6yAizflH+Pe7YbBk+GnfccgZu9o=",
"owner": "nix-community",
"repo": "fenix",
"rev": "5766a5d883b884cab3a1215eee197356f41ef9ce",
"type": "github"
},
"original": {
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
@ -52,12 +57,29 @@
},
"root": {
"inputs": {
"mozillapkgs": "mozillapkgs",
"fenix": "fenix",
"naersk": "naersk",
"nixpkgs": "nixpkgs",
"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": {
"locked": {
"lastModified": 1634851050,

View File

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