summaryrefslogtreecommitdiff
path: root/srv/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'srv/default.nix')
-rw-r--r--srv/default.nix59
1 files changed, 0 insertions, 59 deletions
diff --git a/srv/default.nix b/srv/default.nix
deleted file mode 100644
index e6216b3..0000000
--- a/srv/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{
- bash,
- go,
- buildGoModule,
- sqlite,
- writeScript,
- writeText,
- stdenv,
-
- config,
-}: rec {
-
- init = writeText "mediocre-blog-srv-init" ''
-
- export MEDIOCRE_BLOG_DATA_DIR="${config.dataDir}"
-
- # mailing list
- export MEDIOCRE_BLOG_ML_SMTP_ADDR="${config.mlSMTPAddr}"
- export MEDIOCRE_BLOG_ML_SMTP_AUTH="${config.mlSMTPAuth}"
- export MEDIOCRE_BLOG_ML_PUBLIC_URL="${config.publicURL}"
-
- # pow
- export MEDIOCRE_BLOG_POW_SECRET="${config.powSecret}"
-
- # http
- export MEDIOCRE_BLOG_HTTP_PUBLIC_URL="${config.publicURL}"
- export MEDIOCRE_BLOG_HTTP_LISTEN_PROTO="${config.httpListenProto}"
- export MEDIOCRE_BLOG_HTTP_LISTEN_ADDR="${config.httpListenAddr}"
- export MEDIOCRE_BLOG_HTTP_AUTH_USERS='${builtins.toJSON config.httpAuthUsers}'
- export MEDIOCRE_BLOG_HTTP_AUTH_RATELIMIT='${config.httpAuthRatelimit}'
- '';
-
- build = buildGoModule {
- pname = "mediocre-blog-srv";
- version = "dev";
- src = ./src;
- vendorSha256 = "sha256:1vazrrg8rs9n8x40c9r53h9qnyxw59xkp0aq7jl15fliigk6q0cr";
-
- # disable tests
- checkPhase = '''';
- };
-
- bin = writeScript "mediocre-blog-srv-bin" ''
- #!${bash}/bin/bash
- source ${init}
- exec ${build}/bin/mediocre-blog "$@"
- '';
-
- shell = stdenv.mkDerivation {
- name = "mediocre-blog-srv-shell";
- buildInputs = [ go sqlite ];
- shellHook = ''
- source ${init}
-
- echo "Loading test data..."
- (cd srv/src/cmd/load-test-data && go run main.go)
- '';
- };
-}