From ee3185da32f0803f13a9d3e2fb57eac39f10bda1 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Wed, 29 Nov 2017 22:31:13 -0500 Subject: [PATCH] pin a nixpkgs --- nix/default.nix | 34 ++++++++++++++++++++++++++++++++++ nix/nixpkgs.json | 7 +++++++ nix/update-nixpkgs.sh | 4 ++++ 3 files changed, 45 insertions(+) create mode 100644 nix/default.nix create mode 100644 nix/nixpkgs.json create mode 100755 nix/update-nixpkgs.sh diff --git a/nix/default.nix b/nix/default.nix new file mode 100644 index 0000000..f2f2f1f --- /dev/null +++ b/nix/default.nix @@ -0,0 +1,34 @@ +let + hostpkgs = import {}; + + srcDef = builtins.fromJSON (builtins.readFile ./nixpkgs.json); + + inherit (hostpkgs) fetchFromGitHub fetchpatch fetchurl; +in import (hostpkgs.stdenv.mkDerivation { + name = "ofborg-nixpkgs-${builtins.substring 0 10 srcDef.rev}"; + phases = [ "unpackPhase" "patchPhase" "moveToOut" ]; + + src = fetchFromGitHub { + owner = "NixOS"; + repo = "nixpkgs-channels"; + inherit (srcDef) rev sha256; + }; + + patches = [ + (fetchurl { + # As of 2017-22-29 21:30:00 EST: + # The URL is https://github.com/NixOS/nixpkgs/pull/31150 but + # with master merged in so it applies cleanly. + url = "https://github.com/NixOS/nixpkgs/compare/master...grahamc:P-E-Meunier-mkRustCrate-rebased.patch"; + name = "mkRustCrate-rebased.patch"; + sha256 = "0pnk31zwr0djlxd4wifx3sdwsv87hgfd6h8agr5wzifhlqzj48cp"; + }) + + ]; + + moveToOut = '' + root=$(pwd) + cd .. + mv "$root" $out + ''; +}) diff --git a/nix/nixpkgs.json b/nix/nixpkgs.json new file mode 100644 index 0000000..ddfa4d6 --- /dev/null +++ b/nix/nixpkgs.json @@ -0,0 +1,7 @@ +{ + "url": "https://github.com/nixos/nixpkgs-channels.git", + "rev": "2e55aec9d790cd744074fe56651f094a09695f66", + "date": "2017-11-28T16:52:08+00:00", + "sha256": "0cnabkhvx6k39g8wq4fwpg82fq3sfwy81dlk3np1zbdhp46zx96c", + "fetchSubmodules": true +} diff --git a/nix/update-nixpkgs.sh b/nix/update-nixpkgs.sh new file mode 100755 index 0000000..17b4c1b --- /dev/null +++ b/nix/update-nixpkgs.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +nix-prefetch-git https://github.com/nixos/nixpkgs-channels.git \ + --rev refs/heads/nixpkgs-unstable > ./nix/nixpkgs.json