Updated systemd stuff
This commit is contained in:
parent
045e2ff15c
commit
5d5585cb7f
1 changed files with 11 additions and 3 deletions
14
flake.nix
14
flake.nix
|
|
@ -178,14 +178,22 @@
|
||||||
|
|
||||||
ExecStart = if cfg.useTmux then
|
ExecStart = if cfg.useTmux then
|
||||||
pkgs.writeShellScript "iota-start" ''
|
pkgs.writeShellScript "iota-start" ''
|
||||||
${pkgs.tmux}/bin/tmux -S ${cfg.dataDir}/tmux.sock new-session -d -s iota \
|
${pkgs.tmux}/bin/tmux -S ${cfg.dataDir}/tmux.sock new-session -d -s iota '
|
||||||
'${cfg.package}/bin/iota 2>&1 | ${pkgs.systemd}/bin/systemd-cat -t iota-daemon'
|
${cfg.package}/bin/iota 2>&1 | ${pkgs.coreutils}/bin/tee ${cfg.dataDir}/iota-output.log
|
||||||
|
EXIT_CODE=$?
|
||||||
|
echo ""
|
||||||
|
echo "============================================"
|
||||||
|
echo "Iota exited with code: $EXIT_CODE"
|
||||||
|
echo "Output saved to: ${cfg.dataDir}/iota-output.log"
|
||||||
|
echo "Press ENTER to close this session..."
|
||||||
|
read -r
|
||||||
|
'
|
||||||
while ${pkgs.tmux}/bin/tmux -S ${cfg.dataDir}/tmux.sock has-session -t iota 2>/dev/null; do
|
while ${pkgs.tmux}/bin/tmux -S ${cfg.dataDir}/tmux.sock has-session -t iota 2>/dev/null; do
|
||||||
sleep 2
|
sleep 2
|
||||||
done
|
done
|
||||||
''
|
''
|
||||||
else
|
else
|
||||||
"${pkgs.systemd}/bin/systemd-cat -t iota-daemon ${cfg.package}/bin/iota";
|
"${cfg.package}/bin/iota";
|
||||||
|
|
||||||
ExecStartPre = [
|
ExecStartPre = [
|
||||||
("+" + pkgs.writeShellScript "iota-setup" ''
|
("+" + pkgs.writeShellScript "iota-setup" ''
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue