From c5508826a2c263132bc95523db185b4ddbfba8fb Mon Sep 17 00:00:00 2001 From: Anton Shapka Date: Mon, 22 Dec 2025 23:54:38 +0200 Subject: [PATCH] Update Flake for MacOS --- flake.lock | 6 +++--- flake.nix | 10 ++++++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/flake.lock b/flake.lock index d32529a..6beb162 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1759977445, - "narHash": "sha256-LYr4IDfuihCkFAkSYz5//gT2r1ewcWBYgd5AxPzPLIo=", + "lastModified": 1766314097, + "narHash": "sha256-laJftWbghBehazn/zxVJ8NdENVgjccsWAdAqKXhErrM=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "2dad7af78a183b6c486702c18af8a9544f298377", + "rev": "306ea70f9eb0fb4e040f8540e2deab32ed7e2055", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 5832901..aa4ec6c 100644 --- a/flake.nix +++ b/flake.nix @@ -6,7 +6,7 @@ }; outputs = { self, nixpkgs }: { - packages = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" ] (system: + packages = nixpkgs.lib.genAttrs [ "aarch64-linux" "x86_64-linux" "aarch64-darwin" ] (system: let pkgs = import nixpkgs { inherit system; }; in @@ -16,7 +16,12 @@ version = builtins.head (builtins.match ''.*#define[[:space:]]+F3_STR_VERSION[[:space:]]+"([0-9.]+)".*'' (builtins.readFile (self + "/version.h"))); src = ./.; nativeBuildInputs = [ pkgs.clang ]; - buildInputs = [ pkgs.libusb1 pkgs.parted]; + buildInputs = pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [ + pkgs.systemd + pkgs.parted + ] + ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin [ pkgs.argp-standalone ]; + installPhase = '' runHook preInstall mkdir -p $out/bin @@ -45,6 +50,7 @@ defaultPackage = { x86_64-linux = self.packages.x86_64-linux.f3; aarch64-linux = self.packages.aarch64-linux.f3; + aarch64-darwin = self.packages.aarch64-darwin.f3; }; }; } \ No newline at end of file