From 167b81657d696e91545cedde172e7859643bba06 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Isma=C3=ABl=20Bouya?= Date: Fri, 26 Apr 2019 23:45:00 +0200 Subject: [PATCH] Add yarn2nix as dependency where needed to avoid garbage collection --- fetched/yarn2nix.json | 15 --------------- libs.nix | 12 +++++++++++- nixops/modules/buildbot/default.nix | 3 +++ nixops/modules/websites/aten/aten.nix | 3 +++ .../modules/websites/tools/mastodon/mastodon.nix | 3 +++ 5 files changed, 20 insertions(+), 16 deletions(-) delete mode 100644 fetched/yarn2nix.json diff --git a/fetched/yarn2nix.json b/fetched/yarn2nix.json deleted file mode 100644 index 81914e3..0000000 --- a/fetched/yarn2nix.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "tag": "780e33a-master", - "meta": { - "name": "yarn2nix", - "url": "https://github.com/moretea/yarn2nix", - "branch": "master" - }, - "github": { - "owner": "moretea", - "repo": "yarn2nix", - "rev": "780e33a07fd821e09ab5b05223ddb4ca15ac663f", - "sha256": "1f83cr9qgk95g3571ps644rvgfzv2i4i7532q8pg405s4q5ada3h", - "fetchSubmodules": true - } -} diff --git a/libs.nix b/libs.nix index a9e1e78..981039e 100644 --- a/libs.nix +++ b/libs.nix @@ -1,6 +1,17 @@ { nixpkgs }: with nixpkgs; rec { + yarn2nixPackage = let + src = fetchFromGitHub { + owner = "moretea"; + repo = "yarn2nix"; + rev = "780e33a07fd821e09ab5b05223ddb4ca15ac663f"; + sha256 = "1f83cr9qgk95g3571ps644rvgfzv2i4i7532q8pg405s4q5ada3h"; + fetchSubmodules = true; + }; + in + (callPackage src {}) // { inherit src; }; + fetchedGithub = path: let json = lib.importJSON path; @@ -46,5 +57,4 @@ rec { makeWrapper "$f" "$out" ${toString args} ''; - yarn2nixPackage = callPackage (fetchedGithub ./fetched/yarn2nix.json).src {}; } diff --git a/nixops/modules/buildbot/default.nix b/nixops/modules/buildbot/default.nix index aa8df36..1c37e05 100644 --- a/nixops/modules/buildbot/default.nix +++ b/nixops/modules/buildbot/default.nix @@ -8,6 +8,9 @@ let inherit (pkgs.buildbot-pkg) version; packageJSON = "${buildslist_src.src}/package.json"; yarnLock = "${buildslist_src.src}/yarn.lock"; + pkgConfig = { + all = { buildInputs = [ mylibs.yarn2nixPackage.src ]; }; + }; }; buildslist_bower = pkgs.buildBowerComponents { name = "buildslist"; diff --git a/nixops/modules/websites/aten/aten.nix b/nixops/modules/websites/aten/aten.nix index 46a7361..c35af6f 100644 --- a/nixops/modules/websites/aten/aten.nix +++ b/nixops/modules/websites/aten/aten.nix @@ -117,6 +117,9 @@ let packageJSON = packagejson; yarnLock = "${info.src}/yarn.lock"; pkgConfig = { + all = { + buildInputs = [ yarn2nixPackage.src ]; + }; node-sass = { buildInputs = [ libsass python ]; postInstall = let diff --git a/nixops/modules/websites/tools/mastodon/mastodon.nix b/nixops/modules/websites/tools/mastodon/mastodon.nix index 3ee3552..516cc58 100644 --- a/nixops/modules/websites/tools/mastodon/mastodon.nix +++ b/nixops/modules/websites/tools/mastodon/mastodon.nix @@ -44,6 +44,9 @@ let yarnLock = "${info.src}/yarn.lock"; yarnNix = ./yarn-packages.nix; pkgConfig = { + all = { + buildInputs = [ yarn2nixPackage.src ]; + }; uws = { postInstall = '' npx node-gyp rebuild > build_log.txt 2>&1 || true -- 2.41.0