Skip to content

Updated nix to latest version. #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ compiler ? "ghc884"
{ compiler ? "ghc8104"
, system ? builtins.currentSystem
, pkgs ? import ./dep/nixpkgs { inherit system; }
}:
Expand All @@ -7,7 +7,7 @@ let
inherit (pkgs) lib;
inherit (pkgs.lib.trivial) flip pipe;
inherit (pkgs.haskell.lib) appendPatch appendConfigureFlags overrideCabal;
nodePkgs = (pkgs.callPackage ./dep/node { inherit pkgs; nodejs = pkgs.nodejs-12_x; }).shell.nodeDependencies;
nodePkgs = (pkgs.callPackage ./dep/node { inherit pkgs; nodejs = pkgs.nodejs; }).shell.nodeDependencies;

haskellPackages = pkgs.haskell.packages.${compiler}.override {
overrides = hpNew: hpOld: {
Expand All @@ -17,7 +17,7 @@ let
[ (flip appendConfigureFlags [ "-f" "watchServer" "-f" "previewServer" ])
];

haskell-foundation = hpNew.callCabal2nix "haskell-foundation" (pkgs.stdenv.lib.cleanSource ./haskell) { };
haskell-foundation = hpNew.callCabal2nix "haskell-foundation" (pkgs.lib.cleanSource ./haskell) { };
};
};

Expand Down
6 changes: 3 additions & 3 deletions dep/nixpkgs/github.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"owner": "NixOS",
"repo": "nixpkgs",
"branch": "nixos-20.09",
"branch": "master",
"private": false,
"rev": "9b8530e3721fc008bacac61b6c50a29712ee2f2f",
"sha256": "1f584ms40nv0s4wc1jl2nq05wn8a85426jdk6iiszaifn07d82jq"
"rev": "1e41d06dd78940e8a292ef42b74d7dab2ef01ac4",
"sha256": "1hd6pg97sd4icqlmxk1bvadz0wbk18wdnh1z8129f31sx0dxizmj"
}
6 changes: 3 additions & 3 deletions dep/node/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-12_x"}:
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs"}:

let
nodeEnv = import ./node-env.nix {
inherit (pkgs) stdenv python2 utillinux runCommand writeTextFile;
inherit (pkgs) lib stdenv python3 utillinux runCommand writeTextFile;
inherit nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl fetchgit;
inherit nodeEnv;
}
}
48 changes: 24 additions & 24 deletions dep/node/node-env.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# This file originates from node2nix

{stdenv, nodejs, python2, utillinux, libtool, runCommand, writeTextFile}:
{stdenv, lib, nodejs, python3, utillinux, libtool, runCommand, writeTextFile}:

let
python = if nodejs ? python then nodejs.python else python2;
python = if nodejs ? python then nodejs.python else python3;

# Create a tar wrapper that filters all the 'Ignoring unknown extended header keyword' noise
tarWrapper = runCommand "tarWrapper" {} ''
Expand Down Expand Up @@ -38,8 +38,8 @@ let
};

includeDependencies = {dependencies}:
stdenv.lib.optionalString (dependencies != [])
(stdenv.lib.concatMapStrings (dependency:
lib.optionalString (dependencies != [])
(lib.concatMapStrings (dependency:
''
# Bundle the dependencies of the package
mkdir -p node_modules
Expand Down Expand Up @@ -100,7 +100,7 @@ let
cd "$DIR/${packageName}"
${includeDependencies { inherit dependencies; }}
cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
'';

pinpointDependencies = {dependencies, production}:
Expand Down Expand Up @@ -161,12 +161,12 @@ let
''
node ${pinpointDependenciesFromPackageJSON} ${if production then "production" else "development"}

${stdenv.lib.optionalString (dependencies != [])
${lib.optionalString (dependencies != [])
''
if [ -d node_modules ]
then
cd node_modules
${stdenv.lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies}
${lib.concatMapStrings (dependency: pinpointDependenciesOfPackage dependency) dependencies}
cd ..
fi
''}
Expand All @@ -183,7 +183,7 @@ let
cd "${packageName}"
${pinpointDependencies { inherit dependencies production; }}
cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
fi
'';

Expand Down Expand Up @@ -344,8 +344,8 @@ let
cd "${packageName}"
runHook preRebuild

${stdenv.lib.optionalString bypassCache ''
${stdenv.lib.optionalString reconstructLock ''
${lib.optionalString bypassCache ''
${lib.optionalString reconstructLock ''
if [ -f package-lock.json ]
then
echo "WARNING: Reconstruct lock option enabled, but a lock file already exists!"
Expand All @@ -361,14 +361,14 @@ let
node ${addIntegrityFieldsScript}
''}

npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} rebuild
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} rebuild

if [ "''${dontNpmInstall-}" != "1" ]
then
# NPM tries to download packages even when they already exist if npm-shrinkwrap is used.
rm -f npm-shrinkwrap.json

npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${stdenv.lib.optionalString production "--production"} install
npm ${forceOfflineFlag} --nodedir=${nodeSources} ${npmFlags} ${lib.optionalString production "--production"} install
fi
'';

Expand Down Expand Up @@ -396,8 +396,8 @@ let
stdenv.mkDerivation ({
name = "node_${name}-${version}";
buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ lib.optional (stdenv.isLinux) utillinux
++ lib.optional (stdenv.isDarwin) libtool
++ buildInputs;

inherit nodejs;
Expand Down Expand Up @@ -470,8 +470,8 @@ let
name = "node-dependencies-${name}-${version}";

buildInputs = [ tarWrapper python nodejs ]
++ stdenv.lib.optional (stdenv.isLinux) utillinux
++ stdenv.lib.optional (stdenv.isDarwin) libtool
++ lib.optional (stdenv.isLinux) utillinux
++ lib.optional (stdenv.isDarwin) libtool
++ buildInputs;

inherit dontStrip; # Stripping may fail a build for some package deployments
Expand All @@ -491,7 +491,7 @@ let
# Create fake package.json to make the npm commands work properly
cp ${src}/package.json .
chmod 644 package.json
${stdenv.lib.optionalString bypassCache ''
${lib.optionalString bypassCache ''
if [ -f ${src}/package-lock.json ]
then
cp ${src}/package-lock.json .
Expand All @@ -500,13 +500,13 @@ let

# Go to the parent folder to make sure that all packages are pinpointed
cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}

${prepareAndInvokeNPM { inherit packageName bypassCache reconstructLock npmFlags production; }}

# Expose the executables that were installed
cd ..
${stdenv.lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}
${lib.optionalString (builtins.substring 0 1 packageName == "@") "cd .."}

mv ${packageName} lib
ln -s $out/lib/node_modules/.bin $out/bin
Expand All @@ -516,7 +516,7 @@ let
stdenv.mkDerivation {
name = "node-shell-${name}-${version}";

buildInputs = [ python nodejs ] ++ stdenv.lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
buildInputs = [ python nodejs ] ++ lib.optional (stdenv.isLinux) utillinux ++ buildInputs;
buildCommand = ''
mkdir -p $out/bin
cat > $out/bin/shell <<EOF
Expand All @@ -529,14 +529,14 @@ let

# Provide the dependencies in a development shell through the NODE_PATH environment variable
inherit nodeDependencies;
shellHook = stdenv.lib.optionalString (dependencies != []) ''
shellHook = lib.optionalString (dependencies != []) ''
export NODE_PATH=${nodeDependencies}/lib/node_modules
export PATH="${nodeDependencies}/bin:$PATH"
'';
};
in
{
buildNodeSourceDist = stdenv.lib.makeOverridable buildNodeSourceDist;
buildNodePackage = stdenv.lib.makeOverridable buildNodePackage;
buildNodeShell = stdenv.lib.makeOverridable buildNodeShell;
buildNodeSourceDist = lib.makeOverridable buildNodeSourceDist;
buildNodePackage = lib.makeOverridable buildNodePackage;
buildNodeShell = lib.makeOverridable buildNodeShell;
}
2 changes: 1 addition & 1 deletion haskell/haskell-foundation.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ executable site
, containers
, directory
, filepath
, hakyll == 4.13.*
, hakyll == 4.14.*
, text
, unordered-containers
ghc-options: -threaded
Expand Down