-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add flake app and packages for adf-bdd (#155)
* Add flake packages for adf-bdd
- Loading branch information
Showing
4 changed files
with
93 additions
and
60 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "adf-bdd-bin" | ||
version = "0.3.0" | ||
version = "0.3.0-dev" | ||
authors = ["Stefan Ellmauthaler <[email protected]>"] | ||
edition = "2021" | ||
homepage = "https://ellmau.github.io/adf-obdd" | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,89 @@ | ||
{ | ||
description = "basic rust flake"; | ||
rec { | ||
description = "adf-bdd, Abstract Dialectical Frameworks solved by Binary Decision Diagrams; developed in Dresden"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.05"; | ||
nixpkgs-unstable.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
rust-overlay = { | ||
url = "github:oxalica/rust-overlay"; | ||
inputs = { | ||
nixpkgs.follows = "nixpkgs"; | ||
flake-utils.follows = "flake-utils"; | ||
flake-utils.follows = "flake-utils/flake-utils"; | ||
}; | ||
}; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
gitignoresrc = { | ||
url = "github:hercules-ci/gitignore.nix"; | ||
flake = false; | ||
}; | ||
flake-utils.url = "github:gytis-ivaskevicius/flake-utils-plus"; | ||
}; | ||
|
||
outputs = { | ||
outputs = inputs @ { | ||
self, | ||
nixpkgs, | ||
nixpkgs-unstable, | ||
flake-utils, | ||
gitignoresrc, | ||
rust-overlay, | ||
... | ||
} @ inputs: | ||
{ | ||
#overlay = import ./nix { inherit gitignoresrc; }; | ||
} | ||
// (flake-utils.lib.eachDefaultSystem (system: let | ||
unstable = import nixpkgs-unstable {inherit system;}; | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [(import rust-overlay)]; | ||
}; | ||
in rec { | ||
devShell = pkgs.mkShell { | ||
RUST_LOG = "debug"; | ||
RUST_BACKTRACE = 1; | ||
buildInputs = [ | ||
pkgs.rust-bin.stable.latest.rustfmt | ||
pkgs.rust-bin.stable.latest.default | ||
pkgs.rust-analyzer | ||
pkgs.cargo-audit | ||
pkgs.cargo-license | ||
pkgs.cargo-tarpaulin | ||
pkgs.cargo-kcov | ||
pkgs.valgrind | ||
pkgs.gnuplot | ||
pkgs.kcov | ||
]; | ||
}: | ||
flake-utils.lib.mkFlake { | ||
inherit self inputs; | ||
channels.nixpkgs.overlaysBuilder = channels: [rust-overlay.overlays.default]; | ||
outputsBuilder = channels: let | ||
pkgs = channels.nixpkgs; | ||
toolchain = pkgs.rust-bin.stable.latest.default; | ||
platform = pkgs.makeRustPlatform { | ||
cargo = toolchain; | ||
rustc = toolchain; | ||
}; | ||
in rec { | ||
packages = let | ||
cargoMetaBin = (builtins.fromTOML (builtins.readFile ./bin/Cargo.toml)).package; | ||
cargoMetaLib = (builtins.fromTOML (builtins.readFile ./lib/Cargo.toml)).package; | ||
meta = { | ||
inherit description; | ||
homepage = "https://github.com/ellmau/adf-obdd"; | ||
license = [pkgs.lib.licenses.mit]; | ||
|
||
nativeBuildInputs = with platform; [ | ||
cargoBuildHook | ||
cargoCheckHook | ||
]; | ||
}; | ||
in rec { | ||
adf-bdd = platform.buildRustPackage { | ||
pname = "adf-bdd"; | ||
inherit (cargoMetaBin) version; | ||
inherit meta; | ||
|
||
src = ./.; | ||
cargoLock.lockFile = ./Cargo.lock; | ||
|
||
buildAndTestSubdir = "bin"; | ||
}; | ||
adf_bdd = platform.buildRustPackage { | ||
pname = "adf_bdd"; | ||
inherit (cargoMetaLib) version; | ||
inherit meta; | ||
|
||
src = ./.; | ||
cargoLock.lockFile = ./Cargo.lock; | ||
|
||
buildAndTestSubdir = "lib"; | ||
}; | ||
}; | ||
devShells.default = pkgs.mkShell { | ||
RUST_LOG = "debug"; | ||
RUST_BACKTRACE = 1; | ||
shellHook = '' | ||
export PATH=''${HOME}/.cargo/bin''${PATH+:''${PATH}} | ||
''; | ||
buildInputs = let | ||
notOn = systems: | ||
pkgs.lib.optionals (!builtins.elem pkgs.system systems); | ||
in | ||
[ | ||
toolchain | ||
pkgs.rust-analyzer | ||
pkgs.cargo-audit | ||
pkgs.cargo-license | ||
] | ||
++ (notOn ["aarch64-darwin" "x86_64-darwin"] [pkgs.kcov pkgs.cargo-kcov pkgs.gnuplot pkgs.valgrind]) | ||
++ (notOn ["aarch64-linux" "aarch64-darwin" "i686-linux"] [pkgs.cargo-tarpaulin]); | ||
}; | ||
}; | ||
})); | ||
}; | ||
} |