customer-portal/nix/packages/flake-module.nix
chris 38b27c62a2
Some checks failed
Test action / Print hello world (push) Failing after 8m19s
too lazy to think of a message, so enjoy this pointless text. Good luck future me...
2025-10-09 11:34:54 +00:00

63 lines
No EOL
1.8 KiB
Nix
Executable file

{ inputs, ... }:
{
perSystem = { self', system, pkgs, lib, ... }: {
packages = {
default = self'.packages.amarth-customer-portal;
amarth-customer-portal = inputs.bun2nix.lib.${system}.mkBunDerivation rec {
pname = "amarth-customer-portal";
version = "0.0.1";
index = "app.config.ts";
src = ../..;
bunNix = ../../bun.nix;
nativeBuildInputs = with pkgs; [ bun git ];
buildPhase = ''
runHook preBuild
export BETTER_AUTH_SECRET='8&!3$!^U!&56qvSydEJ^E$cr^GSBWWFmbHJCLJ@w7vRWm7!R5b$DSoCmY$GW7HEF'
export SESSION_SECRET='jJBqeVMvQe52HqLYWDunLEKbkkC9JqCrgP92nV5j2dC99eZWCtK9H2NrASH8AbxF'
bun run build --bun
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -r ./.output/* $out
bun build ./.output/server/index.mjs --compile --outfile $out/bin/${pname}
runHook postInstall
'';
meta = {
description = "Customer portal for Amarth cloud";
longDescription = ''
This is the application where customers of the cloud you are building with Amarth.
Your customer be able to manage there resources from within this portal.
This application is the equivalent of the Azure and AWS portals.
'';
homepage = "https://git.amarth.cloud";
changelog = "https://git.amarth.cloud/releases";
license = pkgs.lib.licenses.mit;
maintainers = [
{
name = "chris";
github = "chris-kruining";
githubId = 5786905;
}
];
platforms = pkgs.lib.platforms.all;
mainProgram = pname;
};
};
};
};
}