From: Ismaƫl Bouya Date: Fri, 26 Apr 2019 21:45:00 +0000 (+0200) Subject: Add yarn2nix as dependency where needed to avoid garbage collection X-Git-Tag: nur_publish~98 X-Git-Url: https://git.immae.eu/?p=perso%2FImmae%2FConfig%2FNix.git;a=commitdiff_plain;h=167b81657d696e91545cedde172e7859643bba06 Add yarn2nix as dependency where needed to avoid garbage collection --- 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