From 9cda37ce536f326eabc31d3aea1ff14ed4060777 Mon Sep 17 00:00:00 2001 From: Finn Behrens Date: Wed, 22 Sep 2021 21:19:47 +0200 Subject: [PATCH 1/2] fix aarch64-darwin flake Signed-off-by: Finn Behrens --- flake.nix | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/flake.nix b/flake.nix index 58b60c2..0c8cc36 100644 --- a/flake.nix +++ b/flake.nix @@ -1,14 +1,10 @@ { - description = "A very basic flake"; + description = "A calculator program/website"; outputs = { self, nixpkgs }: let - systems = [ - "x86_64-linux" - "aarch64-linux" - "x86_64-darwin" - #"aarch64-darwin" # currently not building due to gmp - ]; + systems = + [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); @@ -25,7 +21,7 @@ src = self; - nativeBuildInputs = with final; [ m4 ]; + nativeBuildInputs = with final; [ gcc ]; outputs = [ "out" "lib" ]; @@ -35,21 +31,14 @@ cargoLock = { lockFile = self + "/Cargo.lock"; }; - } - # FIXME: fix aarch64-darwin builds - /* // (if (final.stdenv.isDarwin && final.stdenv.isAarch64) then { - CARGO_FEATURE_USE_SYSTEM_LIBS = "1"; - RUST_BACKTRACE = "1"; - buildInputs = with final; [ gmp mpfr libmpc ]; - } else - { }) - */ - ; + buildInputs = with final; [ gmp mpfr libmpc ]; + + CARGO_FEATURE_USE_SYSTEM_LIBS = "1"; + }; }; packages = forAllSystems (system: nixpkgsFor.${system}); defaultPackage = forAllSystems (system: self.packages.${system}.kalker); - }; } From 03bc223b644ea39711542dfdecb5894688081e90 Mon Sep 17 00:00:00 2001 From: Finn Behrens Date: Wed, 22 Sep 2021 21:22:21 +0200 Subject: [PATCH 2/2] add nix flake app Signed-off-by: Finn Behrens --- flake.nix | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/flake.nix b/flake.nix index 0c8cc36..6180d28 100644 --- a/flake.nix +++ b/flake.nix @@ -40,5 +40,14 @@ packages = forAllSystems (system: nixpkgsFor.${system}); defaultPackage = forAllSystems (system: self.packages.${system}.kalker); + + apps = forAllSystems (system: { + kalker = { + type = "app"; + program = "${self.packages.${system}.kalker}/bin/kalker"; + }; + }); + + defaultApp = forAllSystems (system: self.apps.${system}.kalker); }; }