systant/systant.nix
ryan f8173a1afb Fix COOKIE file missing in Nix build
- Add postInstall hook to ensure COOKIE file exists
- Include ERTS and disable beam stripping in release config
- Handle mixRelease differences from local builds

This ensures the Elixir release works properly when built via Nix.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 18:00:37 -07:00

35 lines
1016 B
Nix

{ lib, beamPackages, fetchgit }:
beamPackages.mixRelease rec {
pname = "systant";
version = "0.1.0";
src = fetchgit {
url = "https://git.ryanpandya.com/ryan/systant.git";
rev = "9d8ad1890b682a58aaa27406a7f28337c4c67d5f";
sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
# Mix dependencies will be automatically fetched and cached by Nix
mixFodDeps = beamPackages.fetchMixDeps {
pname = "systant-mix-deps";
inherit src version;
sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
};
# Ensure COOKIE file exists
postInstall = ''
if [ ! -f $out/releases/COOKIE ]; then
mkdir -p $out/releases
echo "systant-cookie-change-in-production" > $out/releases/COOKIE
fi
'';
meta = with lib; {
description = "Systant - System stats MQTT daemon for monitoring system metrics";
homepage = "https://git.ryanpandya.com/ryan/systant";
license = licenses.mit;
maintainers = [ ];
platforms = platforms.linux;
};
}