From ff03caccef4633c74b76a924c69db36539b3ae7f Mon Sep 17 00:00:00 2001 From: Hercules CI Effects Date: Fri, 19 Jan 2024 02:20:15 +0000 Subject: [PATCH 1/7] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'attic': 'github:zhaofengli/attic/e6bedf1869f382cfc51b69848d6e09d51585ead6' (2024-01-02) → 'github:zhaofengli/attic/fbe252a5c21febbe920c025560cbd63b20e24f3b' (2024-01-18) • Updated input 'devshell': 'github:numtide/devshell/d45f45b634c624d2be705973b2af3b9bec29deff' (2024-01-11) → 'github:numtide/devshell/83cb93d6d063ad290beee669f4badf9914cc16ec' (2024-01-15) • Updated input 'hercules-ci-agent': 'github:hercules-ci/hercules-ci-agent/6521d0f3c82ff1d2a00df10a5c5f4c7a67b048ef' (2024-01-10) → 'github:hercules-ci/hercules-ci-agent/999be50c04489d74719a62371831f8e73da98ad4' (2024-01-17) • Updated input 'hercules-ci-agent/nixpkgs': 'github:NixOS/nixpkgs/46ae0210ce163b3cba6c7da08840c1d63de9c701' (2024-01-06) → 'github:NixOS/nixpkgs/c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370' (2024-01-15) • Updated input 'nix-filter': 'github:numtide/nix-filter/c843418ecfd0344ecb85844b082ff5675e02c443' (2023-12-04) → 'github:numtide/nix-filter/3449dc925982ad46246cfc36469baf66e1b64f17' (2024-01-15) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/2e09003f67b5c8a3e798bf5065a35a262aa5fae7' (2024-01-11) → 'github:NixOS/nixpkgs/8ae7c0e4333357288dc0ce3b6ae2c1685bf11fe0' (2024-01-18) • Updated input 'repin-flake-utils': 'github:numtide/flake-utils/4022d587cbbfd70fe950c1e2083a02621806a725' (2023-12-04) → 'github:numtide/flake-utils/1ef2e671c3b0c19053962c07dbda38332dcebf26' (2024-01-15) --- flake.lock | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/flake.lock b/flake.lock index 912af7d..d9feb16 100644 --- a/flake.lock +++ b/flake.lock @@ -40,11 +40,11 @@ ] }, "locked": { - "lastModified": 1704159259, - "narHash": "sha256-OOEFibN9JQBepVeqxSNSBr6JUmdoZiH263ogms2jk0k=", + "lastModified": 1705617092, + "narHash": "sha256-n9PK4O4X4S1JkwpkMuYm1wHZYJzRqif8g3RuVIPD+rY=", "owner": "zhaofengli", "repo": "attic", - "rev": "e6bedf1869f382cfc51b69848d6e09d51585ead6", + "rev": "fbe252a5c21febbe920c025560cbd63b20e24f3b", "type": "github" }, "original": { @@ -119,11 +119,11 @@ ] }, "locked": { - "lastModified": 1705004965, - "narHash": "sha256-yUy8bGvjopODhGgPN3gmwt8D1XxKpy88rtIB0qCbAFg=", + "lastModified": 1705332421, + "narHash": "sha256-USpGLPme1IuqG78JNqSaRabilwkCyHmVWY0M9vYyqEA=", "owner": "numtide", "repo": "devshell", - "rev": "d45f45b634c624d2be705973b2af3b9bec29deff", + "rev": "83cb93d6d063ad290beee669f4badf9914cc16ec", "type": "github" }, "original": { @@ -251,11 +251,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1704864692, - "narHash": "sha256-x7e7eu5W7tycUF3tf/FnnXd03SzsHKb5Fv2UVmVkPCc=", + "lastModified": 1705500601, + "narHash": "sha256-9WOPd01AIWmBj2KlfbUIcI3j27qNAb5CCUSOSkCk7wE=", "owner": "hercules-ci", "repo": "hercules-ci-agent", - "rev": "6521d0f3c82ff1d2a00df10a5c5f4c7a67b048ef", + "rev": "999be50c04489d74719a62371831f8e73da98ad4", "type": "github" }, "original": { @@ -395,11 +395,11 @@ }, "nix-filter": { "locked": { - "lastModified": 1701697642, - "narHash": "sha256-L217WytWZHSY8GW9Gx1A64OnNctbuDbfslaTEofXXRw=", + "lastModified": 1705332318, + "narHash": "sha256-kcw1yFeJe9N4PjQji9ZeX47jg0p9A0DuU4djKvg1a7I=", "owner": "numtide", "repo": "nix-filter", - "rev": "c843418ecfd0344ecb85844b082ff5675e02c443", + "rev": "3449dc925982ad46246cfc36469baf66e1b64f17", "type": "github" }, "original": { @@ -438,11 +438,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1704538339, - "narHash": "sha256-1734d3mQuux9ySvwf6axRWZRBhtcZA9Q8eftD6EZg6U=", + "lastModified": 1705316053, + "narHash": "sha256-J2Ey5mPFT8gdfL2XC0JTZvKaBw/b2pnyudEXFvl+dQM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "46ae0210ce163b3cba6c7da08840c1d63de9c701", + "rev": "c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370", "type": "github" }, "original": { @@ -454,11 +454,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1704957970, - "narHash": "sha256-0+dwJ24Nj6N1MYvsetqNfZ+QkdwqhJXN7nCSJBrmdOc=", + "lastModified": 1705596992, + "narHash": "sha256-35rXLgkJS050C8O8hj/zdoJq2zaglyBklGWWuyJ2YsU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2e09003f67b5c8a3e798bf5065a35a262aa5fae7", + "rev": "8ae7c0e4333357288dc0ce3b6ae2c1685bf11fe0", "type": "github" }, "original": { @@ -475,11 +475,11 @@ ] }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1705309234, + "narHash": "sha256-uNRRNRKmJyCRC/8y1RqBkqWBLM034y4qN7EprSdmgyA=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "1ef2e671c3b0c19053962c07dbda38332dcebf26", "type": "github" }, "original": { From 4854afadc43d20b24fb75cff7aeadc7f6dd19f53 Mon Sep 17 00:00:00 2001 From: Hercules CI Effects Date: Fri, 26 Jan 2024 02:20:22 +0000 Subject: [PATCH 2/7] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'hercules-ci-agent': 'github:hercules-ci/hercules-ci-agent/999be50c04489d74719a62371831f8e73da98ad4' (2024-01-17) → 'github:hercules-ci/hercules-ci-agent/d3bec2bf1f042e033b4893fbc59bab141060f3c0' (2024-01-24) • Updated input 'hercules-ci-agent/nixpkgs': 'github:NixOS/nixpkgs/c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370' (2024-01-15) → 'github:NixOS/nixpkgs/612f97239e2cc474c13c9dafa0df378058c5ad8d' (2024-01-21) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/8ae7c0e4333357288dc0ce3b6ae2c1685bf11fe0' (2024-01-18) → 'github:NixOS/nixpkgs/72d28a6d71c30f0242c18317520bc3f4d822e794' (2024-01-25) --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index d9feb16..7af51fe 100644 --- a/flake.lock +++ b/flake.lock @@ -251,11 +251,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1705500601, - "narHash": "sha256-9WOPd01AIWmBj2KlfbUIcI3j27qNAb5CCUSOSkCk7wE=", + "lastModified": 1706072241, + "narHash": "sha256-iRCnFRU/6ScZs5jx9jacRBfKQknw12qJP7qRQlYlJlQ=", "owner": "hercules-ci", "repo": "hercules-ci-agent", - "rev": "999be50c04489d74719a62371831f8e73da98ad4", + "rev": "d3bec2bf1f042e033b4893fbc59bab141060f3c0", "type": "github" }, "original": { @@ -438,11 +438,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1705316053, - "narHash": "sha256-J2Ey5mPFT8gdfL2XC0JTZvKaBw/b2pnyudEXFvl+dQM=", + "lastModified": 1705856552, + "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c3e128f3c0ecc1fb04aef9f72b3dcc2f6cecf370", + "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", "type": "github" }, "original": { @@ -454,11 +454,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1705596992, - "narHash": "sha256-35rXLgkJS050C8O8hj/zdoJq2zaglyBklGWWuyJ2YsU=", + "lastModified": 1706176172, + "narHash": "sha256-+kOLrH4DNw6EMITqXosMqoQUyIGWTMYVYcqALP8+PPc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8ae7c0e4333357288dc0ce3b6ae2c1685bf11fe0", + "rev": "72d28a6d71c30f0242c18317520bc3f4d822e794", "type": "github" }, "original": { From 8230c5f777836d9b12406d3644d0a6af22ec3b93 Mon Sep 17 00:00:00 2001 From: Hercules CI Effects Date: Fri, 2 Feb 2024 02:19:50 +0000 Subject: [PATCH 3/7] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'flake-parts': 'github:hercules-ci/flake-parts/07f6395285469419cf9d078f59b5b49993198c00' (2024-01-11) → 'github:hercules-ci/flake-parts/b253292d9c0a5ead9bc98c4e9a26c6312e27d69f' (2024-02-01) • Updated input 'hercules-ci-agent': 'github:hercules-ci/hercules-ci-agent/d3bec2bf1f042e033b4893fbc59bab141060f3c0' (2024-01-24) → 'github:hercules-ci/hercules-ci-agent/e08125e80cb3bd596dec5d24b2134088a72e3f6e' (2024-02-01) • Updated input 'hercules-ci-agent/nixpkgs': 'github:NixOS/nixpkgs/612f97239e2cc474c13c9dafa0df378058c5ad8d' (2024-01-21) → 'github:NixOS/nixpkgs/97b17f32362e475016f942bbdfda4a4a72a8a652' (2024-01-29) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/72d28a6d71c30f0242c18317520bc3f4d822e794' (2024-01-25) → 'github:NixOS/nixpkgs/25e3d4c0d3591c99929b1ec07883177f6ea70c9d' (2024-02-01) --- flake.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/flake.lock b/flake.lock index 7af51fe..4a87923 100644 --- a/flake.lock +++ b/flake.lock @@ -195,11 +195,11 @@ ] }, "locked": { - "lastModified": 1704982712, - "narHash": "sha256-2Ptt+9h8dczgle2Oo6z5ni5rt/uLMG47UFTR1ry/wgg=", + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "07f6395285469419cf9d078f59b5b49993198c00", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", "type": "github" }, "original": { @@ -251,11 +251,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1706072241, - "narHash": "sha256-iRCnFRU/6ScZs5jx9jacRBfKQknw12qJP7qRQlYlJlQ=", + "lastModified": 1706811986, + "narHash": "sha256-mvmqUwVT6cFIgDtiNVzPa3M6oqV50hpwhSzWeoMwGGg=", "owner": "hercules-ci", "repo": "hercules-ci-agent", - "rev": "d3bec2bf1f042e033b4893fbc59bab141060f3c0", + "rev": "e08125e80cb3bd596dec5d24b2134088a72e3f6e", "type": "github" }, "original": { @@ -438,11 +438,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1705856552, - "narHash": "sha256-JXfnuEf5Yd6bhMs/uvM67/joxYKoysyE3M2k6T3eWbg=", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "612f97239e2cc474c13c9dafa0df378058c5ad8d", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", "type": "github" }, "original": { @@ -454,11 +454,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1706176172, - "narHash": "sha256-+kOLrH4DNw6EMITqXosMqoQUyIGWTMYVYcqALP8+PPc=", + "lastModified": 1706826059, + "narHash": "sha256-N69Oab+cbt3flLvYv8fYnEHlBsWwdKciNZHUbynVEOA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "72d28a6d71c30f0242c18317520bc3f4d822e794", + "rev": "25e3d4c0d3591c99929b1ec07883177f6ea70c9d", "type": "github" }, "original": { From 56a306ead6beac01952a6303822c2466ab3bf38a Mon Sep 17 00:00:00 2001 From: Hercules CI Effects Date: Fri, 9 Feb 2024 02:21:03 +0000 Subject: [PATCH 4/7] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'hercules-ci-agent': 'github:hercules-ci/hercules-ci-agent/e08125e80cb3bd596dec5d24b2134088a72e3f6e' (2024-02-01) → 'github:hercules-ci/hercules-ci-agent/d1b8efd21d1832291e58bd99805eea8f8194d07b' (2024-02-07) • Updated input 'hercules-ci-agent/nixpkgs': 'github:NixOS/nixpkgs/97b17f32362e475016f942bbdfda4a4a72a8a652' (2024-01-29) → 'github:NixOS/nixpkgs/faf912b086576fd1a15fca610166c98d47bc667e' (2024-02-05) • Updated input 'nixpkgs': 'github:NixOS/nixpkgs/25e3d4c0d3591c99929b1ec07883177f6ea70c9d' (2024-02-01) → 'github:NixOS/nixpkgs/620b309240d774a0ea00611d8291f96141c1e60e' (2024-02-08) --- flake.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/flake.lock b/flake.lock index 4a87923..9c189b1 100644 --- a/flake.lock +++ b/flake.lock @@ -251,11 +251,11 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1706811986, - "narHash": "sha256-mvmqUwVT6cFIgDtiNVzPa3M6oqV50hpwhSzWeoMwGGg=", + "lastModified": 1707316879, + "narHash": "sha256-QAE+1H+eew9eNuHmqdQv4berobTbgC4sis/dm7MRat4=", "owner": "hercules-ci", "repo": "hercules-ci-agent", - "rev": "e08125e80cb3bd596dec5d24b2134088a72e3f6e", + "rev": "d1b8efd21d1832291e58bd99805eea8f8194d07b", "type": "github" }, "original": { @@ -438,11 +438,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1706550542, - "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "lastModified": 1707092692, + "narHash": "sha256-ZbHsm+mGk/izkWtT4xwwqz38fdlwu7nUUKXTOmm4SyE=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "rev": "faf912b086576fd1a15fca610166c98d47bc667e", "type": "github" }, "original": { @@ -454,11 +454,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1706826059, - "narHash": "sha256-N69Oab+cbt3flLvYv8fYnEHlBsWwdKciNZHUbynVEOA=", + "lastModified": 1707401858, + "narHash": "sha256-aDoW/6ST/C2q7auOChns0tMEtRoGYdRMbFOqNGcZ4jQ=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "25e3d4c0d3591c99929b1ec07883177f6ea70c9d", + "rev": "620b309240d774a0ea00611d8291f96141c1e60e", "type": "github" }, "original": { From 68896fde842505ebceac6ed5f4d15d6f0d50cdaa Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 9 Feb 2024 13:08:02 +0100 Subject: [PATCH 5/7] meta: fix follows --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index c397c2c..3c11485 100644 --- a/flake.nix +++ b/flake.nix @@ -63,7 +63,7 @@ url = "github:numtide/devshell"; inputs = { nixpkgs.follows = "nixpkgs"; - systems.follows = "systems"; + flake-utils.follows = "repin-flake-utils"; }; }; From b15a5956ec57e52aad2dbe72455dca99bda0db61 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 9 Feb 2024 13:08:05 +0100 Subject: [PATCH 6/7] flake.lock: Update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake lock file updates: • Updated input 'devshell/flake-utils': 'github:numtide/flake-utils/4022d587cbbfd70fe950c1e2083a02621806a725' (2023-12-04) → follows 'repin-flake-utils' • Removed input 'devshell/flake-utils/systems' --- flake.lock | 39 ++++----------------------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/flake.lock b/flake.lock index 9c189b1..e1ef609 100644 --- a/flake.lock +++ b/flake.lock @@ -113,7 +113,9 @@ }, "devshell": { "inputs": { - "flake-utils": "flake-utils", + "flake-utils": [ + "repin-flake-utils" + ], "nixpkgs": [ "nixpkgs" ] @@ -208,24 +210,6 @@ "type": "github" } }, - "flake-utils": { - "inputs": { - "systems": "systems_2" - }, - "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, "haskell-flake": { "locked": { "lastModified": 1684780604, @@ -504,7 +488,7 @@ "nix-super": "nix-super", "nixpkgs": "nixpkgs_2", "repin-flake-utils": "repin-flake-utils", - "systems": "systems_3" + "systems": "systems_2" } }, "systems": { @@ -523,21 +507,6 @@ } }, "systems_2": { - "locked": { - "lastModified": 1681028828, - "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", - "owner": "nix-systems", - "repo": "default", - "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", - "type": "github" - }, - "original": { - "owner": "nix-systems", - "repo": "default", - "type": "github" - } - }, - "systems_3": { "locked": { "lastModified": 1683988522, "narHash": "sha256-cAVqq+Mjx4EiWovT7rwbwncX5QBnhNsqwsgyg+eeYrg=", From 6060d6d59b015668c1ede3557fbc15b874f964d2 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 9 Feb 2024 13:13:07 +0100 Subject: [PATCH 7/7] packages/grafana: 10.2.0 -> 10.3.1 --- packages/monitoring/grafana/default.nix | 120 ++++++++++++++++++++---- 1 file changed, 103 insertions(+), 17 deletions(-) diff --git a/packages/monitoring/grafana/default.nix b/packages/monitoring/grafana/default.nix index c4c9c75..fcb3c1f 100644 --- a/packages/monitoring/grafana/default.nix +++ b/packages/monitoring/grafana/default.nix @@ -1,28 +1,86 @@ -{ lib, buildGoModule, fetchurl, fetchFromGitHub, nixosTests, tzdata, wire }: +{ lib, stdenv, buildGoModule, fetchFromGitHub, removeReferencesTo +, tzdata, wire +, yarn, nodejs, python3, cacert +, jq, moreutils +, nix-update-script, nixosTests +}: +let + # We need dev dependencies to run webpack, but patch away + # `cypress` (and @grafana/e2e which has a direct dependency on cypress). + # This attempts to download random blobs from the Internet in + # postInstall. Also, it's just a testing framework, so not worth the hassle. + patchAwayGrafanaE2E = '' + find . -name package.json | while IFS=$'\n' read -r pkg_json; do + <"$pkg_json" jq '. + { + "devDependencies": .devDependencies | del(."@grafana/e2e") | del(.cypress) + }' | sponge "$pkg_json" + done + rm -r packages/grafana-e2e + ''; + + # Injects a `t.Skip()` into a given test since + # there's apparently no other way to skip tests here. + skipTest = lineOffset: testCase: file: + let + jumpAndAppend = lib.concatStringsSep ";" (lib.replicate (lineOffset - 1) "n" ++ [ "a" ]); + in '' + sed -i -e '/${testCase}/{ + ${jumpAndAppend} t.Skip(); + }' ${file} + ''; +in buildGoModule rec { pname = "grafana"; - version = "10.2.0"; + version = "10.3.1"; excludedPackages = [ "alert_webhook_listener" "clean-swagger" "release_publisher" "slow_proxy" "slow_proxy_mac" "macaron" "devenv" "modowners" ]; src = fetchFromGitHub { - rev = "v${version}"; owner = "grafana"; repo = "grafana"; - hash = "sha256-PNKvu7DfVHzBaRGM/Zej0oI5pbi6gPta+ZzVEXXmTsI="; + rev = "v${version}"; + hash = "sha256-UPIq7BWTlT0omt/SM5+vkfOHvsdcx/ikkjcW9X8pcw0="; }; - srcStatic = fetchurl { - url = "https://dl.grafana.com/oss/release/grafana-${version}.linux-amd64.tar.gz"; - hash = "sha256-KE026VWxlJYzRqTqry4h8vm1NIXB7sJUucz+W/s1eoE="; + offlineCache = stdenv.mkDerivation { + name = "${pname}-${version}-yarn-offline-cache"; + inherit src; + nativeBuildInputs = [ + yarn nodejs cacert + jq moreutils + ]; + postPatch = '' + ${patchAwayGrafanaE2E} + ''; + buildPhase = '' + runHook preBuild + export HOME="$(mktemp -d)" + yarn config set enableTelemetry 0 + yarn config set cacheFolder $out + yarn config set --json supportedArchitectures.os '[ "linux" ]' + yarn config set --json supportedArchitectures.cpu '["arm", "arm64", "ia32", "x64"]' + yarn + runHook postBuild + ''; + dontConfigure = true; + dontInstall = true; + dontFixup = true; + outputHashMode = "recursive"; + outputHash = "sha256-70eMa8E483f/Bz7iy+4Seap1EfIdjD5krnt6W9CUows="; }; - vendorHash = "sha256-Mybo7ZVP7fwmBwloC3jHJnqPmhbj1DQSwz8T2onkL3Y="; + disallowedRequisites = [ offlineCache ]; - nativeBuildInputs = [ wire ]; + vendorHash = "sha256-Gf2A22d7/8xU/ld7kveqGonVKGFCArGNansPRGhfyXM="; - preBuild = '' + nativeBuildInputs = [ wire yarn jq moreutils removeReferencesTo python3 ]; + + postPatch = '' + ${patchAwayGrafanaE2E} + ''; + + postConfigure = '' # Generate DI code that's required to compile the package. # From https://github.com/grafana/grafana/blob/v8.2.3/Makefile#L33-L35 wire gen -tags oss ./pkg/server @@ -42,12 +100,14 @@ buildGoModule rec { # [...] # grafana> t=2021-12-02T14:24:58+0000 lvl=dbug msg="Failed to get latest.json repo from github.com" logger=update.checker error="Get \"https://raw.githubusercontent.com/grafana/grafana/main/latest.json\": dial tcp: lookup raw.githubusercontent.com on [::1]:53: read udp [::1]:36391->[::1]:53: read: connection refused" # grafana> t=2021-12-02T14:24:58+0000 lvl=dbug msg="Failed to get plugins repo from grafana.com" logger=plugin.manager error="Get \"https://grafana.com/api/plugins/versioncheck?slugIn=&grafanaVersion=\": dial tcp: lookup grafana.com on [::1]:53: read udp [::1]:41796->[::1]:53: read: connection refused" - sed -i -e '/Request is not forbidden if from an admin/a t.Skip();' pkg/tests/api/plugins/api_plugins_test.go + ${skipTest 1 "Request is not forbidden if from an admin" "pkg/tests/api/plugins/api_plugins_test.go"} # Skip a flaky test (https://github.com/NixOS/nixpkgs/pull/126928#issuecomment-861424128) - sed -i -e '/it should change folder successfully and return correct result/{N;s/$/\nt.Skip();/}'\ - pkg/services/libraryelements/libraryelements_patch_test.go + ${skipTest 2 "it should change folder successfully and return correct result" "pkg/services/libraryelements/libraryelements_patch_test.go"} + # Skip flaky tests (https://logs.ofborg.org/?key=nixos/nixpkgs.263185&attempt_id=5b056a17-67a7-4b74-9dc7-888eb1d6c2dd) + ${skipTest 1 "TestIntegrationRulerAccess" "pkg/tests/api/alerting/api_alertmanager_test.go"} + ${skipTest 1 "TestIntegrationRulePause" "pkg/tests/api/alerting/api_ruler_test.go"} # main module (github.com/grafana/grafana) does not contain package github.com/grafana/grafana/scripts/go rm -r scripts/go @@ -58,6 +118,29 @@ buildGoModule rec { # grafana> 2023/08/24 08:30:23 failed to copy objects, err: Post "https://storage.googleapis.com/upload/storage/v1/b/grafana-testing-repo/o?alt=json&name=test-path%2Fbuild%2FTestCopyLocalDir2194093976%2F001%2Ffile2.txt&prettyPrint=false&projection=full&uploadType=multipart": dial tcp: lookup storage.googleapis.com on [::1]:53: read udp [::1]:36436->[::1]:53: read: connection refused # grafana> panic: test timed out after 10m0s rm pkg/build/gcloud/storage/gsutil_test.go + + # Setup node_modules + export HOME="$(mktemp -d)" + + # Help node-gyp find Node.js headers + # (see https://github.com/NixOS/nixpkgs/blob/master/doc/languages-frameworks/javascript.section.md#pitfalls-javascript-yarn2nix-pitfalls) + mkdir -p $HOME/.node-gyp/${nodejs.version} + echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion + ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version} + export npm_config_nodedir=${nodejs} + + yarn config set enableTelemetry 0 + yarn config set cacheFolder $offlineCache + yarn --immutable-cache + + # The build OOMs on memory constrained aarch64 without this + export NODE_OPTIONS=--max_old_space_size=4096 + ''; + + postBuild = '' + # After having built all the Go code, run the JS builders now. + yarn run build + yarn run plugins:build-bundled ''; ldflags = [ @@ -75,16 +158,19 @@ buildGoModule rec { ''; postInstall = '' - tar -xvf $srcStatic mkdir -p $out/share/grafana - mv grafana-*/{public,conf,tools} $out/share/grafana/ + cp -r public conf $out/share/grafana/ + ''; - cp ./conf/defaults.ini $out/share/grafana/conf/ + postFixup = '' + while read line; do + remove-references-to -t $offlineCache "$line" + done < <(find $out -type f -name '*.js.map' -or -name '*.js') ''; passthru = { tests = { inherit (nixosTests) grafana; }; - updateScript = ./update.sh; + updateScript = nix-update-script { }; }; meta = with lib; {