Browse Source

move majsite to its own crate, crate2nix

majc-history
Cadey Ratio 6 months ago
parent
commit
f48e46bcc7
7 changed files with 4528 additions and 3 deletions
  1. +1
    -0
      .gitignore
  2. +4471
    -0
      Cargo.nix
  3. +5
    -2
      Cargo.toml
  4. +13
    -0
      default.nix
  5. +16
    -0
      site/Cargo.toml
  6. +21
    -0
      site/src/index.gmi
  7. +1
    -1
      site/src/main.rs

+ 1
- 0
.gitignore View File

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

+ 4471
- 0
Cargo.nix
File diff suppressed because it is too large
View File


+ 5
- 2
Cargo.toml View File

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

+ 13
- 0
default.nix 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
- 0
site/Cargo.toml View File

@ -0,0 +1,16 @@
[package]
name = "majsite"
version = "0.1.0"
authors = ["Christine Dodrill <[email protected]>"]
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
- 0
site/src/index.gmi 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

src/bin/majsite.rs → site/src/main.rs View File

@ -54,7 +54,7 @@ async fn main() -> Result<(), maj::server::Error> {
struct Handler {}
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 {
status: maj::StatusCode::Success,

Loading…
Cancel
Save