This commit is contained in:
Marcin Kulik
2025-05-05 21:36:33 +02:00
parent ee074c44d1
commit 1a673358a7
2 changed files with 54 additions and 45 deletions

View File

@@ -11,8 +11,8 @@
(makeRustPlatform { (makeRustPlatform {
cargo = rust; cargo = rust;
rustc = rust; rustc = rust;
}) }).buildRustPackage
.buildRustPackage { {
pname = packageToml.name; pname = packageToml.name;
inherit (packageToml) version; inherit (packageToml) version;
@@ -25,11 +25,11 @@
cargoLock.lockFile = ./Cargo.lock; cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [rust]; nativeBuildInputs = [ rust ];
buildInputs = lib.optional stdenv.isDarwin [ buildInputs = lib.optional stdenv.isDarwin [
libiconv libiconv
darwin.apple_sdk.frameworks.Foundation darwin.apple_sdk.frameworks.Foundation
]; ];
nativeCheckInputs = [python3]; nativeCheckInputs = [ python3 ];
} }

View File

@@ -7,31 +7,40 @@
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
}; };
outputs = inputs @ { outputs =
inputs@{
flake-parts, flake-parts,
rust-overlay, rust-overlay,
... ...
}: }:
flake-parts.lib.mkFlake {inherit inputs;} { flake-parts.lib.mkFlake { inherit inputs; } {
systems = ["x86_64-linux" "aarch64-linux" "aarch64-darwin" "x86_64-darwin"]; systems = [
perSystem = { "x86_64-linux"
"aarch64-linux"
"aarch64-darwin"
"x86_64-darwin"
];
perSystem =
{
self', self',
pkgs, pkgs,
system, system,
... ...
}: let }:
let
packageToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package; packageToml = (builtins.fromTOML (builtins.readFile ./Cargo.toml)).package;
in { in
{
formatter = pkgs.alejandra; formatter = pkgs.alejandra;
_module.args = { _module.args = {
pkgs = import inputs.nixpkgs { pkgs = import inputs.nixpkgs {
inherit system; inherit system;
overlays = [(import rust-overlay)]; overlays = [ (import rust-overlay) ];
}; };
}; };
devShells = pkgs.callPackages ./shell.nix {inherit pkgs packageToml self';}; devShells = pkgs.callPackages ./shell.nix { inherit pkgs packageToml self'; };
packages.default = pkgs.callPackage ./default.nix { packages.default = pkgs.callPackage ./default.nix {
inherit packageToml; inherit packageToml;