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
|
# USDA Dashboard External System Module
|
||||||
@@ -23,13 +23,28 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
# Get the directory where this module is located
|
||||||
|
moduleDir = builtins.toString (builtins.dirOf moduleArgs);
|
||||||
|
|
||||||
# Create a derivation that packages the usda-vision directory
|
# Create a derivation that packages the usda-vision directory
|
||||||
usda-vision-app = pkgs.stdenv.mkDerivation {
|
usda-vision-app = pkgs.stdenv.mkDerivation {
|
||||||
pname = "usda-vision";
|
pname = "usda-vision";
|
||||||
version = "1.0.0";
|
version = "1.0.0";
|
||||||
|
|
||||||
# Use the directory from this repository
|
# Use the directory from this repository with explicit source filtering
|
||||||
src = ./usda-vision;
|
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 ];
|
nativeBuildInputs = [ pkgs.makeWrapper pkgs.rsync ];
|
||||||
|
|
||||||
@@ -56,11 +71,11 @@ let
|
|||||||
rm -f $out/opt/usda-vision/.env
|
rm -f $out/opt/usda-vision/.env
|
||||||
|
|
||||||
# Update docker-compose.yml to use /var/lib/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
|
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' \
|
${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
|
$out/opt/usda-vision/docker-compose.yml > /tmp/docker-compose.yml.tmp
|
||||||
${pkgs.gnused}/bin/sed -i 's|\./management-dashboard-web-app/\.env|/var/lib/usda-vision/.env|g' \
|
mv /tmp/docker-compose.yml.tmp $out/opt/usda-vision/docker-compose.yml
|
||||||
$out/opt/usda-vision/docker-compose.yml
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create convenience scripts
|
# Create convenience scripts
|
||||||
|
|||||||
Reference in New Issue
Block a user