-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
238 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: "CI" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
check: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: nix flake check --all-systems | ||
- run: nix develop -c cargo doc --workspace --all-features --no-deps --document-private-items | ||
- run: nix develop -c cargo test --workspace --all-features | ||
|
||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: nix develop -c cargo clippy --fix --no-deps | ||
- uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: "chore: lint" | ||
default_author: github_actions | ||
|
||
fmt: | ||
needs: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: Swatinem/rust-cache@v2 | ||
- run: nix develop -c cargo fmt --all | ||
- uses: EndBug/add-and-commit@v9 | ||
with: | ||
message: "chore: format" | ||
default_author: github_actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
target | ||
result |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "dwn" | ||
version = "0.0.0" | ||
license = "GPL-3.0-or-later" | ||
edition = "2021" | ||
|
||
[profile.release] | ||
lto = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
# dwn | ||
# dwn | ||
|
||
[![Crates.io](https://img.shields.io/crates/v/dwn.svg)](https://crates.io/crates/dwn) | ||
[![CI](https://github.com/unavi-xyz/dwn/actions/workflows/ci.yml/badge.svg)](https://github.com/unavi-xyz/dwn/actions/workflows/ci.yml) | ||
![Crates.io](https://img.shields.io/crates/l/dwn) | ||
[![Documentation](https://docs.rs/dwn/badge.svg)](https://docs.rs/dwn) | ||
|
||
Rust implementation of a [Decentralized Web Node](https://identity.foundation/decentralized-web-node/spec/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ lib, pkgs, system, build_inputs, native_build_inputs, makeRustPlatform }: | ||
let | ||
rustBin = pkgs.rust-bin.stable.latest.default; | ||
|
||
rustPlatform = makeRustPlatform { | ||
cargo = rustBin; | ||
rustc = rustBin; | ||
}; | ||
|
||
common = { | ||
version = "0.0.0"; | ||
src = ./.; | ||
cargoLock.lockFile = ./Cargo.lock; | ||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; | ||
|
||
buildInputs = build_inputs; | ||
nativeBuildInputs = native_build_inputs; | ||
|
||
LD_LIBRARY_PATH = lib.makeLibraryPath build_inputs; | ||
}; | ||
in { bin = rustPlatform.buildRustPackage (common // { pname = "dwn"; }); } |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
inputs = { | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
|
||
rust-overlay = { | ||
url = "github:oxalica/rust-overlay"; | ||
inputs = { | ||
flake-utils.follows = "flake-utils"; | ||
nixpkgs.follows = "nixpkgs"; | ||
}; | ||
}; | ||
}; | ||
|
||
outputs = { self, flake-utils, nixpkgs, rust-overlay, ... }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
overlays = [ (import rust-overlay) ]; | ||
pkgs = import nixpkgs { inherit system overlays; }; | ||
|
||
rustBin = pkgs.rust-bin.stable.latest.default; | ||
|
||
build_inputs = with pkgs; [ ]; | ||
|
||
native_build_inputs = with pkgs; [ cargo-auditable pkg-config ]; | ||
|
||
code = pkgs.callPackage ./. { | ||
inherit pkgs system build_inputs native_build_inputs; | ||
}; | ||
in rec { | ||
packages = code // { | ||
all = pkgs.symlinkJoin { | ||
name = "all"; | ||
paths = with code; [ bin ]; | ||
}; | ||
|
||
default = packages.all; | ||
override = packages.all; | ||
overrideDerivation = packages.all; | ||
}; | ||
|
||
devShells.default = pkgs.mkShell { | ||
buildInputs = with pkgs; | ||
[ cargo-watch rust-analyzer rustBin ] ++ build_inputs; | ||
nativeBuildInputs = native_build_inputs; | ||
|
||
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath build_inputs; | ||
}; | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("Hello, world!"); | ||
} |