pin a nixpkgs
This commit is contained in:
parent
363675c2ee
commit
ee3185da32
34
nix/default.nix
Normal file
34
nix/default.nix
Normal file
|
@ -0,0 +1,34 @@
|
|||
let
|
||||
hostpkgs = import <nixpkgs> {};
|
||||
|
||||
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
|
||||
'';
|
||||
})
|
7
nix/nixpkgs.json
Normal file
7
nix/nixpkgs.json
Normal file
|
@ -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
|
||||
}
|
4
nix/update-nixpkgs.sh
Executable file
4
nix/update-nixpkgs.sh
Executable file
|
@ -0,0 +1,4 @@
|
|||
#!/bin/sh
|
||||
|
||||
nix-prefetch-git https://github.com/nixos/nixpkgs-channels.git \
|
||||
--rev refs/heads/nixpkgs-unstable > ./nix/nixpkgs.json
|
Loading…
Reference in a new issue