mirror of
https://github.com/juspay/services-flake.git
synced 2024-09-17 15:28:33 +03:00
test(grafana): Use older nixpkgs for grafana on macOS
This speeds up build, because we no longer have to compile grafana locally and wait for eternity. cf. https://github.com/NixOS/nixpkgs/issues/273998
This commit is contained in:
parent
5a54b621ab
commit
31151df8e4
@ -34,6 +34,22 @@
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-grafana": {
|
||||
"locked": {
|
||||
"lastModified": 1696630667,
|
||||
"narHash": "sha256-kO67pYOeT/6m9BnPO+zNHWnC4eGiW87gIAJ+e8f3gwU=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b604023e0a5549b65da3040a07d2beb29ac9fc63",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "b604023e0a5549b65da3040a07d2beb29ac9fc63",
|
||||
"type": "github"
|
||||
}
|
||||
},
|
||||
"nixpkgs-lib": {
|
||||
"locked": {
|
||||
"dir": "lib",
|
||||
@ -71,6 +87,7 @@
|
||||
"inputs": {
|
||||
"flake-parts": "flake-parts",
|
||||
"nixpkgs": "nixpkgs",
|
||||
"nixpkgs-grafana": "nixpkgs-grafana",
|
||||
"process-compose-flake": "process-compose-flake",
|
||||
"systems": "systems"
|
||||
}
|
||||
|
@ -5,6 +5,10 @@
|
||||
systems.url = "github:nix-systems/default";
|
||||
process-compose-flake.url = "github:Platonic-Systems/process-compose-flake";
|
||||
services-flake = { };
|
||||
|
||||
# Deal with broken packages:
|
||||
# grafana is broken on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/273998
|
||||
nixpkgs-grafana.url = "github:nixos/nixpkgs/b604023e0a5549b65da3040a07d2beb29ac9fc63";
|
||||
};
|
||||
outputs = inputs:
|
||||
inputs.flake-parts.lib.mkFlake { inherit inputs; } {
|
||||
@ -12,12 +16,12 @@
|
||||
imports = [
|
||||
inputs.process-compose-flake.flakeModule
|
||||
];
|
||||
perSystem = { self', pkgs, system, lib, ... }: {
|
||||
perSystem = { self', inputs', pkgs, system, lib, ... }: {
|
||||
_module.args.pkgs = import inputs.nixpkgs {
|
||||
inherit system;
|
||||
# Required for elastic search
|
||||
config.allowUnfree = true;
|
||||
overlays = import ./overlays { inherit system lib; };
|
||||
overlays = import ./overlays { inherit system inputs' lib; };
|
||||
};
|
||||
process-compose =
|
||||
let
|
||||
|
@ -1,11 +1,13 @@
|
||||
{ lib, system, ... }:
|
||||
{ inputs', lib, system, ... }:
|
||||
|
||||
let
|
||||
isDarwin = system == "x86_64-darwin" || system == "aarch64-darwin";
|
||||
in
|
||||
lib.optionals isDarwin [
|
||||
(import ./pgadmin.nix)
|
||||
(import ./grafana.nix)
|
||||
(self: super: {
|
||||
grafana = inputs'.nixpkgs-grafana.legacyPackages.grafana;
|
||||
})
|
||||
]
|
||||
++
|
||||
[
|
||||
|
@ -1,33 +0,0 @@
|
||||
(final: prev: {
|
||||
# grafana is broken on aarch64-darwin: https://github.com/NixOS/nixpkgs/issues/273998
|
||||
grafana = (prev.callPackage "${prev.path}/pkgs/servers/monitoring/grafana" {
|
||||
buildGoModule = args: prev.buildGoModule (args // {
|
||||
|
||||
vendorHash = "sha256-Ig7Vj3HzMVOjT6Tn8aS4W000uKGoPOCFh2yIfyEWn78=";
|
||||
|
||||
proxyVendor = true;
|
||||
|
||||
offlineCache = args.offlineCache.overrideAttrs (oa: {
|
||||
buildPhase = final.lib.replaceStrings
|
||||
[ "yarn config set --json supportedArchitectures.os '[ \"linux\" ]'" ]
|
||||
[ "yarn config set --json supportedArchitectures.os '[ \"linux\", \"darwin\" ]'" ]
|
||||
oa.buildPhase;
|
||||
|
||||
outputHash =
|
||||
if final.stdenv.isLinux then
|
||||
"sha256-IlNe89T6cfXGy1WY73Yd+wg1bt9UuBCkKSDkrazybQM="
|
||||
else
|
||||
"sha256-pqInPfZEg2tcp8BXg1nnMddRZ1yyZ6KQa2flWd4IZSU=";
|
||||
});
|
||||
|
||||
# exclude the package instead of `rm pkg/util/xorm/go.{mod,sum}`
|
||||
# turns out, only removing the files is not enough, fails with:
|
||||
# > pkg/services/sqlstore/migrator/dialect.go:9:2: module ./pkg/util/xorm: reading pkg/util/xorm/go.mod: open /build/source/pkg/util/xorm/go.mod: no such file or directory
|
||||
|
||||
# both excluding and removing (`go.mod`) is also not an option because excludedPackages expects a `go.mod`
|
||||
excludedPackages = args.excludedPackages ++ [ "xorm" ];
|
||||
|
||||
postConfigure = final.lib.replaceStrings [ "rm pkg/util/xorm/go.{mod,sum}" ] [ "" ] args.postConfigure;
|
||||
});
|
||||
});
|
||||
})
|
Loading…
Reference in New Issue
Block a user