Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nix and Flakes support #14

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .bestool.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{ lib
, pkgs ? import <nixpkgs>
, rustPlatform
,
}:
rustPlatform.buildRustPackage {
name = "bestool";

src = lib.cleanSource ./bestool;

cargoLock = {
lockFile = ./bestool/Cargo.lock;
allowBuiltinFetchGit = true;
};

nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ systemd.dev ];

meta = with lib; {
description = "";
homepage = "https://github.com/Ralim/bestool";
license = licenses.mit;
};
}
27 changes: 27 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# SPDX-FileCopyrightText: 2023 The Gamebox Developers
#
# SPDX-License-Identifier: Apache-2.0

version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore(deps)"
groups:
cargo-deps:
patterns:
- "*"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
commit-message:
prefix: "chore(ci-deps)"
groups:
gh-actions-deps:
patterns:
- "*"
51 changes: 51 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Tests & Build
on: [push, pull_request]

jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt-get update && sudo apt-get install -y libudev-dev
- run: cargo test
working-directory: bestool
audit:
name: cargo audits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- run: sudo apt-get update && sudo apt-get install -y libudev-dev
- run: cargo install cargo-audit
working-directory: bestool
- run: cargo clippy -- -D warnings --no-deps
working-directory: bestool
# Ignoring mach being unmaintained for now as limited options + its only for MacOS
- run: cargo audit -D unsound -D yanked -D unmaintained --ignore "RUSTSEC-2020-0168"
working-directory: bestool
vet:
name: cargo vet
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy,rustfmt
- run: sudo apt-get update && sudo apt-get install -y libudev-dev
- run: cargo install --locked cargo-vet --version "0.9.0"
working-directory: bestool
- run: cargo vet --locked
working-directory: bestool
build:
name: cargo build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: sudo apt-get update && sudo apt-get install -y libudev-dev
- run: cargo build
working-directory: bestool
Loading