This commit is contained in:
Sebastian Moser
2026-11-02 21:53:31 +01:00
parent a347145348
commit 72a707299f
39 changed files with 7068 additions and 287 deletions

32
bin/mize Executable file
View File

@@ -0,0 +1,32 @@
#!/bin/bash
# do special stuff if it is run as a daemon by runit.
if [[ -v IS_RUNIT ]]; then
exec 2>$LOG_DIR/mize
exec 1>$LOG_DIR/mize
exec /home/me/work/config/mize/target/debug/mize --config $CONFIG_DIR/hosts/main/mize.toml -o cli.daemonMode --secrets $SECRETS_DIR/mize-secrets.toml run
exit 0
fi
export LD_LIBRARY_PATH=/nix/store/992h4k1s2c0ma186wyc7a3080wrh1cc6-xdotool-4.20260303.1/lib:/nix/store/rsdvlq7wb59hdiwhhvkhx2xvxdkalkzc-webkitgtk-2.52.4+abi=4.1/lib:/nix/store/90ln3xz5m2x3r0ykad4mkg9gnwgrjpzg-pango-1.57.1/lib:/nix/store/l0vl4dali2mvbpi30a8da1f71jl85myg-openssl-3.6.2/lib:/nix/store/s2bjqqzdjs4ji71qm1wwnkiy7g3afdz6-at-spi2-core-2.60.4/lib:/nix/store/fzhjg6xris850npqr92g4m4pskj88brn-atkmm-2.28.5/lib:/nix/store/4zwifnznmqsg3zl8y5yyfafwp4sws6rs-cairo-1.18.4/lib:/nix/store/rgr3i966i5wnblv62fvkid3v3lxy1ivb-gdk-pixbuf-2.44.6/lib:/nix/store/7dl2py4dnp4ffj92r1lq0i54ik1v8kzn-glib-2.88.1/lib:/nix/store/7c73fgj9w0k8qrpq3j1h8h976bk7gqsp-gtk+3-3.24.52/lib:/nix/store/49i3fhgpfffwh3xm3j58ma4z7221sqbq-harfbuzz-13.2.1/lib:/nix/store/na21ka09652cgigpv9wlw904wpq8bnvz-librsvg-2.62.1/lib:/nix/store/jc4y9v7ci45vas65kyl00pzpam3dnbfk-libsoup-3.6.6/lib:/nix/store/3kncz3fkk7sv9xc61x096jnbxvxfnx1k-libxkbcommon-1.13.1/lib:/nix/store/a4h98420m9h8c84r2igrpdd94xsrc9b6-alsa-lib-1.2.15.3/lib:/nix/store/hngmi01i8wgi25a0byrxcn4ysz5j79mw-gcc-15.2.0-lib/lib:/nix/store/xpzd2xmvqpkv1la78qkfpybkfwak27xd-libxcb-1.17.0/lib:/nix/store/6y2b9qs1npwsvcsl9m66hjarzj0yagb4-pipewire-1.6.5/lib:/nix/store/clvzgv5kqq953s4azqhkg3ddgpvgl9wc-wayland-1.25.0/lib:/nix/store/8gyg3xn9i8xdz42yhbl0d3vmmz8phcs0-bzip2-1.0.8/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CONFIG_DIR/mize/target/debug
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/nix/store/k7bh855izql4rli5hh0s5lsphzc0gnc2-rust-mixed/lib/rustlib/x86_64-unknown-linux-gnu/lib/
# get some config values from mize
get_config mize.runBuild DO_BUILD
get_config mize.startDev START_DEV
get_config mize.backtrace DO_BACKTRACE
if [[ "$DO_BACKTRACE" == "true" ]] then
export RUST_BACKTRACE=1
fi
# a special dev mode which runs the current development version of the program right from the src code. (has mode to recompile as well)
if [[ "$START_DEV" == "true" ]] then
source $MIZE_STORE/misc/build-env.sh
[[ "$DO_BUILD" == "true" ]] && cargo build --manifest-path $CONFIG_DIR/mize/Cargo.toml --workspace
[[ "$?" != "0" ]] && [[ "$DO_BUILD" == "true" ]] && echo "build failed" && exit 1
exec $MIZE_SRC/target/debug/mize --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml "$@"
fi
# exec the main program with config file parameters
exec /home/me/mize --config $CONFIG_DIR/hosts/main/mize.toml --secrets $SECRETS_DIR/mize-secrets.toml "$@"