Skip to content

Commit

Permalink
Fix nix scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
NCrashed committed May 30, 2022
1 parent d64ea8a commit 3078358
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 6 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ naersk.buildPackage {
echo "Local database accessible by $DATABASE_URL"
'';
postInstall = ''
mkdir -p $out/share
cp -r ${./hexstody-hot/static} $out/share/static
cp -r ${./hexstody-hot/templates} $out/share/templates
mkdir -p $out/share/operator
mkdir -p $out/share/public
cp -r ${./hexstody-operator/static} $out/share/operator/static
cp -r ${./hexstody-public/static} $out/share/public/static
cp -r ${./hexstody-operator/templates} $out/share/operator/templates
cp -r ${./hexstody-public/templates} $out/share/public/templates
'';
}
6 changes: 4 additions & 2 deletions nix/containers.nix
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,10 @@ let
(takeOnly "hexstody-btc" "${hexstody}/bin/hexstody-btc")
(takeOnly "operator-keygen" "${hexstody}/bin/operator-keygen")
(takeOnly "wait-for-it.sh" "${hexstody.src}/docker/wait-for-it.sh")
(takeFolder "static" "${hexstody}/share/static" "/static")
(takeFolder "templates" "${hexstody}/share/templates" "/templates")
(takeFolder "operator-static" "${hexstody}/share/operator/static" "/operator/static")
(takeFolder "operator-templates" "${hexstody}/share/operator/templates" "/operator/templates")
(takeFolder "public-static" "${hexstody}/share/public/static" "/public/static")
(takeFolder "public-templates" "${hexstody}/share/public/templates" "/public/templates")
];
in { inherit
hexstody-container
Expand Down
6 changes: 4 additions & 2 deletions nix/hexstody-hot.nix
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,13 @@ in {
script = ''
export DB_PASSWORD=$(cat ${cfg.passwordFile} | xargs echo -n)
export DATABASE_URL="postgresql://${cfg.databaseUser}:$DB_PASSWORD@${cfg.databaseHost}/${cfg.databaseName}"
export HEXSTODY_SECRET_KEY=$(cat ${cfg.secretKey} | xargs echo -n)
export HEXSTODY_OPERATOR_API_SECRET_KEY=$(cat ${cfg.secretKey} | xargs echo -n)
export HEXSTODY_PUBLIC_API_SECRET_KEY=$HEXSTODY_OPERATOR_API_SECRET_KEY
cd ${cfg.package}/share
${cfg.package}/bin/hexstody-hot \
--btc-module ${cfg.btcModule} \
--static-path ${cfg.package}/share/static \
--operator-api-static-path ${cfg.package}/share/operator/static \
--public-api-static-path ${cfg.package}/share/public/static \
serve
'';
serviceConfig = {
Expand Down

0 comments on commit 3078358

Please sign in to comment.