Skip to content

Commit

Permalink
mkPackageFor in test flake (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
shivaraj-bh authored Aug 31, 2023
1 parent f2e16df commit 5fdd56f
Showing 1 changed file with 26 additions and 38 deletions.
64 changes: 26 additions & 38 deletions test/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -18,44 +18,32 @@
# Required for elastic search
config.allowUnfree = true;
};
process-compose = {
postgres = {
imports = [
inputs.services-flake.processComposeModules.default
../nix/postgres_test.nix
];
};
redis = {
imports = [
inputs.services-flake.processComposeModules.default
../nix/redis_test.nix
];
};
redis-cluster = {
imports = [
inputs.services-flake.processComposeModules.default
../nix/redis-cluster_test.nix
];
};
elasticsearch = {
imports = [
inputs.services-flake.processComposeModules.default
../nix/elasticsearch_test.nix
];
};
apache-kafka = {
imports = [
inputs.services-flake.processComposeModules.default
../nix/apache-kafka_test.nix
];
};
zookeeper = {
imports = [
inputs.services-flake.processComposeModules.default
../nix/zookeeper_test.nix
];
};
};
process-compose =
let
mkPackageFor = mod:
let
# Derive name from filename
name = lib.pipe mod [
builtins.baseNameOf
(builtins.match "(.*)_test.nix")
builtins.head
];
in
lib.nameValuePair name {
imports = [
inputs.services-flake.processComposeModules.default
mod
];
};
in
builtins.listToAttrs (builtins.map mkPackageFor [
../nix/apache-kafka_test.nix
../nix/elasticsearch_test.nix
../nix/postgres_test.nix
../nix/redis_test.nix
../nix/redis-cluster_test.nix
../nix/zookeeper_test.nix
]);
};
};
}

0 comments on commit 5fdd56f

Please sign in to comment.