Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: added a nix flake #197

Draft
wants to merge 17 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
SHELL := /bin/bash
CURRENT_DB=$(shell /usr/local/openresty/luajit/bin/luajit -e 'print(require("lapis.config").get().postgres.database)')
CURRENT_ENVIRONMENT=$(shell /usr/local/openresty/luajit/bin/luajit -e 'print(require("lapis.config").get()._name)')
SHELL := /bin/sh
CURRENT_DB=$(shell luajit -e 'print(require("lapis.config").get().postgres.database)')
CURRENT_ENVIRONMENT=$(shell luajit -e 'print(require("lapis.config").get()._name)')

.PHONY: test test_db lint schema routes vendor_js

test:
busted

install_deps::
luarocks build --only-deps --lua-version=5.1 --local
luarocks build --only-deps --lua-version=5.1 --tree ./.luarocks

pin_deps::
luarocks build --only-deps --lua-version=5.1 --local --pin
Expand Down Expand Up @@ -66,3 +66,5 @@ annotate_models:
zipserver-dev::
zipserver -config configs/zipserver-dev.json

nix-update:
nix run 'nixpkgs#luarocks-packages-updater' -- -i contrib/luarocks-packages.csv -o contrib/generated-packages.nix
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Install the following dependencies:
* [CoffeeScript](https://coffeescript.org/#installation)
* [Discount](https://www.pell.portland.or.us/~orc/Code/discount/) (or something that provides `markdown` executable)
* PostgreSQL
* nginx
* [OpenResty][1]
* Redis

Expand Down
2 changes: 2 additions & 0 deletions config.moon
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ config { "development", "test", "production", "staging" }, ->
backend: "pgmoon"
user: "postgres"
database: "moonrocks"
-- port: 5432
password: os.getenv("PGPASSWORD")
}

host "localhost"
Expand Down
5 changes: 5 additions & 0 deletions contrib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@


When updating the rockspec, one can run:
from a nixpkgs checkout:
maintainers/scripts/update-luarocks-packages --input-names ~/luarocks-site/contrib/luarocks-packages.csv --out ~/luarocks-site/contrib/generated-packages.nix --debug DEBUG
Loading