Commit e42a9ddc authored by Profpatsch's avatar Profpatsch

use upstream sangha package & default.nix

build the postgres VM with

nix-build -A sanghaPostgresTemplate containers/default.nix
parent 57341398
let
nixpkgs = import <nixpkgs> {};
pkgs = {
sangha = nixpkgs.callPackage ../packages/sangha {};
};
eval = import <nixpkgs/nixos> {
configuration = { ... }: {
imports = [ ./postgres.nix ];
config = {
org.techcultivation.deploy.database.enable = true;
_module.args.pkgs = pkgs;
};
};
};
sanghaPostgresTemplate = eval.config.test;
in {
inherit sanghaPostgresTemplate pkgs;
}
......@@ -11,12 +11,8 @@ let
SslMode = "disable";
};
# sanghaSrc = pkgs.fetchgit {
# url = https://gitlab.techcultivation.org/sangha/sangha.git;
# rev = "ac81d99248ed487395a68820ed9ceaf2e73746b8";
# sha256 = "1n1fgsg2afklwk0hkssjgkncwdwrls8dyfl6llv2ngghq74n1i8z";
# };
sanghaSrc = /home/philip/go/src/gitlab.techcultivation.org/sangha/sangha;
sangha = pkgs.sangha;
# sanghaSrc = /home/philip/go/src/gitlab.techcultivation.org/sangha/sangha;
sanghaDatabaseInit = with postgresConnectionData;
pkgs.writeText "sangha-create-db.sql" ''
CREATE DATABASE ${DbName};
......@@ -43,14 +39,14 @@ let
jq '.Connections.PostgreSQLConnection *= ${
lib.generators.toJSON {} postgresConnectionData
}' \
${sanghaSrc}/config.example.json \
${sangha.src}/config.example.json \
> ./config.json
# init database tables
${sanghaSrc}/sangha database init
${lib.getBin sangha}/bin/sangha database init
# insert mock data
psql --file=${sanghaSrc}/mocks/projects.sql --username=postgres sangha
psql --file=${sangha.src}/mocks/projects.sql --username=postgres sangha
pg_ctl stop -w
'';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment