Skip to content

Commit

Permalink
Use haskell.nix default nixpkgs for better caching,
Browse files Browse the repository at this point in the history
 keep using R 4.1.3 from nixpkgs-2111.
  • Loading branch information
jbgi committed Sep 30, 2022
1 parent 72ebed2 commit 170a3b0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 80 deletions.
45 changes: 18 additions & 27 deletions __std__/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 7 additions & 10 deletions __std__/flake.nix
Expand Up @@ -16,21 +16,18 @@
# { inputs, cell }: inputs.nixpkgs, inputs.haskell-nix
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/34e4df55664c24df350f59adba8c7a042dece61e";
follows = "haskell-nix/nixpkgs";
};
# For R version 4.1.3 (https://github.com/tweag/HaskellR/issues/374):
nixpkgs-r = {
follows = "haskell-nix/nixpkgs-2111";
};
std = {
url = "github:divnix/std";
inputs.nixpkgs.follows = "nixpkgs";
};
haskell-nix = {
url = "github:input-output-hk/haskell.nix";
inputs = {
nixpkgs.follows = "nixpkgs";
};
};
hackage-nix = {
follows = "haskell-nix/hackage";
flake = false;
};
sphinxcontrib-haddock = {
url = "github:michaelpj/sphinxcontrib-haddock";
Expand All @@ -50,8 +47,8 @@
inputs.nixpkgs.follows = "nixpkgs";
};
iohk-nix = {
url = "github:input-output-hk/iohk-nix/6a5b69dc042f521db028fed68799eb460bce05a7";
flake = false;
url = "github:input-output-hk/iohk-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};

Expand Down
28 changes: 6 additions & 22 deletions __std__/nix/toolchain/library/pkgs.nix
Expand Up @@ -11,33 +11,17 @@

let

haskell-nix-bootstrap = import inputs.haskell-nix {

pkgs = import inputs.nixpkgs.path {
system = inputs.nixpkgs.system;
};

sourcesOverride = {
hackage = inputs.hackage-nix;
};
};

iohk-nix = import inputs.iohk-nix { };


pkgs = import inputs.nixpkgs.path {

config = haskell-nix-bootstrap.nixpkgsArgs.config;
config = inputs.haskell-nix.config;

system = inputs.nixpkgs.system;

overlays =

haskell-nix-bootstrap.nixpkgsArgs.overlays ++

iohk-nix.overlays.crypto ++

[ cell.library.r-overlay ];
overlays = [
inputs.haskell-nix.overlay
inputs.iohk-nix.overlays.crypto
cell.library.r-overlay
];

};

Expand Down
23 changes: 2 additions & 21 deletions __std__/nix/toolchain/library/r-overlay.nix
Expand Up @@ -2,26 +2,7 @@

self: super: {

rPackages = super.rPackages.override {
overrides = ({
hexbin = super.rPackages.hexbin.overrideDerivation (attrs: {
nativeBuildInputs = attrs.nativeBuildInputs ++ [ super.libiconv ];
buildInputs = attrs.buildInputs ++ [ super.libiconv ];
});
});
};

R = super.R.overrideAttrs (oldAttrs: {
# TODO(std) see if this is still needed
# Backport https://github.com/NixOS/nixpkgs/pull/99570
prePatch = super.lib.optionalString super.stdenv.isDarwin ''
substituteInPlace configure --replace \
"-install_name libRblas.dylib" "-install_name $out/lib/R/lib/libRblas.dylib"
substituteInPlace configure --replace \
"-install_name libRlapack.dylib" "-install_name $out/lib/R/lib/libRlapack.dylib"
substituteInPlace configure --replace \
"-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
'';
});
# Use old R 4.1.3 due to https://github.com/tweag/HaskellR/issues/374
inherit (inputs.nixpkgs-r.legacyPackages) rPackages R;

}

0 comments on commit 170a3b0

Please sign in to comment.