From 76fe2bc3bf14fb3f4cbd892e680f61183ff6db83 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 13 Apr 2018 11:42:49 +0200 Subject: Fix build --- default.nix | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'default.nix') diff --git a/default.nix b/default.nix index 1e631cf..dc8c226 100644 --- a/default.nix +++ b/default.nix @@ -1,14 +1,13 @@ -argumentPackages@{ ... }: - -let - defaultPackages = (import {}).haskellPackages; - haskellPackages = defaultPackages // argumentPackages; +argumentPackages@{ ... }: + +let pkgs = (import {}).pkgs // argumentPackages; - - webshim = with pkgs; stdenv.mkDerivation rec { + haskellPackages = pkgs.haskellPackages // argumentPackages; + pkg = haskellPackages.callPackage ./bar.nix {}; + webshim = pkgs.stdenv.mkDerivation rec { name = "webshim-${version}"; version = "1.16.0"; - src = fetchFromGitHub { + src = pkgs.fetchFromGitHub { owner = "aFarkas"; repo = "webshim"; rev = "1.16.0"; @@ -20,10 +19,24 @@ let cp -r $src/js-webshim/dev/* $out/js/ ''; }; -in pkgs.stdenv.lib.overrideDerivation (haskellPackages.callPackage ./bar.nix {}) (oldAttrs: { - postUnpack = '' - rm -rf bar/static/jquery.js bar/static/webshim - ln -vs ${pkgs.jquery}/js/jquery.js bar/static - ln -vs ${webshim}/js bar/static/webshim + jquery = pkgs.stdenv.mkDerivation rec { + name = "jquery-${version}"; + version = "3.3.1"; + src = pkgs.fetchurl { + url = "https://github.com/jquery/jquery/archive/${version}.tar.gz"; + sha256 = "1d1pilrwiz0yjx27cd7gbn8qar6hw5zgwjhpsyaijcg52z82wi5q"; + }; + + installPhase = '' + mkdir -p $out/js + cp -r dist/jquery.js $out/js/ ''; + }; +in pkgs.stdenv.lib.overrideDerivation pkg (drv: { + postUnpack = '' + cd bar-*/static + rm -rf jquery.js webshim + ln -vs ${jquery}/js/jquery.js . + ln -vs ${webshim}/js webshim + ''; }) -- cgit v1.2.3