Skip to content
Permalink
Browse files

pin nixpkgs

  • Loading branch information...
zimbatm committed Feb 16, 2019
1 parent b65ab49 commit e9b7093123554287971e3059cb505f1788ac95cf
Showing with 54 additions and 10 deletions.
  1. +12 −0 nix/sources.json
  2. +26 −0 nix/sources.nix
  3. +16 −10 profile.nix
@@ -0,0 +1,12 @@
{
"nixpkgs": {
"url": "https://github.com/NixOS/nixpkgs-channels/archive/36f316007494c388df1fec434c1e658542e3c3cc.tar.gz",
"owner": "NixOS",
"branch": "nixos-unstable",
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz",
"repo": "nixpkgs-channels",
"sha256": "1w1dg9ankgi59r2mh0jilccz5c4gv30a6q1k6kv2sn8vfjazwp9k",
"description": "Nixpkgs/NixOS branches that track the Nixpkgs/NixOS channels",
"rev": "36f316007494c388df1fec434c1e658542e3c3cc"
}
}
@@ -0,0 +1,26 @@
# A record, from name to path, of the third-party packages
with
{
versions = builtins.fromJSON (builtins.readFile ./sources.json);

# fetchTarball version that is compatible between all the versions of Nix
fetchTarball =
{ url, sha256 }:
if builtins.lessThan builtins.nixVersion "1.12" then
builtins.fetchTarball { inherit url; }
else
builtins.fetchTarball { inherit url sha256; };
};

# NOTE: spec must _not_ have an "outPath" attribute
builtins.mapAttrs (_: spec:
if builtins.hasAttr "outPath" spec
then abort
"The values in versions.json should not have an 'outPath' attribute"
else
if builtins.hasAttr "url" spec && builtins.hasAttr "sha256" spec
then
spec //
{ outPath = fetchTarball { inherit (spec) url sha256; } ; }
else spec
) versions
@@ -1,10 +1,16 @@
with import <nixpkgs> {};
buildEnv {
name = "mdsh-env";
paths = [
cargo
cargo-edit
rustc
rustfmt
];
}
let
sources = import ./nix/sources.nix;
pkgs = import sources.nixpkgs {
config = {};
overlays = [];
};
in
pkgs.buildEnv {
name = "mdsh-env";
paths = with pkgs; [
cargo
cargo-edit
rustc
rustfmt
];
}

0 comments on commit e9b7093

Please sign in to comment.
You can’t perform that action at this time.