Tweak flake outputs and README

This commit is contained in:
oxalica
2021-01-02 20:49:12 +08:00
parent 4c09255aeb
commit 40e2748d32
2 changed files with 114 additions and 47 deletions

View File

@@ -1,7 +1,7 @@
{
description = ''
Pure and reproducible overlay for binary distributed rust toolchains.
A better replacement for github:mozilla/nixpkgs-mozilla
A compatible but better replacement for rust overlay of github:mozilla/nixpkgs-mozilla.
'';
inputs = {
@@ -10,7 +10,8 @@
outputs = { self, nixpkgs, flake-utils, ... }@inputs: let
inherit (nixpkgs) lib;
overlay = import ./default.nix;
overlay = import ./.;
allSystems = [
"aarch64-linux"
@@ -23,20 +24,32 @@
];
in {
overlay = final: prev: overlay final prev;
} // flake-utils.lib.eachSystem allSystems (system: let
pkgs = import nixpkgs { inherit system; overlays = [ overlay ]; };
in rec {
# `defaultApp`, `defaultPackage` and `packages` are for human only.
# They are subject to change and **DO NOT** depend on them in your flake.
# Please use `overlay` instead.
defaultApp = {
type = "app";
program = "${defaultPackage}/bin/rustc";
};
defaultPackage = packages.rust-stable;
packages = {
rust-stable = pkgs.latest.rustChannels.stable.rust;
rust-nightly = pkgs.latest.rustChannels.nightly.rust;
};
defaultPackage = packages.rust;
# FIXME: We can only directly provide derivations here without nested set.
# Currently we only provide stable releases. Some nightly versions have components missing
# on some platforms, which makes `nix flake check` to be failed.
packages =
lib.mapAttrs' (version: comps: {
name = "rust-${lib.replaceStrings ["."] ["-"] version}";
value = comps.rust;
}) pkgs.rust-bin.stable // {
rust = packages.rust-latest;
};
checks = {
kind2 = (pkgs.rustChannelOf { channel = "1.48.0"; }).rust;