Remove rust nightly overlay

This commit is contained in:
Jelle Besseling 2022-02-21 18:14:48 +01:00
parent 5e7f69c4e8
commit 54a6adf47a
No known key found for this signature in database
GPG key ID: 9712452E8BE3372E
4 changed files with 5 additions and 22997 deletions

1
.gitattributes vendored
View file

@ -1,2 +1 @@
flake.lock linguist-generated=true
toolchain-manifest.toml linguist-generated=true

18
flake.lock generated
View file

@ -14,25 +14,9 @@
"type": "indirect"
}
},
"nixpkgs-mozilla": {
"locked": {
"lastModified": 1643634764,
"narHash": "sha256-EcFlgzZnZSHwZixELYV1pa267t+u5mCeLhSNBeAA/+c=",
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"rev": "f233fdc4ff6ba2ffeb1e3e3cd6d63bb1297d6996",
"type": "github"
},
"original": {
"owner": "mozilla",
"repo": "nixpkgs-mozilla",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs",
"nixpkgs-mozilla": "nixpkgs-mozilla"
"nixpkgs": "nixpkgs"
}
}
},

View file

@ -1,9 +1,7 @@
{
description = "jujutsu";
inputs.nixpkgs-mozilla.url = "github:mozilla/nixpkgs-mozilla";
outputs = { self, nixpkgs, nixpkgs-mozilla, ... }:
outputs = { self, nixpkgs, ... }:
let
lib = nixpkgs.lib;
systems = [
@ -14,7 +12,6 @@
"x86_64-linux"
];
foreachSystem = f: lib.foldl' (attrs: system: lib.recursiveUpdate attrs (f system)) { } systems;
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
in
{
overlay = (final: prev: {
@ -34,19 +31,18 @@
, Security
, SystemConfiguration
, libiconv
, rust
}:
rustPlatform.buildRustPackage rec {
pname = "jujutsu";
inherit version;
version = "unstable-${self.shortRev or "dirty"}";
src = self;
cargoLock = {
lockFile = "${self}/Cargo.lock";
};
nativeBuildInputs = [ rust pkgconfig gzip makeWrapper ];
nativeBuildInputs = [ pkgconfig gzip makeWrapper ];
buildInputs = [ openssl dbus sqlite ]
++ lib.optionals stdenv.isDarwin [
Security
@ -57,7 +53,6 @@
)
{
rust = (final.lib.rustLib.fromManifestFile ./toolchain-manifest.toml { inherit (final) stdenv lib fetchurl patchelf; }).rust;
inherit (final.darwin.apple_sdk.frameworks) Security SystemConfiguration;
};
});
@ -66,49 +61,10 @@
let
pkgs = import nixpkgs {
inherit system;
overlays = [ nixpkgs-mozilla.overlays.rust self.overlay ];
overlays = [ self.overlay ];
};
# Script to update the toolchain-manifest.toml file which is used in the nix build.
#
# nixpkgs doesn't package rust nightly, so the Mozilla nixpkgs Rust overlay is used,
# which can download the rust toolchain if given a manifest file (a sha256 hash can also be used
# in which case the overlay downloads the manifest file with fetchurl).
# The nice thing about this manifest file is that the nix builds are fully hermetic.
# The downside is that now both nixpkgs needs to be updated (with nix flake update)
# and the toolchain manifest.
#
# To update the toolchain to the latest nightly, run
# $ nix develop
# $ updateToolchainManifest
# The script also accepts arguments for a different rust channel (first argument)
# or a specific nightly date (e.g. updateToolchainManifest nightly 2022-02-19)
updateToolchainManifest = pkgs.writeScriptBin "updateToolchainManifest" ''
#! /usr/bin/env bash
set -ex
if [[ -z $1 ]]; then
channel='"nightly"'
else
channel="\"$1\""
fi
if [[ -z $2 ]]; then
date='null'
else
date="\"$2\""
fi
url=$(nix eval --raw --impure --expr "let flake = (builtins.getFlake (builtins.toString ./.)); in (import flake.inputs.nixpkgs { overlays = [ flake.inputs.nixpkgs-mozilla.overlays.rust ]; }).lib.rustLib.manifest_v2_url { channel = $channel; date = $date; }")
curl $url > ./toolchain-manifest.toml
'';
in
{
devShell.${system} = pkgs.mkShell {
inputsFrom = [ pkgs.jujutsu ];
packages = [ updateToolchainManifest ];
};
packages.${system}.jujutsu = pkgs.jujutsu;
defaultPackage.${system} = self.packages.${system}.jujutsu;
defaultApp.${system} = {

File diff suppressed because it is too large Load diff