fix: complete Nix Docker image build and untrack .claude/settings.local.json
Nix build fixes: - Override beamPackages.elixir to use 1.19.5 instead of default 1.18.4 - Add explicit buildPhase to compile dependencies before application - Remove postInstall phase (Mix automatically includes priv/ in release) - Set HEX_OFFLINE=false to allow dependency fetching in Nix sandbox Docker image build now succeeds (~507 MB compressed). Also remove .claude/settings.local.json from git tracking (keep local). File remains in working directory but is now properly ignored.
This commit is contained in:
parent
0c00e5ee16
commit
af9537939b
4 changed files with 27 additions and 29 deletions
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"permissions": {
|
||||
"allow": [
|
||||
"Bash(mix test:*)",
|
||||
"Bash(mix format:*)",
|
||||
"Bash(mix credo:*)",
|
||||
"Bash(git add:*)",
|
||||
"Bash(git commit:*)"
|
||||
]
|
||||
}
|
||||
}
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -94,3 +94,4 @@ profiles.json
|
|||
.beads/
|
||||
.logs/
|
||||
.direnv/
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,12 @@
|
|||
|
||||
# Ensure beam packages use our pinned versions
|
||||
# This affects mixRelease and all BEAM-related builds
|
||||
beamPackages = prev.beam.packages.erlang_28;
|
||||
# Override the default elixir within beamPackages to use 1.19
|
||||
beamPackages = prev.beam.packages.erlang_28.extend (
|
||||
self: super: {
|
||||
elixir = super.elixir_1_19;
|
||||
}
|
||||
);
|
||||
})
|
||||
];
|
||||
};
|
||||
|
|
|
|||
|
|
@ -56,6 +56,9 @@ beamPackages.mixRelease {
|
|||
export SSL_CERT_FILE="${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
export GIT_SSL_CAINFO="${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
|
||||
# Disable Hex offline mode to allow fetching dependencies
|
||||
export HEX_OFFLINE=false
|
||||
|
||||
# Get all deps (including hex deps that vendored packages need)
|
||||
mix deps.get --only prod
|
||||
|
||||
|
|
@ -79,29 +82,29 @@ beamPackages.mixRelease {
|
|||
EOF
|
||||
'';
|
||||
|
||||
# Custom build phase to compile deps first, then app
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
# Compile dependencies (including custom compilers like phoenix_live_view)
|
||||
mix deps.compile
|
||||
|
||||
# Compile application
|
||||
mix compile
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
# Build assets after Mix compilation
|
||||
postBuild = ''
|
||||
# Build production assets (Tailwind + esbuild)
|
||||
mix assets.deploy
|
||||
'';
|
||||
|
||||
# Install MIB files to the release
|
||||
postInstall = ''
|
||||
# Find the release directory (mixRelease creates lib/<name>-<version>)
|
||||
RELEASE_DIR=$(find $out/lib -maxdepth 1 -type d -name "towerops-*" | head -1)
|
||||
|
||||
if [ -n "$RELEASE_DIR" ]; then
|
||||
# Copy MIB files directory
|
||||
if [ -d "$src/priv/mibs" ]; then
|
||||
mkdir -p $RELEASE_DIR/priv/mibs
|
||||
cp -r $src/priv/mibs/* $RELEASE_DIR/priv/mibs/
|
||||
fi
|
||||
|
||||
# Ensure NIF is in the release
|
||||
mkdir -p $RELEASE_DIR/priv
|
||||
cp ${towerops-nif}/lib/towerops_nif.so $RELEASE_DIR/priv/
|
||||
fi
|
||||
'';
|
||||
# MIB files and NIF are automatically included by Mix release
|
||||
# Mix includes everything in priv/ directory when building the release
|
||||
# No postInstall needed - NIF was copied to priv/ in preBuild
|
||||
# and MIB files are already in priv/mibs/ from source
|
||||
|
||||
meta = {
|
||||
description = "Towerops - Phoenix LiveView SNMP monitoring platform";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue