changed nixos Module

This commit is contained in:
Sebastian Moser
2026-10-14 20:13:04 +02:00
parent 0b316ad54f
commit 105eca862d
2 changed files with 34 additions and 3 deletions

View File

@@ -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...
};

View File

@@ -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::<CliPart>("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);
}