Skip to content

Commit

Permalink
Tidy a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelpj committed Jan 29, 2021
1 parent b89a915 commit e06b370
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
5 changes: 3 additions & 2 deletions marlowe-dashboard-client/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@ let
$(nix-build --quiet --no-build-output ../default.nix -A plutus.haskell.packages.marlowe-dashboard-server.components.exes.marlowe-dashboard-server)/bin/marlowe-dashboard-server psgenerator ./generated
'';

cleanSrc = gitignore-nix.gitignoreSource ./.;

nodeModules = buildNodeModules {
projectDir = gitignore-nix.gitignoreSource ./.;
projectDir = cleanSrc;
packageJson = ./package.json;
packageLockJson = ./package-lock.json;
githubSourceHashMap = { };
};

client = buildPursPackage {
inherit pkgs nodeModules;
src = ./.;
src = cleanSrc;
checkPhase = "npm run test";
name = "marlowe-dashboard-client";
extraSrcs = {
Expand Down
6 changes: 4 additions & 2 deletions marlowe-playground-client/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,10 @@ let
$(nix-build ../default.nix --quiet --no-build-output -A marlowe-playground.server-invoker)/bin/marlowe-playground webserver
'';

cleanSrc = gitignore-nix.gitignoreSource ./.;

nodeModules = buildNodeModules {
projectDir = gitignore-nix.gitignoreSource ./.;
projectDir = cleanSrc;
packageJson = ./package.json;
packageLockJson = ./package-lock.json;
githubSourceHashMap = {
Expand All @@ -52,7 +54,7 @@ let

client = buildPursPackage {
inherit pkgs nodeModules;
src = ./.;
src = cleanSrc;
checkPhase = ''
${pkgs.nodejs}/bin/npm run test
'';
Expand Down
7 changes: 1 addition & 6 deletions nix/lib/purescript.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{ stdenv
, nodejs
, easyPS
, gitignore-nix
}:

{ pkgs
Expand All @@ -21,16 +20,12 @@
, checkPhase
}:
let
# Cleans the source based on the patterns in gitignore files
cleanSrcs = gitignore-nix.gitignoreSource src;

addExtraSrc = k: v: "ln -sf ${v} ${k}";
addExtraSrcs = builtins.concatStringsSep "\n" (builtins.attrValues (pkgs.lib.mapAttrs addExtraSrc extraSrcs));
extraPSPaths = builtins.concatStringsSep " " (map (d: "${d}/**/*.purs") (builtins.attrNames extraSrcs));
in
stdenv.mkDerivation {
inherit name checkPhase;
src = cleanSrcs;
inherit name src checkPhase;
buildInputs = [
nodejs
nodeModules
Expand Down
2 changes: 1 addition & 1 deletion nix/pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ let
haddock-combine = pkgs.callPackage ../lib/haddock-combine.nix { inherit sphinxcontrib-haddock; };
latex = pkgs.callPackage ../lib/latex.nix { };
npmlock2nix = pkgs.callPackage sources.npmlock2nix { };
buildPursPackage = pkgs.callPackage ../lib/purescript.nix { inherit easyPS gitignore-nix;inherit (pkgs) nodejs; };
buildPursPackage = pkgs.callPackage ../lib/purescript.nix { inherit easyPS;inherit (pkgs) nodejs; };
buildNodeModules = pkgs.callPackage ../lib/node_modules.nix ({
inherit npmlock2nix;
} // pkgs.lib.optionalAttrs (stdenv.isDarwin) {
Expand Down
6 changes: 4 additions & 2 deletions plutus-pab-client/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ let
$(nix-build ../default.nix --quiet --no-build-output -A plutus-pab.server-invoker)/bin/plutus-pab webserver
'';

cleanSrc = gitignore-nix.gitignoreSource ./.;

nodeModules = buildNodeModules {
projectDir = gitignore-nix.gitignoreSource ./.;
projectDir = cleanSrc;
packageJson = ./package.json;
packageLockJson = ./package-lock.json;
};

client =
buildPursPackage {
inherit pkgs nodeModules;
src = ./.;
src = cleanSrc;
name = "plutus-pab-client";
extraSrcs = {
web-common = webCommon;
Expand Down
5 changes: 3 additions & 2 deletions plutus-playground-client/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,17 @@ let
$(nix-build --quiet --no-build-output ../default.nix -A plutus-playground.server-invoker)/bin/plutus-playground webserver
'';

cleanSrc = gitignore-nix.gitignoreSource ./.;

nodeModules = buildNodeModules {
projectDir = gitignore-nix.gitignoreSource ./.;
projectDir = cleanSrc;
packageJson = ./package.json;
packageLockJson = ./package-lock.json;
};

client = buildPursPackage {
inherit pkgs nodeModules;
src = ./.;
src = cleanSrc;
name = "plutus-playground-client";
# ideally we would just use `npm run test` but
# this executes `spago` which *always* attempts to download
Expand Down

0 comments on commit e06b370

Please sign in to comment.