Support darwin

This commit is contained in:
Silas Brack 2026-03-08 10:22:09 +01:00
parent c4c8fdd735
commit 443af952f4
2 changed files with 62 additions and 23 deletions

View file

@ -2,30 +2,35 @@
description = "mkv";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{ self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in
{
devShells.${system}.default = pkgs.mkShell {
packages = [
pkgs.rustc
pkgs.cargo
pkgs.rustfmt
pkgs.rust-analyzer
{ self, nixpkgs, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
darwinBuildInputs = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [
pkgs.libiconv
];
};
packages.${system}.default = pkgs.rustPlatform.buildRustPackage {
pname = "mkv";
version = "0.1.0";
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.cleanSource ./.;
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.openssl ];
doCheck = false;
};
};
in
{
devShells.default = pkgs.mkShell {
packages = [
pkgs.rustc
pkgs.cargo
pkgs.rustfmt
pkgs.rust-analyzer
];
};
packages.default = pkgs.rustPlatform.buildRustPackage {
pname = "mkv";
version = "0.1.0";
cargoLock.lockFile = ./Cargo.lock;
src = pkgs.lib.cleanSource ./.;
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.openssl ] ++ darwinBuildInputs;
doCheck = false;
};
}
);
}