From 659f56ffea5b675e87d8a3be303ebc621592270d Mon Sep 17 00:00:00 2001 From: Sebastian Moser Date: Sun, 1 Dec 2024 11:03:07 +0100 Subject: [PATCH] some more packaging stuff --- lib.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib.nix b/lib.nix index 7bcdd17..272b23b 100644 --- a/lib.nix +++ b/lib.nix @@ -53,15 +53,17 @@ rec { ''; }; + + + mize_module_path = builtins.getEnv "MIZE_MODULE_PATH"; + dirs_from_path = pkgs.lib.lists.remove "" (pkgs.lib.strings.splitString ":" mize_module_path); + dirs_in_nix_store = map (path: builtins.fetchGit { + url = path; + }) dirs_from_path; + from_env_var = map findModules dirs_in_nix_store; mizeMdules = let from_mize_modules_repo = findModules mize_modules; - mize_module_path = builtins.getEnv "MIZE_MODULE_PATH"; mize_module_no_repo = builtins.getEnv "MIZE_MODULE_NO_REPO"; - dirs_from_path = pkgs.lib.lists.remove "" (pkgs.lib.strings.splitString ":" mize_module_path); - dirs_in_nix_store = map (path: builtins.fetchGit { - url = path; - }) dirs_from_path; - from_env_var = map findModules dirs_in_nix_store; in pkgs.lib.lists.flatten (from_env_var ++ (if mize_module_no_repo != "" then [] else from_mize_modules_repo)); @@ -232,6 +234,7 @@ rec { main-default = craneLib.buildPackage ({ src = "${self}"; cargoExtraArgs = "--bin mize --features os-target"; + # CARGO_PROFILE = "dev"; does not work... strictDeps = true; nativeBuildInputs = [ @@ -397,6 +400,8 @@ rec { in rec { inherit toolchain_version_drv pkgsCross craneLib; + inherit mize_module_path dirs_from_path dirs_in_nix_store from_env_var; + devShell = mainDevShell; main =