mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-12-12 17:40:52 +01:00
add nix flake
Signed-off-by: Finn Behrens <me@kloenk.dev>
This commit is contained in:
parent
e8a1451694
commit
965c5428a0
1
.gitignore
vendored
1
.gitignore
vendored
@ -5,3 +5,4 @@ kalk/Cargo.lock
|
||||
cli/Cargo.lock
|
||||
cli/test
|
||||
.vscode/
|
||||
result*
|
||||
|
25
flake.lock
Normal file
25
flake.lock
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1632255010,
|
||||
"narHash": "sha256-p/BYR6qhbCtDpOfw9uMYwjwyhuCVKgiSUpKZaV/63UE=",
|
||||
"owner": "NixOS",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "bfc38d3d0d22c528e8abc46c5dd5f3f50fc4554b",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"id": "nixpkgs",
|
||||
"type": "indirect"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"inputs": {
|
||||
"nixpkgs": "nixpkgs"
|
||||
}
|
||||
}
|
||||
},
|
||||
"root": "root",
|
||||
"version": 7
|
||||
}
|
55
flake.nix
Normal file
55
flake.nix
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
description = "A very basic flake";
|
||||
|
||||
outputs = { self, nixpkgs }:
|
||||
let
|
||||
systems = [
|
||||
"x86_64-linux"
|
||||
"aarch64-linux"
|
||||
"x86_64-darwin"
|
||||
#"aarch64-darwin" # currently not building due to gmp
|
||||
];
|
||||
|
||||
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;
|
||||
|
||||
nativeBuildInputs = with final; [ m4 ];
|
||||
|
||||
outputs = [ "out" "lib" ];
|
||||
|
||||
postInstall = ''
|
||||
moveToOutput "lib" "$lib"
|
||||
'';
|
||||
|
||||
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
|
||||
{ })
|
||||
*/
|
||||
;
|
||||
};
|
||||
|
||||
packages = forAllSystems (system: nixpkgsFor.${system});
|
||||
|
||||
defaultPackage = forAllSystems (system: self.packages.${system}.kalker);
|
||||
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user