mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-16 09:11:55 +00:00
Merge pull request #71 from pingiun/remove-rust-overlay
Remove rust nightly nix overlay
This commit is contained in:
commit
f9298582a7
4 changed files with 5 additions and 22997 deletions
1
.gitattributes
vendored
1
.gitattributes
vendored
|
@ -1,2 +1 @@
|
||||||
flake.lock linguist-generated=true
|
flake.lock linguist-generated=true
|
||||||
toolchain-manifest.toml linguist-generated=true
|
|
||||||
|
|
18
flake.lock
generated
18
flake.lock
generated
|
@ -14,25 +14,9 @@
|
||||||
"type": "indirect"
|
"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": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"nixpkgs": "nixpkgs",
|
"nixpkgs": "nixpkgs"
|
||||||
"nixpkgs-mozilla": "nixpkgs-mozilla"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
52
flake.nix
52
flake.nix
|
@ -1,9 +1,7 @@
|
||||||
{
|
{
|
||||||
description = "jujutsu";
|
description = "jujutsu";
|
||||||
|
|
||||||
inputs.nixpkgs-mozilla.url = "github:mozilla/nixpkgs-mozilla";
|
outputs = { self, nixpkgs, ... }:
|
||||||
|
|
||||||
outputs = { self, nixpkgs, nixpkgs-mozilla, ... }:
|
|
||||||
let
|
let
|
||||||
lib = nixpkgs.lib;
|
lib = nixpkgs.lib;
|
||||||
systems = [
|
systems = [
|
||||||
|
@ -14,7 +12,6 @@
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
];
|
];
|
||||||
foreachSystem = f: lib.foldl' (attrs: system: lib.recursiveUpdate attrs (f system)) { } systems;
|
foreachSystem = f: lib.foldl' (attrs: system: lib.recursiveUpdate attrs (f system)) { } systems;
|
||||||
version = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package.version;
|
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
overlay = (final: prev: {
|
overlay = (final: prev: {
|
||||||
|
@ -34,19 +31,18 @@
|
||||||
, Security
|
, Security
|
||||||
, SystemConfiguration
|
, SystemConfiguration
|
||||||
, libiconv
|
, libiconv
|
||||||
, rust
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
rustPlatform.buildRustPackage rec {
|
rustPlatform.buildRustPackage rec {
|
||||||
pname = "jujutsu";
|
pname = "jujutsu";
|
||||||
inherit version;
|
version = "unstable-${self.shortRev or "dirty"}";
|
||||||
|
|
||||||
src = self;
|
src = self;
|
||||||
|
|
||||||
cargoLock = {
|
cargoLock = {
|
||||||
lockFile = "${self}/Cargo.lock";
|
lockFile = "${self}/Cargo.lock";
|
||||||
};
|
};
|
||||||
nativeBuildInputs = [ rust pkgconfig gzip makeWrapper ];
|
nativeBuildInputs = [ pkgconfig gzip makeWrapper ];
|
||||||
buildInputs = [ openssl dbus sqlite ]
|
buildInputs = [ openssl dbus sqlite ]
|
||||||
++ lib.optionals stdenv.isDarwin [
|
++ lib.optionals stdenv.isDarwin [
|
||||||
Security
|
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;
|
inherit (final.darwin.apple_sdk.frameworks) Security SystemConfiguration;
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
@ -66,49 +61,10 @@
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
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
|
in
|
||||||
{
|
{
|
||||||
devShell.${system} = pkgs.mkShell {
|
|
||||||
inputsFrom = [ pkgs.jujutsu ];
|
|
||||||
packages = [ updateToolchainManifest ];
|
|
||||||
};
|
|
||||||
packages.${system}.jujutsu = pkgs.jujutsu;
|
packages.${system}.jujutsu = pkgs.jujutsu;
|
||||||
defaultPackage.${system} = self.packages.${system}.jujutsu;
|
defaultPackage.${system} = self.packages.${system}.jujutsu;
|
||||||
defaultApp.${system} = {
|
defaultApp.${system} = {
|
||||||
|
|
22931
toolchain-manifest.toml
22931
toolchain-manifest.toml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue