summary refs log tree commit diff
diff options
context:
space:
mode:
authorKerstin Humm <kerstin@erictapen.name>2023-09-05 17:55:29 +0200
committerYt <happysalada@tuta.io>2023-09-07 08:59:40 +0000
commite5b6a21a70e6cd9100b656373fa1dbd85460640c (patch)
tree16bd26c82e17aefc744d5c78a4b0954ed59e96c7
parent808cfccb66d49301985d734d6e1e0c41da176b0d (diff)
downloadnixpkgs-e5b6a21a70e6cd9100b656373fa1dbd85460640c.tar
nixpkgs-e5b6a21a70e6cd9100b656373fa1dbd85460640c.tar.gz
nixpkgs-e5b6a21a70e6cd9100b656373fa1dbd85460640c.tar.bz2
nixpkgs-e5b6a21a70e6cd9100b656373fa1dbd85460640c.tar.lz
nixpkgs-e5b6a21a70e6cd9100b656373fa1dbd85460640c.tar.xz
nixpkgs-e5b6a21a70e6cd9100b656373fa1dbd85460640c.tar.zst
nixpkgs-e5b6a21a70e6cd9100b656373fa1dbd85460640c.zip
beam/buildMix: add appConfigPath arg
This is added for Mobilizon to be able to let it's dependencies read
it's config directory
-rw-r--r--pkgs/development/beam-modules/build-mix.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/development/beam-modules/build-mix.nix b/pkgs/development/beam-modules/build-mix.nix
index 69e6c6c6e3b..f74da7b7827 100644
--- a/pkgs/development/beam-modules/build-mix.nix
+++ b/pkgs/development/beam-modules/build-mix.nix
@@ -12,6 +12,9 @@
 , meta ? { }
 , enableDebugInfo ? false
 , mixEnv ? "prod"
+# A config directory that is considered for all the dependencies of an app, typically in $src/config/
+# This was initially added, as some of Mobilizon's dependencies need to access the config at build time.
+, appConfigPath ? null
 , ...
 }@attrs:
 
@@ -46,6 +49,14 @@ let
       runHook preConfigure
 
       ${./mix-configure-hook.sh}
+      ${lib.optionalString (!isNull appConfigPath)
+      # Due to https://hexdocs.pm/elixir/main/Config.html the config directory
+      # of a library seems to be not considered, as config is always
+      # application specific. So we can safely delete it.
+      ''
+        rm -rf config
+        cp -r ${appConfigPath} config
+      ''}
 
       runHook postConfigure
     '';