Adding default.nix for easier installation on Linux systems having nix package manager #2

Merged
jess merged 2 commits from pxlman/Acord:main into main 2026-05-07 07:54:05 +00:00
2 changed files with 33 additions and 0 deletions

View File

@ -57,6 +57,12 @@ cargo install cargo-zigbuild
Or build a single target: `cargo xtask package --target windows-aarch64`.
Or (on linux only) you can use the nix shell:
```bash
cd Acord
nix-shell . --run "acord"
```
---

27
default.nix Normal file
View File

@ -0,0 +1,27 @@
{ pkgs ? import <nixpkgs> {} }:
let
acord = pkgs.rustPlatform.buildRustPackage rec {
pname = "acord";
version = "0.1.0";
src = ./.; # Or fetchFromGitHub
# The hash of the cargo dependencies
cargoHash = "sha256-Tx5dHEnpbs2MmoGKRlXeRhZRWWbDaXYnwjX+oo37s8E=";
cargoBuildFlags = [ "-p" "acord-linux" ];
# Required for consistency if your tests also need the -p flag
cargoCheckFlags = [ "-p" "acord-linux" ];
# Optionally add native build inputs (e.g., pkg-config, cmake)
nativeBuildInputs = with pkgs; [ pkg-config ];
buildInputs = with pkgs; [ openssl ];
};
in
pkgs.writeShellScript "acord" ''
exec ${pkgs.steam-run}/bin/steam-run ${acord}/bin/acord "$@"
''