2021-09-22 19:15:57 +02:00
|
|
|
{
|
2021-09-22 21:19:47 +02:00
|
|
|
description = "A calculator program/website";
|
2021-09-22 19:15:57 +02:00
|
|
|
|
|
|
|
outputs = { self, nixpkgs }:
|
|
|
|
let
|
2021-09-22 21:19:47 +02:00
|
|
|
systems =
|
|
|
|
[ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
|
2021-09-22 19:15:57 +02:00
|
|
|
|
|
|
|
forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system);
|
|
|
|
|
|
|
|
nixpkgsFor = forAllSystems (system:
|
|
|
|
import nixpkgs {
|
|
|
|
inherit system;
|
|
|
|
overlays = [ self.overlay ];
|
|
|
|
});
|
|
|
|
in {
|
|
|
|
overlay = final: prev: {
|
|
|
|
kalker = final.rustPlatform.buildRustPackage {
|
|
|
|
pname = "kalker";
|
|
|
|
version = "unstable";
|
|
|
|
|
|
|
|
src = self;
|
|
|
|
|
2021-09-22 21:19:47 +02:00
|
|
|
nativeBuildInputs = with final; [ gcc ];
|
2021-09-22 19:15:57 +02:00
|
|
|
|
|
|
|
outputs = [ "out" "lib" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
moveToOutput "lib" "$lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
cargoLock = { lockFile = self + "/Cargo.lock"; };
|
|
|
|
|
2021-09-22 21:19:47 +02:00
|
|
|
buildInputs = with final; [ gmp mpfr libmpc ];
|
|
|
|
|
|
|
|
CARGO_FEATURE_USE_SYSTEM_LIBS = "1";
|
|
|
|
};
|
2021-09-22 19:15:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
packages = forAllSystems (system: nixpkgsFor.${system});
|
|
|
|
|
|
|
|
defaultPackage = forAllSystems (system: self.packages.${system}.kalker);
|
2021-09-22 21:22:21 +02:00
|
|
|
|
|
|
|
apps = forAllSystems (system: {
|
|
|
|
kalker = {
|
|
|
|
type = "app";
|
|
|
|
program = "${self.packages.${system}.kalker}/bin/kalker";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
defaultApp = forAllSystems (system: self.apps.${system}.kalker);
|
2021-09-22 19:15:57 +02:00
|
|
|
};
|
|
|
|
}
|