Fix docker-compose.yml sed and enable submodules
This commit is contained in:
29
default.nix
29
default.nix
@@ -1,4 +1,4 @@
|
||||
{ inputs, ... }:
|
||||
{ inputs, ... }@moduleArgs:
|
||||
|
||||
# ============================================================================
|
||||
# USDA Dashboard External System Module
|
||||
@@ -23,13 +23,28 @@
|
||||
}:
|
||||
|
||||
let
|
||||
# Get the directory where this module is located
|
||||
moduleDir = builtins.toString (builtins.dirOf moduleArgs);
|
||||
|
||||
# Create a derivation that packages the usda-vision directory
|
||||
usda-vision-app = pkgs.stdenv.mkDerivation {
|
||||
pname = "usda-vision";
|
||||
version = "1.0.0";
|
||||
|
||||
# Use the directory from this repository
|
||||
src = ./usda-vision;
|
||||
# Use the directory from this repository with explicit source filtering
|
||||
src = lib.cleanSourceWith {
|
||||
src = "${moduleDir}/usda-vision";
|
||||
filter = path: type:
|
||||
let
|
||||
baseName = baseNameOf path;
|
||||
in
|
||||
# Exclude git, but include everything else
|
||||
baseName != ".git" &&
|
||||
baseName != ".cursor" &&
|
||||
baseName != "__pycache__" &&
|
||||
baseName != "node_modules" &&
|
||||
baseName != ".venv";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgs.makeWrapper pkgs.rsync ];
|
||||
|
||||
@@ -56,11 +71,11 @@ let
|
||||
rm -f $out/opt/usda-vision/.env
|
||||
|
||||
# Update docker-compose.yml to use /var/lib/usda-vision/.env
|
||||
# Use temp file in /tmp to avoid permission issues
|
||||
if [ -f $out/opt/usda-vision/docker-compose.yml ]; then
|
||||
${pkgs.gnused}/bin/sed -i 's|env_file:.*management-dashboard-web-app/\.env|env_file: /var/lib/usda-vision/.env|g' \
|
||||
$out/opt/usda-vision/docker-compose.yml
|
||||
${pkgs.gnused}/bin/sed -i 's|\./management-dashboard-web-app/\.env|/var/lib/usda-vision/.env|g' \
|
||||
$out/opt/usda-vision/docker-compose.yml
|
||||
${pkgs.gnused}/bin/sed 's|env_file:.*management-dashboard-web-app/\.env|env_file: /var/lib/usda-vision/.env|g; s|\./management-dashboard-web-app/\.env|/var/lib/usda-vision/.env|g' \
|
||||
$out/opt/usda-vision/docker-compose.yml > /tmp/docker-compose.yml.tmp
|
||||
mv /tmp/docker-compose.yml.tmp $out/opt/usda-vision/docker-compose.yml
|
||||
fi
|
||||
|
||||
# Create convenience scripts
|
||||
|
||||
Reference in New Issue
Block a user