From 3a168523d851a046deccba0f1a8bc84c39a95aec Mon Sep 17 00:00:00 2001 From: "Gregory C. Oakes" Date: Wed, 24 Mar 2021 23:32:36 -0500 Subject: [PATCH] Update cross-windows to use nixpkgs-mozilla. --- .gitignore | 1 + examples/cross-windows/flake.lock | 80 ++++++++----------------------- examples/cross-windows/flake.nix | 35 ++++++++------ 3 files changed, 40 insertions(+), 76 deletions(-) diff --git a/.gitignore b/.gitignore index 2df6f16..c361de5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ docparse/target /flake.lock +result diff --git a/examples/cross-windows/flake.lock b/examples/cross-windows/flake.lock index 1963f7e..d5dc27e 100644 --- a/examples/cross-windows/flake.lock +++ b/examples/cross-windows/flake.lock @@ -1,27 +1,5 @@ { "nodes": { - "fenix": { - "inputs": { - "naersk": "naersk", - "nixpkgs": [ - "nixpkgs" - ], - "rust-analyzer-src": "rust-analyzer-src" - }, - "locked": { - "lastModified": 1616639144, - "narHash": "sha256-GE1UnbW/ffFCqdrM1ylLLTkRaSATlqUElQgrp59SWrA=", - "owner": "nix-community", - "repo": "fenix", - "rev": "4bc3c7108393d418d16ae7d1598ee6031107774e", - "type": "github" - }, - "original": { - "owner": "nix-community", - "repo": "fenix", - "type": "github" - } - }, "flake-utils": { "locked": { "lastModified": 1614513358, @@ -57,26 +35,6 @@ "type": "github" } }, - "naersk_2": { - "inputs": { - "nixpkgs": [ - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1614785451, - "narHash": "sha256-TPw8kQvr2UNCuvndtY+EjyXp6Q5GEW2l9UafXXh1XmI=", - "owner": "nmattia", - "repo": "naersk", - "rev": "e0fe990b478a66178a58c69cf53daec0478ca6f9", - "type": "github" - }, - "original": { - "owner": "nmattia", - "repo": "naersk", - "type": "github" - } - }, "nixpkgs": { "locked": { "lastModified": 1616259034, @@ -87,35 +45,35 @@ "type": "github" }, "original": { - "id": "nixpkgs", + "owner": "NixOS", "ref": "nixpkgs-unstable", - "type": "indirect" - } - }, - "root": { - "inputs": { - "fenix": "fenix", - "flake-utils": "flake-utils", - "naersk": "naersk_2", - "nixpkgs": "nixpkgs" + "repo": "nixpkgs", + "type": "github" } }, - "rust-analyzer-src": { + "nixpkgs-mozilla": { "flake": false, "locked": { - "lastModified": 1616625468, - "narHash": "sha256-98nBGTHLLEc0DEk3iskv5Okbey+LBkQ9fplrZCN9dCI=", - "owner": "rust-analyzer", - "repo": "rust-analyzer", - "rev": "d7db38fff9c251c36d0796309b43678bdf9e5bd8", + "lastModified": 1603906276, + "narHash": "sha256-RsNPnEKd7BcogwkqhaV5kI/HuNC4flH/OQCC/4W5y/8=", + "owner": "mozilla", + "repo": "nixpkgs-mozilla", + "rev": "8c007b60731c07dd7a052cce508de3bb1ae849b4", "type": "github" }, "original": { - "owner": "rust-analyzer", - "ref": "nightly", - "repo": "rust-analyzer", + "owner": "mozilla", + "repo": "nixpkgs-mozilla", "type": "github" } + }, + "root": { + "inputs": { + "flake-utils": "flake-utils", + "naersk": "naersk", + "nixpkgs": "nixpkgs", + "nixpkgs-mozilla": "nixpkgs-mozilla" + } } }, "root": "root", diff --git a/examples/cross-windows/flake.nix b/examples/cross-windows/flake.nix index 894e8b3..67269f7 100644 --- a/examples/cross-windows/flake.nix +++ b/examples/cross-windows/flake.nix @@ -1,28 +1,33 @@ { inputs = { - fenix = { - url = "github:nix-community/fenix"; - inputs.nixpkgs.follows = "nixpkgs"; - }; - flake-utils.url = "github:numtide/flake-utils"; + nixpkgs.url = github:NixOS/nixpkgs/nixpkgs-unstable; naersk = { - url = "github:nmattia/naersk"; + url = github:nmattia/naersk; inputs.nixpkgs.follows = "nixpkgs"; }; - nixpkgs.url = "nixpkgs/nixpkgs-unstable"; + nixpkgs-mozilla = { + url = github:mozilla/nixpkgs-mozilla; + flake = false; + }; + flake-utils.url = github:numtide/flake-utils; }; - outputs = { self, fenix, flake-utils, naersk, nixpkgs }: + outputs = { self, nixpkgs, naersk, nixpkgs-mozilla, flake-utils }: flake-utils.lib.eachDefaultSystem ( system: { defaultPackage = let - pkgs = nixpkgs.legacyPackages.${system}; - toolchain = with fenix.packages.${system}; - combine [ - minimal.rustc - minimal.cargo - targets.x86_64-pc-windows-gnu.latest.rust-std - ]; + pkgs = import nixpkgs { + inherit system; + overlays = [ (import nixpkgs-mozilla) ]; + }; + rustChannel = pkgs.rustChannelOf { + channel = "nightly"; + date = "2021-03-24"; + sha256 = "0y7ijxqbjac9gn038lihlcq7ynsvgi3f8fzn06bhmqhvww5dbwzn"; + }; + toolchain = rustChannel.rust.override { + targets = [ "x86_64-pc-windows-gnu" "x86_64-unknown-linux-musl" ]; + }; naersk-lib = naersk.lib.${system}.override { cargo = toolchain; rustc = toolchain;