-
Notifications
You must be signed in to change notification settings - Fork 18
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
1 parent
5442b77
commit 2f26e7a
Showing
8 changed files
with
273 additions
and
0 deletions.
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,19 @@ | ||
name: Format | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: "write" | ||
contents: "read" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: DeterminateSystems/flake-checker-action@main | ||
- name: Run clippy | ||
run: nix develop --command bash -c "just clippy" |
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,19 @@ | ||
name: Test | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
id-token: "write" | ||
contents: "read" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@main | ||
- uses: DeterminateSystems/magic-nix-cache-action@main | ||
- uses: DeterminateSystems/flake-checker-action@main | ||
- name: Run `nix develop test` | ||
run: nix develop --command bash -c "just test" |
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,30 @@ | ||
# Harbor | ||
|
||
## Develop | ||
|
||
1. Install nixos on your machine if you do not have it already: | ||
|
||
``` | ||
curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install | ||
``` | ||
|
||
2. Everything is done in a nix develop shell for now: | ||
|
||
``` | ||
nix develop | ||
``` | ||
|
||
3. Build, test, run, etc. | ||
|
||
|
||
``` | ||
just test | ||
``` | ||
|
||
``` | ||
just run | ||
``` | ||
|
||
``` | ||
just release | ||
``` |
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,67 @@ | ||
{ | ||
description = "Harbor Flake.nix"; | ||
|
||
inputs = { | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
rust-overlay = { | ||
url = "github:oxalica/rust-overlay"; | ||
inputs.nixpkgs.follows = "nixpkgs"; | ||
}; | ||
nixpkgs.url = "nixpkgs/nixos-unstable"; | ||
}; | ||
|
||
outputs = { self, nixpkgs, flake-utils, rust-overlay }: | ||
flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
overlays = [ rust-overlay.overlays.default ]; | ||
pkgs = import nixpkgs { inherit system overlays; }; | ||
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; | ||
inputs = [ | ||
rust | ||
pkgs.rust-analyzer | ||
pkgs.openssl | ||
pkgs.zlib | ||
pkgs.gcc | ||
pkgs.pkg-config | ||
pkgs.just | ||
pkgs.binaryen | ||
pkgs.clang | ||
pkgs.expat | ||
pkgs.llvmPackages.libcxxClang | ||
pkgs.fontconfig | ||
pkgs.freetype | ||
pkgs.freetype.dev | ||
pkgs.libGL | ||
pkgs.pkg-config | ||
pkgs.xorg.libX11 | ||
pkgs.xorg.libXcursor | ||
pkgs.xorg.libXi | ||
pkgs.xorg.libXrandr | ||
] ++ pkgs.lib.optionals pkgs.stdenv.isDarwin [ | ||
pkgs.darwin.apple_sdk.frameworks.AppKit | ||
pkgs.darwin.apple_sdk.frameworks.CoreText | ||
pkgs.darwin.apple_sdk.frameworks.WebKit | ||
]; | ||
in | ||
{ | ||
defaultPackage = pkgs.rustPlatform.buildRustPackage { | ||
src = ./.; | ||
|
||
cargoLock = { | ||
lockFile = ./Cargo.lock; | ||
}; | ||
|
||
nativeBuildInputs = inputs; | ||
}; | ||
|
||
|
||
devShell = pkgs.mkShell { | ||
packages = inputs; | ||
shellHook = '' | ||
export LIBCLANG_PATH=${pkgs.libclang.lib}/lib/ | ||
export LD_LIBRARY_PATH=${pkgs.openssl}/lib:$LD_LIBRARY_PATH | ||
''; | ||
}; | ||
} | ||
); | ||
} |
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,11 @@ | ||
test: | ||
cargo test | ||
|
||
run: | ||
RUST_LOG=harbor=debug,info cargo run | ||
|
||
release: | ||
cargo run --release | ||
|
||
clippy: | ||
cargo clippy --all-features --tests -- -D warnings |
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,4 @@ | ||
[toolchain] | ||
channel = "nightly-2024-05-13" | ||
components = ["rustfmt", "clippy"] | ||
profile = "default" |
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