From 4f01edb9230f58ff84b0dd892c931ec8ac9aad55 Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Tue, 13 Sep 2022 12:56:08 +0200 Subject: move src out of srv, clean up default.nix and Makefile --- srv/default.nix | 59 --------------------------------------------------------- 1 file changed, 59 deletions(-) delete mode 100644 srv/default.nix (limited to 'srv/default.nix') 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) - ''; - }; -} -- cgit v1.2.3