aboutsummaryrefslogtreecommitdiff
path: root/nixops/modules/websites
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-02 14:15:55 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2019-04-02 14:15:55 +0200
commit33aa7e5c92daffce2f09639eb57cb995754fbd6b (patch)
tree42bd2da310e34e06f3739437c44f899a05220822 /nixops/modules/websites
parent7f6bd78f988381187bc1a75397dd332ef54263e9 (diff)
downloadNix-33aa7e5c92daffce2f09639eb57cb995754fbd6b.tar.gz
Nix-33aa7e5c92daffce2f09639eb57cb995754fbd6b.tar.zst
Nix-33aa7e5c92daffce2f09639eb57cb995754fbd6b.zip
Migrate yarn2nix to external repository
Diffstat (limited to 'nixops/modules/websites')
-rw-r--r--nixops/modules/websites/aten/aten.nix16
-rw-r--r--nixops/modules/websites/aten/default.nix2
2 files changed, 11 insertions, 7 deletions
diff --git a/nixops/modules/websites/aten/aten.nix b/nixops/modules/websites/aten/aten.nix
index b60b00a..d9286c3 100644
--- a/nixops/modules/websites/aten/aten.nix
+++ b/nixops/modules/websites/aten/aten.nix
@@ -1,4 +1,4 @@
1{ lib, writeText, fetchedGitPrivate, stdenv, composerEnv, fetchurl, fetchgit, python, nodejs, libsass, yarn2nix }: 1{ lib, writeText, fetchedGitPrivate, stdenv, runCommand, composerEnv, fetchurl, fetchgit, jq, python, nodejs, libsass, yarn2nixPackage }:
2let 2let
3 aten = { config }: rec { 3 aten = { config }: rec {
4 environment = config.environment; 4 environment = config.environment;
@@ -91,10 +91,15 @@ let
91 }; 91 };
92 yarnModules = let 92 yarnModules = let
93 info = fetchedGitPrivate ./aten.json; 93 info = fetchedGitPrivate ./aten.json;
94 packagejson = runCommand "package.json" { buildInputs = [ jq ]; } ''
95 cat ${info.src}/package.json | jq -r '.version = "v1.0.0"|.name="aten"' > $out
96 '';
94 in 97 in
95 yarn2nix.mkYarnModules { 98 yarn2nixPackage.mkYarnModules rec {
96 name = "aten-yarn-modules"; 99 name = "aten-yarn";
97 packageJSON = "${info.src}/package.json"; 100 pname = name;
101 version = "v1.0.0";
102 packageJSON = packagejson;
98 yarnLock = "${info.src}/yarn.lock"; 103 yarnLock = "${info.src}/yarn.lock";
99 pkgConfig = { 104 pkgConfig = {
100 node-sass = { 105 node-sass = {
@@ -123,13 +128,12 @@ let
123 export APP_SECRET="${config.secret}" 128 export APP_SECRET="${config.secret}"
124 ''; 129 '';
125 postInstall = '' 130 postInstall = ''
126 cd $out
127 ln -sf ${yarnModules}/node_modules . 131 ln -sf ${yarnModules}/node_modules .
128 yarn run --offline encore production 132 yarn run --offline encore production
129 rm -rf var/{log,cache} 133 rm -rf var/{log,cache}
130 ln -sf ${varDir}/{log,cache} var/ 134 ln -sf ${varDir}/{log,cache} var/
131 ''; 135 '';
132 buildInputs = [ yarnModules yarn2nix yarn2nix.yarn ]; 136 buildInputs = [ yarnModules yarn2nixPackage.yarn ];
133 }); 137 });
134 webRoot = "${webappDir}/public"; 138 webRoot = "${webappDir}/public";
135 }; 139 };
diff --git a/nixops/modules/websites/aten/default.nix b/nixops/modules/websites/aten/default.nix
index 41c22ce..51a36fb 100644
--- a/nixops/modules/websites/aten/default.nix
+++ b/nixops/modules/websites/aten/default.nix
@@ -1,6 +1,6 @@
1{ lib, pkgs, config, myconfig, mylibs, ... }: 1{ lib, pkgs, config, myconfig, mylibs, ... }:
2let 2let
3 aten = pkgs.callPackage ./aten.nix { inherit (mylibs) fetchedGitPrivate; }; 3 aten = pkgs.callPackage ./aten.nix { inherit (mylibs) fetchedGitPrivate yarn2nixPackage; };
4 aten_dev = aten { 4 aten_dev = aten {
5 config = myconfig.env.websites.aten.integration; 5 config = myconfig.env.websites.aten.integration;
6 }; 6 };