diff --git a/hosts/goingmerry/configuration.nix b/hosts/goingmerry/configuration.nix index d42031b..cf1f095 100644 --- a/hosts/goingmerry/configuration.nix +++ b/hosts/goingmerry/configuration.nix @@ -222,6 +222,7 @@ wl-clipboard wofi wofi-pass + yubioath-flutter zip zoxide ]; @@ -316,6 +317,7 @@ fprintd.enable = true; blueman.enable = true; onedrive.enable = true; + udev.packages = [ pkgs.yubikey-personalization ]; }; # List services that you want to enable: diff --git a/hosts/goingmerry/home.nix b/hosts/goingmerry/home.nix index 63885a4..36a5777 100644 --- a/hosts/goingmerry/home.nix +++ b/hosts/goingmerry/home.nix @@ -41,12 +41,23 @@ # # configuration. For example, this adds a command 'my-hello' to your # # environment: (pkgs.writeShellScriptBin "mux-sessionizer" '' - session=$(tmuxinator list | tail -n +2 | tr -s '[:space:]' '\n' | fzf) + tmuxinator_sessions=$(tmuxinator list | tail -n +2 | tr -s '[:space:]' '\n' | sed '/^$/d') + running_sessions=$(${pkgs.tmux}/bin/tmux list-sessions -F '#{session_name}' 2>/dev/null) + + session=$(printf '%s\n%s' "$tmuxinator_sessions" "$running_sessions" | sort -u | sed '/^$/d' | fzf) if [ -n "$session" ]; then - tmuxinator start "$session" + if ${pkgs.tmux}/bin/tmux has-session -t "$session" 2>/dev/null; then + if [ -n "$TMUX" ]; then + ${pkgs.tmux}/bin/tmux switch-client -t "$session" + else + ${pkgs.tmux}/bin/tmux attach-session -t "$session" + fi + else + tmuxinator start "$session" + fi else - echo "No session selected" + echo "No session selected" fi '') ]; diff --git a/modules/home-manager/zsh.nix b/modules/home-manager/zsh.nix index 4566f8a..d5c5afe 100644 --- a/modules/home-manager/zsh.nix +++ b/modules/home-manager/zsh.nix @@ -1,4 +1,56 @@ {...}: { + programs.eza.enable = true; + programs.zsh = { + enable = true; + shellAliases = { + ll = "exa --icons -l"; + l = "exa --icons -la"; + ls = "exa --icons"; + update = "sudo nixos-rebuild switch"; + clear = "clear && fastfetch"; + sl = "sl | lolcat"; + cds = "cd \"$HOME/Nextcloud/Obsidian/FH/4. Semester/\""; + mux = "tmuxinator"; + cat = "bat"; + cd = "z"; + }; + initContent = '' + bindkey -s ^f "mux-sessionizer\n" + + fastfetch + eval "$(zoxide init zsh)" + eval "$(direnv hook zsh)" + ''; + + history = { + size = 10000; + append = true; + }; + autosuggestion.enable = true; + syntaxHighlighting.enable = true; + + oh-my-zsh = { + enable = true; + plugins = [ + "aliases" + "bgnotify" + "colored-man-pages" + "colorize" + "command-not-found" + "docker" + "docker-compose" + "gh" + "git" + "git-auto-fetch" + "golang" + "pass" + "safe-paste" + "tmuxinator" + ]; + theme = "custom"; + custom = "$HOME/.config/oh-my-zsh"; + }; + }; home.file.".config/oh-my-zsh/themes/custom.zsh-theme".text = '' # OhMyZsh Strug Theme but with nix-shell support # Yoinked by d-hain @@ -63,56 +115,4 @@ ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE=" -" ZSH_THEME_GIT_PROMPT_BEHIND_REMOTE_COLOR=%{$fg[red]%} ''; - programs.eza.enable = true; - programs.zsh = { - enable = true; - shellAliases = { - ll = "exa --icons -l"; - l = "exa --icons -la"; - ls = "exa --icons"; - update = "sudo nixos-rebuild switch"; - clear = "clear && fastfetch"; - sl = "sl | lolcat"; - cds = "cd \"$HOME/Nextcloud/Obsidian/FH/2. Semester/\""; - mux = "tmuxinator"; - cat = "bat"; - cd = "z"; - }; - initContent = '' - bindkey -s ^f "mux-sessionizer\n" - - fastfetch - eval "$(zoxide init zsh)" - eval "$(direnv hook zsh)" - ''; - - history = { - size = 10000; - append = true; - }; - autosuggestion.enable = true; - syntaxHighlighting.enable = true; - - oh-my-zsh = { - enable = true; - plugins = [ - "aliases" - "bgnotify" - "colored-man-pages" - "colorize" - "command-not-found" - "docker" - "docker-compose" - "gh" - "git" - "git-auto-fetch" - "golang" - "pass" - "safe-paste" - "tmuxinator" - ]; - theme = "custom"; - custom = "$HOME/.config/oh-my-zsh"; - }; - }; }