Skip to content

Commit

Permalink
test: refactor, by factoring 'pkgs' in its own module
Browse files Browse the repository at this point in the history
We don't need per-file package overlays, since we don't envision having too many of them. Whenever possible, get them from nixpkgs, to keep our tests nimble.
  • Loading branch information
srid committed Mar 7, 2024
1 parent 0741d32 commit 8133abf
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 46 deletions.
17 changes: 0 additions & 17 deletions test/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 1 addition & 10 deletions test/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,15 @@
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; } {
systems = import inputs.systems;
imports = [
inputs.process-compose-flake.flakeModule
./nix/pkgs.nix
];
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 inputs' lib; };
};
process-compose =
let
mkPackageFor = mod:
Expand Down
29 changes: 29 additions & 0 deletions test/nix/pkgs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ inputs, ... }:

{
perSystem = { self', inputs', pkgs, system, lib, ... }: {
_module.args.pkgs = import inputs.nixpkgs {
inherit system;

# Required for elastic search
config.allowUnfree = true;

overlays = [
(self: super: lib.optionalAttrs super.stdenv.isDarwin {

# grafana is broken on aarch64-darwin, but works on older nixpkgs:
# https://github.com/NixOS/nixpkgs/issues/273998
grafana = (builtins.getFlake "github:nixos/nixpkgs/b604023e0a5549b65da3040a07d2beb29ac9fc63").legacyPackages.${system}.grafana;

# Disable tests, because they are failing on darwin:
# https://github.com/NixOS/nixpkgs/issues/281214
pgadmin4 = super.pgadmin4.overrideAttrs (_: {
doInstallCheck =
false;
});

})
];
};
};
}
15 changes: 0 additions & 15 deletions test/overlays/default.nix

This file was deleted.

4 changes: 0 additions & 4 deletions test/overlays/pgadmin.nix

This file was deleted.

0 comments on commit 8133abf

Please sign in to comment.