-
Notifications
You must be signed in to change notification settings - Fork 17
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
f134486
commit 163d988
Showing
7 changed files
with
231 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,13 @@ | ||
name: "Format" | ||
on: | ||
pull_request: | ||
jobs: | ||
clippy: | ||
runs-on: ubuntu-latest | ||
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,13 @@ | ||
name: "Test" | ||
on: | ||
pull_request: | ||
jobs: | ||
tests: | ||
runs-on: ubuntu-latest | ||
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" |
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=debug 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