Merge pull request #18 from oxalica/dev

Update flake and expose beta/nightly in `packages`
wip/nixpkgs-raku
oxalica 3 years ago committed by GitHub
commit 8fe59894a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      .github/workflows/ci.yaml
  2. 22
      flake.lock
  3. 16
      flake.nix
  4. 9
      rust-overlay.nix

@ -15,13 +15,13 @@ jobs:
uses: actions/checkout@v2
with:
fetch-depth: 0 # Nix Flakes doesn't work on shallow clones
- name: Install Nix (flakes, nixos-unstable)
- name: Install Nix (flakes, nixpkgs-unstable)
uses: cachix/install-nix-action@v12
with:
install_url: https://github.com/numtide/nix-flakes-installer/releases/download/nix-2.4pre20201221_9fab14a/install
extra_nix_config: |
experimental-features = nix-command flakes
nix_path: nixpkgs=channel:nixos-unstable
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Check flake
run: nix flake check -v --show-trace --no-update-lock-file
@ -85,10 +85,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Nix (flakes, nixos-unstable)
- name: Get locked nixpkgs revision
id: nixpkgs_rev
run: |
rev=$(jq '.nodes.nixpkgs.locked.rev' --raw-output flake.lock)
echo "Revision: $rev"
echo "::set-output name=rev::$rev"
- name: Install Nix
uses: cachix/install-nix-action@v12
with:
nix_path: nixpkgs=channel:nixos-unstable
nix_path: nixpkgs=https://github.com/NixOS/nixpkgs/archive/${{ steps.nixpkgs_rev.outputs.rev }}.tar.gz
- name: Instantiate derivation
id: instantiate
run: |
@ -105,6 +111,9 @@ jobs:
run: |
nix-build -E "$build_expr"
./result/bin/rustc --version
- name: Prepare nix-shell
if: steps.cache-drv-status.outputs.cache-hit != 'true'
run: nix-shell -p "$build_expr" --pure --command "exit"
- name: Check compile
if: steps.cache-drv-status.outputs.cache-hit != 'true'
run: |

@ -2,11 +2,11 @@
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1609246779,
"narHash": "sha256-eq6ZXE/VWo3EMC65jmIT6H/rrUc9UWOWVujkzav025k=",
"lastModified": 1614513358,
"narHash": "sha256-LakhOx3S1dRjnh0b5Dg3mbZyH0ToC9I8Y2wKSkBaTzU=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "08c7ad4a0844adc4a7f9f5bb3beae482e789afa4",
"rev": "5466c5bbece17adaab2d82fae80b46e807611bf3",
"type": "github"
},
"original": {
@ -17,15 +17,17 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1609079092,
"narHash": "sha256-KhyKfxBHtZlAgudpZ0EJVzeuqROjKfVOwj8j0cuhU50=",
"path": "/nix/store/5pmay8rdvgw5ml1xi6189xhdbygc850k-source",
"rev": "2f47650c2f28d87f86ab807b8a339c684d91ec56",
"type": "path"
"lastModified": 1617325113,
"narHash": "sha256-GksR0nvGxfZ79T91UUtWjjccxazv6Yh/MvEJ82v1Xmw=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "54c1e44240d8a527a8f4892608c4bce5440c3ecb",
"type": "github"
},
"original": {
"id": "nixpkgs",
"type": "indirect"
"owner": "NixOS",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {

@ -5,10 +5,11 @@
'';
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }@inputs: let
outputs = { self, nixpkgs, flake-utils }: let
inherit (nixpkgs) lib;
overlay = import ./.;
@ -47,8 +48,19 @@
lib.mapAttrs' (version: comps: {
name = "rust-${lib.replaceStrings ["."] ["-"] version}";
value = comps.rust;
}) pkgs.rust-bin.stable // {
}) pkgs.rust-bin.stable //
lib.mapAttrs' (version: comps: {
name = "rust-nightly-${version}";
value = comps.rust;
}) (removeAttrs pkgs.rust-bin.nightly [ "2018-11-01" "2020-09-12" ]) // # FIXME: `rust` is not available.
lib.mapAttrs' (version: comps: {
name = "rust-beta-${version}";
value = comps.rust;
}) (removeAttrs pkgs.rust-bin.beta [ "2018-11-09" ]) // # FIXME: `rust` is not available.
{
rust = packages.rust-latest;
rust-nightly = packages.rust-nightly-latest;
rust-beta = packages.rust-beta-latest;
};
checks = let

@ -263,6 +263,11 @@ let
--replace "@miri@" "$cargo_miri" \
--replace "@out@" "$out"
fi
# `symlinkJoin` (`runCommand`) doesn't handle propagatedBuildInputs.
# Need to do it manually.
mkdir -p "$out/nix-support"
echo "$propagatedBuildInputs" > "$out/nix-support/propagated-build-inputs"
'';
# Add the compiler as part of the propagated build inputs in order
@ -271,7 +276,9 @@ let
# $ nix-shell -p rustChannels.stable.rust
#
# And get a fully working Rust compiler, with the stdenv linker.
propagatedBuildInputs = [ self.stdenv.cc ];
propagatedBuildInputs =
[ self.stdenv.cc ] ++
self.lib.optional (self.stdenv.hostPlatform.isDarwin) self.libiconv;
meta.platforms = self.lib.platforms.all;
};

Loading…
Cancel
Save