Personal Nix setup
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Clean up wezterm config

+2 -100
+2 -2
config/home/wezterm/default.nix
··· 2 2 3 3 let 4 4 colors = (import ../../colors.nix); 5 - wezmux = (pkgs.writeScriptBin "wezmux" (builtins.readFile ../../scripts/wezmux.sh)); 6 5 in { 7 - home.packages = [ pkgs.wezterm wezmux ]; 6 + home.packages = [ pkgs.wezterm ]; 7 + 8 8 xdg.configFile."wezterm/wezterm.lua".text = '' 9 9 local zsh_bin = "${pkgs.zsh}/bin/zsh"; 10 10 local colors = ${colors.lua};
-88
config/scripts/wezmux.sh
··· 1 - #!/usr/bin/env bash -e 2 - 3 - set -m 4 - 5 - self=$(readlink -f $0) 6 - cmd="$1" 7 - target="$2" 8 - base_path="$HOME/.local/share/wezterm/sessions" 9 - 10 - if [ "$cmd" == "_spawn" ]; then 11 - cd / 12 - mkdir -p "$target" 13 - cd $target 14 - 15 - echo "$$" > "$target/pid" 16 - exec > "$target/daemon.log" 17 - exec 2> "$target/daemon.log" 18 - exec 0< /dev/null 19 - umask 022 20 - 21 - function cleanup() { 22 - echo "Exiting..." >> "$target/daemon.log" 23 - kill -9 $child_pid || echo "Subprocess not found." 24 - if [ -f "$target/pid" ]; then rm "$target/pid"; fi 25 - if [ -S "$target/sock" ]; then rm -rf "$target/sock"; fi 26 - exit 27 - } 28 - 29 - echo "Starting..." >> "$target/daemon.log" 30 - trap cleanup EXIT 31 - trap cleanup SIGTERM 32 - trap cleanup CHLD 33 - 34 - env -i HOME=$HOME PATH=$PATH \ 35 - $(which wezterm-mux-server) --cwd "$HOME" --config "unix_domains={{name=\"$name\",socket_path=\"$target/sock\",connect_automatically=true}}" \ 36 - &> "$target/daemon.log" & 37 - child_pid="$!" 38 - wait 39 - exit 40 - fi 41 - 42 - function load_sessions() { 43 - sessions=$(find "$base_path" -name "sock" -depth 2 -exec dirname "{}" \; | xargs basename -a | sort -u) 44 - } 45 - 46 - case "$cmd" in 47 - attach | new) 48 - if [ ! -f "$base_path/$target/pid" ]; then 49 - shift; nohup $self _spawn "$base_path/$target" &> /dev/null & disown; 50 - sleep 0.5 51 - fi 52 - 53 - if [ -n "$WEZTERM_EXECUTABLE" ] && [ `uname` == "Darwin" ]; then 54 - open -a $WEZTERM_EXECUTABLE -n --args --config "unix_domains={{name=\"$target\",socket_path=\"$base_path/$target/sock\",no_serve_automatically=true}}" connect "$target" 55 - elif [ -n "$WEZTERM_EXECUTABLE" ]; then 56 - $WEZTERM_EXECUTABLE --config "unix_domains={{name=\"$target\",socket_path=\"$base_path/$target/sock\",no_serve_automatically=true}}" connect "$target" 57 - else 58 - echo "Session started: $target" 59 - fi 60 - ;; 61 - end | close) 62 - if [ -f "$base_path/$target/pid" ]; then 63 - kill -SIGTERM $(cat $base_path/$target/pid) 64 - echo "Session ended: $target" 65 - else 66 - echo "Unknown session: $target" 67 - fi 68 - ;; 69 - kill) 70 - load_sessions 71 - for session in $sessions; do 72 - kill -SIGTERM $(cat $base_path/$session/pid) 73 - echo "Session ended: $session" 74 - done 75 - ;; 76 - list | ls) 77 - load_sessions 78 - echo $sessions 79 - ;; 80 - *) 81 - echo "wezmux [subcommand]: Manages Wezterm daemon sessions." 82 - echo " attach | new [name]: Create a new session or attach to an existing one." 83 - echo " end | close [name]: Terminate an existing session." 84 - echo " kill: Terminate all open session." 85 - echo " list | ls: List all open sessions." 86 - ;; 87 - esac 88 - exit
-7
config/term.nix
··· 1 - { pkgs, ... }: 2 - 3 - { 4 - environment.systemPackages = [ 5 - pkgs.wezterm 6 - ]; 7 - }
-2
modules/darwin.nix
··· 4 4 system.stateVersion = 3; 5 5 # Disable path verification of $NIX_PATH 6 6 system.checks.verifyNixPath = false; 7 - # Create /etc/bashrc that loads the nix-darwin environment. 8 - programs.bash.enable = true; 9 7 # Auto upgrade nix package and the daemon service. 10 8 services.nix-daemon.enable = true; 11 9 # Auto-configure build users
-1
profiles/common.nix
··· 14 14 ../config/nodejs.nix 15 15 ../config/gpg.nix 16 16 ../config/fonts.nix 17 - ../config/term.nix 18 17 ../config/postgres.nix 19 18 ../config/mysql.nix 20 19