diff --git a/home-manager/shared/shell/helix/default.nix b/home-manager/shared/shell/helix/default.nix index bba04a9..ade8b3f 100644 --- a/home-manager/shared/shell/helix/default.nix +++ b/home-manager/shared/shell/helix/default.nix @@ -16,24 +16,21 @@ '' #! ~/.nix-profile/bin/zsh is_new() { - new=1; - touch /tmp/rjh; - while IFS="" read -r p || [ -n "$p" ]; do - if [ $(pwd) = $p ]; then - new=0; - fi - done < /tmp/rjh - return $new + new=0; + mkdir -p /tmp/rjh; + if [[ -a "/tmp/rjh/$(pwd | tr \"/\" -).json" ]]; then + new=1 + fi + return $new } - send_to_jupyter() { - is_new && zellij run -f -n "jupyter console" -- direnv exec . jupyter console --kernel="$1" -f="/tmp/rjh-$(pwd | tr \"/\" -).json" --ZMQTerminalInteractiveShell.include_other_output=True --ZMQTerminalInteractiveShell.other_output_prefix=''' && zellij action write 29 25 && zellij action write 17 - pwd >> /tmp/rjh - zellij action write 29 25 - zellij action write 17 - cat | just send - } - send_to_jupyter + is_new && zellij run -f -n "jupyter console" -- direnv exec . jupyter console --kernel="$1" -f="/tmp/rjh/$(pwd | tr \"/\" -).json" --ZMQTerminalInteractiveShell.include_other_output=True --ZMQTerminalInteractiveShell.other_output_prefix=''' && sleep 3 + rm -f /tmp/pipe-rjh + mkfifo /tmp/pipe-rjh + cat > /tmp/pipe-rjh + zellij run -f -n "REPL" -- direnv exec . just send < /tmp/pipe-rjh + rm /tmp/pipe-rjh + ''; in { programs.helix = { diff --git a/justfile b/justfile index 887be5e..958bf2a 100644 --- a/justfile +++ b/justfile @@ -14,6 +14,9 @@ clean: sudo nix-collect-garbage sudo nix-store --optimise +setup: + echo "just test" >> ./.git/hooks/pre-commit && chmod +x ./.git/hooks/pre-commit + push: git add * read -p "Commit message: " -r message && git commit -m "$message" diff --git a/nixos/hosts/wheatley/configuration.nix b/nixos/hosts/wheatley/configuration.nix index 85d937e..4058874 100644 --- a/nixos/hosts/wheatley/configuration.nix +++ b/nixos/hosts/wheatley/configuration.nix @@ -90,7 +90,7 @@ what = "https://gladtherescake.eu/remote.php/dav/files/GLaDTheresCake"; where = "/home/jellyfinmediaplayer/nextcloud"; - options = "uid=1003,gid=100,file_mode=0664,dir_mode=2775"; + options = "uid=1003,gid=990,file_mode=0664,dir_mode=2775"; type = "davfs"; } ];