From 105eca862da9d8e54ad68c30d308f7c937861552 Mon Sep 17 00:00:00 2001 From: Sebastian Moser Date: Wed, 14 Oct 2026 20:13:04 +0200 Subject: [PATCH] changed nixos Module --- flake.nix | 2 +- marts/src/c2vi/part.rs | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/flake.nix b/flake.nix index c6caa17..c75d4a3 100644 --- a/flake.nix +++ b/flake.nix @@ -381,7 +381,7 @@ in { }; serviceConfig = { Restart = "on-failure"; - ExecStart = if config.mize.debugBinary == null then "${self.packages.${system}.mize}/bin/mize daemon" else "${config.mize.debugBinary} daemon"; + ExecStart = if config.mize.debugBinary == null then "${self.packages.${system}.mize}/bin/mize run" else "${config.mize.debugBinary} run"; #After = [ "graphical-session.target" ]; PartOf = [ "graphical-session.target" ]; # this should mean DISPLAY and WAYLAND_DISPLAY are set in the service env... }; diff --git a/marts/src/c2vi/part.rs b/marts/src/c2vi/part.rs index 8729421..e42c069 100644 --- a/marts/src/c2vi/part.rs +++ b/marts/src/c2vi/part.rs @@ -90,6 +90,35 @@ pub fn part_c2vi(mize: &mut Mize) -> MizeResult<()> { Ok(()) } +pub fn new_deploy(mize: Mize, matches: &ArgMatches, hostname: &str) -> MizeResult<()> { + let path = match hostname { + "mac" => "/home/me/here/mize", + _ => "/home/me/here/mize", + }; + let is_release = match hostname { + "mac" => true, + _ => false, + }; + let ld_lib_path = std::env::var("LD_LIBRARY_PATH")?; + if is_release { + sh!(echo cmd: cargo build --manifest-path $SRC/mize/Cargo.toml --bin mize --release)?; + sh!(cargo build --manifest-path $SRC/mize/Cargo.toml --bin mize --release)?; + sh!(echo cmd: patchelf --set-rpath $ld_lib_path $SRC/mize/target/release/mize)?; + let _ = sh!(patchelf --set-rpath $ld_lib_path $SRC/mize/target/release/mize); + sh!(echo cmd: scp $SRC/mize/target/release/mize $hostname:$path)?; + sh!(scp $SRC/mize/target/release/mize $hostname:$path)?; + } else { + sh!(echo cmd: cargo build --manifest-path $SRC/mize/Cargo.toml --bin mize)?; + sh!(cargo build --manifest-path $SRC/mize/Cargo.toml --bin mize)?; + sh!(echo cmd: patchelf --set-rpath $ld_lib_path $SRC/mize/target/debug/mize)?; + let _ = sh!(patchelf --set-rpath $ld_lib_path $SRC/mize/target/debug/mize); + sh!(echo cmd: scp $SRC/mize/target/debug/mize $hostname:$path)?; + sh!(scp $SRC/mize/target/debug/mize $hostname:$path)?; + } + + Ok(()) +} + fn c2vi_deploy_things(mize: &mut Mize) -> MizeResult<()> { let mut cli = mize.get_part_native::("cli")?; cli.set_command("dev"); @@ -102,7 +131,7 @@ fn c2vi_deploy_things(mize: &mut Mize) -> MizeResult<()> { )?; cli.subcommand( Command::new("deploy-mac").alias("dmc").arg(&bin_arg), - Box::new(move |matches: &ArgMatches, mize| remote_deploy(matches, mize, "mac")), + Box::new(move |matches: &ArgMatches, mize| new_deploy(mize, matches, "mac")), )?; cli.subcommand( Command::new("deploy-files").alias("dfi").arg(&bin_arg), @@ -133,12 +162,14 @@ fn c2vi_deploy_things(mize: &mut Mize) -> MizeResult<()> { #[cfg(feature = "desktop")] pub fn launch_c2vi_dashboard(mize: &mut Mize) { + std::env::remove_var("WAYLAND_DISPLAY"); + std::env::set_var("DISPLAY", ":0"); use dioxus::desktop::{muda::Menu, Config, WindowBuilder}; let mize_clone = mize.clone(); LaunchBuilder::new() .with_context_provider(move || Box::new(mize_clone.clone())) .with_cfg(desktop! { - Config::new().with_window(WindowBuilder::new().with_decorations(false).with_title("PPC")) + Config::new().with_window(WindowBuilder::new().with_decorations(false).with_title("SCI display")) }) .launch(c2vi_dash_main); }