move majsite to its own crate, crate2nix
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Cadey Ratio 2020-07-25 21:11:00 -04:00
parent 5583977151
commit f48e46bcc7
7 changed files with 4528 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
/target /target
Cargo.lock Cargo.lock
result*

4471
Cargo.nix Normal file

File diff suppressed because it is too large Load Diff

View File

@ -19,10 +19,12 @@ log = "0.4"
url = "2" url = "2"
thiserror = "1" thiserror = "1"
structopt = "0.3" structopt = "0.3"
[dev-dependencies]
pretty_env_logger = "0.4" pretty_env_logger = "0.4"
[dependencies.tokio] [dependencies.tokio]
version = "0.2.0" version = "0.2"
features = [ features = [
"macros", "macros",
"net", "net",
@ -42,5 +44,6 @@ server = ["rustls", "webpki", "webpki-roots", "tokio", "async-trait", "tokio-rus
[workspace] [workspace]
members = [ members = [
"./majc" "./majc",
"./site"
] ]

13
default.nix Normal file
View File

@ -0,0 +1,13 @@
{ pkgs ? import <nixpkgs> { } }:
let
cargo_nix = pkgs.callPackage ./Cargo.nix {
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
ncurses = attrs: { buildInputs = with pkgs; [ ncurses pkg-config ]; };
};
};
in {
majc = cargo_nix.workspaceMembers."majc".build;
majsite = cargo_nix.workspaceMembers."majsite".build;
}

16
site/Cargo.toml Normal file
View File

@ -0,0 +1,16 @@
[package]
name = "majsite"
version = "0.1.0"
authors = ["Christine Dodrill <me@christine.website>"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
structopt = "0.3"
tokio = { version = "0.2", features = ["full"] }
tokio-rustls = { version = "0.14", features = ["dangerous_configuration"] }
async-trait = "0"
pretty_env_logger = "0.4"
maj = { path = ".." }

21
site/src/index.gmi Normal file
View File

@ -0,0 +1,21 @@
# maj
```
__
_____ _____ |__|
/ \ \__ \ | |
| Y Y \ / __ \_ | |
|__|_| /(____ //\__| |
\/ \/ \______|
```
A gemini ecosystem for Rust
=> gemini://gemini.circumlunar.space/ Gemini homepage
## Homepage
The main homepage for maj is on tulpa.dev:
=> https://tulpa.dev/cadey/maj
## Projects
=> /majc majc, an interactive curses client
=> /majd majd, a high-power gemini server with Lua capabilities

View File

@ -54,7 +54,7 @@ async fn main() -> Result<(), maj::server::Error> {
struct Handler {} struct Handler {}
fn index() -> Result<maj::Response, maj::server::Error> { fn index() -> Result<maj::Response, maj::server::Error> {
let msg = include_bytes!("../../majc/src/help.gmi"); let msg = include_bytes!("index.gmi");
Ok(maj::Response { Ok(maj::Response {
status: maj::StatusCode::Success, status: maj::StatusCode::Success,