adding default.nix for better installation on linux systems having nix package manager

This commit is contained in:
Ahmed Ashraf 2026-05-06 06:24:45 +03:00
parent 46ca844a93
commit 1253db2d1f
1 changed files with 27 additions and 0 deletions

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 "$@"
''