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";
|
2021-09-24 09:54:06 +02:00
|
|
|
description = "A CLI calculator";
|
2021-09-22 19:15:57 +02:00
|
|
|
|
|
|
|
src = self;
|
|
|
|
|
|
|
|
outputs = [ "out" "lib" ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
moveToOutput "lib" "$lib"
|
|
|
|
'';
|
|
|
|
|
2021-09-23 12:45:25 +02:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = self + "/Cargo.lock";
|
|
|
|
outputHashes = {
|
|
|
|
"gmp-mpfr-sys-1.4.7" =
|
|
|
|
"sha256-zHpGbEgh3MgAUVdlWrXq4Clj1boybi6DMOcsjgZbAh0=";
|
|
|
|
};
|
|
|
|
};
|
2021-09-22 19:15:57 +02:00
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2021-09-23 12:37:08 +02:00
|
|
|
packages =
|
|
|
|
forAllSystems (system: { inherit (nixpkgsFor.${system}) kalker; });
|
2021-09-22 19:15:57 +02:00
|
|
|
|
|
|
|
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-24 09:57:56 +02:00
|
|
|
|
|
|
|
devShell = forAllSystems (system:
|
|
|
|
nixpkgs.legacyPackages.${system}.mkShell {
|
|
|
|
inputsFrom = builtins.attrValues (packages);
|
|
|
|
});
|
2021-09-22 19:15:57 +02:00
|
|
|
};
|
|
|
|
}
|