Remove the flake.nix package exports. Start on a Rust builder

This commit is contained in:
Savanni D'Gerinel 2023-08-07 13:18:47 -04:00
parent 52ae75ca5c
commit 38443f4120
2 changed files with 73 additions and 51 deletions

26
builders/rust.sh Executable file
View File

@ -0,0 +1,26 @@
if [[ ! -z "$MODULE" ]]; then
MODULE="-p $MODULE"
fi
case $CMD in
build)
$CARGO build $MODULE $PARAMS
;;
test)
$CARGO test $MODULE $PARAMS
;;
release)
$CARGO build --release $MODULE $PARAMS
;;
clean)
$CARGO clean $MODULE
;;
"")
echo "No command specified. Use build | test | release | clean"
;;
*)
echo "$CMD is unknown. Use build | test | release | clean"
;;
esac

View File

@ -46,56 +46,52 @@
];
LIBCLANG_PATH="${pkgs.llvmPackages.libclang.lib}/lib";
};
packages."x86_64-linux" =
let
pkgs = import nixpkgs { system = "x86_64-linux"; };
standardOverride = attrs: {
nativeBuildInputs = [
pkgs.pkg-config
pkgs.gtk4
];
verbose = true;
};
customBuildInfo = pkgs: pkgs.buildRustCrate.override {
defaultCrateOverrides = pkgs.defaultCrateOverrides // {
cairo-sys-rs = standardOverride;
graphene-sys = standardOverride;
gobject-sys = standardOverride;
pango-sys = standardOverride;
gio-sys = standardOverride;
gdk-pixbuf-sys = standardOverride;
gdk4-sys = standardOverride;
gsk4-sys = standardOverride;
gtk4-sys = standardOverride;
kifu-gtk = attrs: {
nativeBuildInputs = [
pkgs.glib
];
};
};
};
in {
# gobject-sys = pkgs.buildRustCrate cargo.internal.crates.gobject-sys;
# kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix {
# inherit pkgs;
# buildRustCrateForPkgs = customBuildInfo;
# rootFeatures = [ "screenplay" ];
# release = true;
# }).rootCrate.build;
cyberpunk-splash = (import ./cyberpunk-splash/Cargo.nix {
inherit pkgs;
buildRustCrateForPkgs = customBuildInfo;
release = true;
}).rootCrate.build;
dashboard = (import ./dashboard/Cargo.nix {
inherit pkgs;
release = true;
}).rootCrate.build;
};
hydraJobs = {
inherit (self) packages;
};
# packages."x86_64-linux" =
# let
# pkgs = import nixpkgs { system = "x86_64-linux"; };
# standardOverride = attrs: {
# nativeBuildInputs = [
# pkgs.pkg-config
# pkgs.gtk4
# ];
# verbose = true;
# };
# customBuildInfo = pkgs: pkgs.buildRustCrate.override {
# defaultCrateOverrides = pkgs.defaultCrateOverrides // {
# cairo-sys-rs = standardOverride;
# graphene-sys = standardOverride;
# gobject-sys = standardOverride;
# pango-sys = standardOverride;
# gio-sys = standardOverride;
# gdk-pixbuf-sys = standardOverride;
# gdk4-sys = standardOverride;
# gsk4-sys = standardOverride;
# gtk4-sys = standardOverride;
# kifu-gtk = attrs: {
# nativeBuildInputs = [
# pkgs.glib
# ];
# };
# };
# };
# in {
# # gobject-sys = pkgs.buildRustCrate cargo.internal.crates.gobject-sys;
# kifu-gtk = (import ./kifu/kifu-gtk/Cargo.nix {
# inherit pkgs;
# buildRustCrateForPkgs = customBuildInfo;
# rootFeatures = [ "screenplay" ];
# release = true;
# }).rootCrate.build;
# cyberpunk-splash = (import ./cyberpunk-splash/Cargo.nix {
# inherit pkgs;
# buildRustCrateForPkgs = customBuildInfo;
# release = true;
# }).rootCrate.build;
#
# dashboard = (import ./dashboard/Cargo.nix {
# inherit pkgs;
# release = true;
# }).rootCrate.build;
# };
};
}