mirror of
https://github.com/anotherhadi/nixy.git
synced 2026-04-02 11:12:09 +02:00
update laptop configuration
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# Import all shell configurations
|
||||
{
|
||||
imports =
|
||||
[ ./fzf.nix ./zsh.nix ./starship.nix ./zoxide.nix ./tmux.nix ./eza.nix ];
|
||||
imports = [./fzf.nix ./zsh.nix ./starship.nix ./zoxide.nix ./eza.nix];
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# Fzf is a general-purpose command-line fuzzy finder.
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
accent = "#" + config.lib.stylix.colors.base0D;
|
||||
foreground = "#" + config.lib.stylix.colors.base05;
|
||||
muted = "#" + config.lib.stylix.colors.base03;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
# starship is a minimal, fast, and extremely customizable prompt for any shell!
|
||||
{ config, lib, ... }:
|
||||
let
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: let
|
||||
accent = "#${config.lib.stylix.colors.base0D}";
|
||||
background-alt = "#${config.lib.stylix.colors.base01}";
|
||||
in {
|
||||
@@ -17,7 +20,7 @@ in {
|
||||
"$git_status"
|
||||
"$character"
|
||||
];
|
||||
directory = { style = accent; };
|
||||
directory = {style = accent;};
|
||||
|
||||
character = {
|
||||
success_symbol = "[❯](${accent})";
|
||||
@@ -38,8 +41,7 @@ in {
|
||||
};
|
||||
|
||||
git_status = {
|
||||
format =
|
||||
"[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)";
|
||||
format = "[[(*$conflicted$untracked$modified$staged$renamed$deleted)](218)($ahead_behind$stashed)]($style)";
|
||||
style = "cyan";
|
||||
conflicted = "";
|
||||
renamed = "";
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
# Tmux is a terminal multiplexer that allows you to run multiple terminal sessions in a single window.
|
||||
{ pkgs, ... }:
|
||||
let
|
||||
Config = pkgs.writeShellScriptBin "Config" ''
|
||||
SESSION="Nixy Config"
|
||||
|
||||
tmux has-session -t "$SESSION" 2>/dev/null
|
||||
|
||||
if [ $? == 0 ]; then
|
||||
tmux attach -t "$SESSION"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
tmux new-session -d -s "$SESSION"
|
||||
tmux send-keys -t "$SESSION" "sleep 0.2 && clear && cd ~/.config/nixos/ && vim" C-m
|
||||
|
||||
tmux new-window -t "$SESSION" -n "nixy"
|
||||
tmux send-keys -t "$SESSION":1 "sleep 0.2 && clear && cd ~/.config/nixos/ && nixy loop" C-m
|
||||
|
||||
tmux new-window -t "$SESSION" -n "lazygit"
|
||||
tmux send-keys -t "$SESSION":2 "sleep 0.2 && clear && cd ~/.config/nixos/ && lazygit" C-m
|
||||
|
||||
tmux select-window -t "$SESSION":0
|
||||
tmux select-pane -t 0
|
||||
tmux attach -t "$SESSION"
|
||||
'';
|
||||
in {
|
||||
programs.tmux = {
|
||||
enable = true;
|
||||
mouse = true;
|
||||
shell = "${pkgs.zsh}/bin/zsh";
|
||||
prefix = "C-s";
|
||||
terminal = "kitty";
|
||||
keyMode = "vi";
|
||||
|
||||
extraConfig = ''
|
||||
bind-key h select-pane -L
|
||||
bind-key j select-pane -D
|
||||
bind-key k select-pane -U
|
||||
bind-key l select-pane -R
|
||||
|
||||
set -gq allow-passthrough on
|
||||
bind-key x kill-pane # skip "kill-pane 1? (y/n)" prompt
|
||||
|
||||
bind-key -n C-Tab next-window
|
||||
bind-key -n C-S-Tab previous-window
|
||||
bind-key -n M-Tab new-window
|
||||
'';
|
||||
|
||||
plugins = with pkgs; [
|
||||
tmuxPlugins.vim-tmux-navigator
|
||||
# tmuxPlugins.resurrect
|
||||
tmuxPlugins.sensible
|
||||
tmuxPlugins.tokyo-night-tmux
|
||||
];
|
||||
};
|
||||
home.packages = [ Config ];
|
||||
}
|
||||
@@ -1,11 +1,16 @@
|
||||
# My shell configuration
|
||||
{ pkgs, lib, config, ... }:
|
||||
let fetch = config.theme.fetch; # neofetch, nerdfetch, pfetch
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}: let
|
||||
fetch = config.theme.fetch; # neofetch, nerdfetch, pfetch
|
||||
in {
|
||||
home.packages = with pkgs; [bat ripgrep tldr sesh rmtrash trash-cli];
|
||||
|
||||
home.packages = with pkgs; [ bat ripgrep tldr sesh rmtrash trash-cli ];
|
||||
|
||||
home.sessionPath = [ "$HOME/go/bin" ];
|
||||
# Add go binaries to the PATH
|
||||
home.sessionPath = ["$HOME/go/bin"];
|
||||
|
||||
programs.zsh = {
|
||||
enable = true;
|
||||
@@ -13,7 +18,7 @@ in {
|
||||
autosuggestion.enable = true;
|
||||
syntaxHighlighting = {
|
||||
enable = true;
|
||||
highlighters = [ "main" "brackets" "pattern" "regexp" "root" "line" ];
|
||||
highlighters = ["main" "brackets" "pattern" "regexp" "root" "line"];
|
||||
};
|
||||
historySubstringSearch.enable = true;
|
||||
|
||||
@@ -23,7 +28,7 @@ in {
|
||||
size = 10000;
|
||||
};
|
||||
|
||||
profileExtra = lib.optionalString (config.home.sessionPath != [ ]) ''
|
||||
profileExtra = lib.optionalString (config.home.sessionPath != []) ''
|
||||
export PATH="$PATH''${PATH:+:}${
|
||||
lib.concatStringsSep ":" config.home.sessionPath
|
||||
}"
|
||||
@@ -43,18 +48,15 @@ in {
|
||||
sl = "ls";
|
||||
open = "${pkgs.xdg-utils}/bin/xdg-open";
|
||||
icat = "${pkgs.kitty}/bin/kitty +kitten icat";
|
||||
cat =
|
||||
"bat --theme=base16 --color=always --paging=never --tabs=2 --wrap=never --plain";
|
||||
cat = "bat --theme=base16 --color=always --paging=never --tabs=2 --wrap=never --plain";
|
||||
mkdir = "mkdir -p";
|
||||
rm = "${pkgs.rmtrash}/bin/rmtrash";
|
||||
rmdir = "${pkgs.rmtrash}/bin/rmdirtrash";
|
||||
|
||||
obsidian-no-gpu =
|
||||
"env ELECTRON_OZONE_PLATFORM_HINT=auto obsidian --ozone-platform=x11";
|
||||
obsidian-no-gpu = "env ELECTRON_OZONE_PLATFORM_HINT=auto obsidian --ozone-platform=x11";
|
||||
wireguard-import = "nmcli connection import type wireguard file";
|
||||
|
||||
notes =
|
||||
"nvim ~/nextcloud/notes/index.md --cmd 'cd ~/nextcloud/notes' -c ':lua Snacks.picker.smart()'";
|
||||
notes = "nvim ~/nextcloud/notes/index.md --cmd 'cd ~/nextcloud/notes' -c ':lua Snacks.picker.smart()'";
|
||||
note = "notes";
|
||||
tmp = "nvim /tmp/$(date | sed 's/ //g;s/\\.//g').md";
|
||||
|
||||
@@ -79,17 +81,19 @@ in {
|
||||
gcm = "git commit -m";
|
||||
};
|
||||
|
||||
initContent = # bash
|
||||
initContent =
|
||||
# bash
|
||||
''
|
||||
bindkey -e
|
||||
${if fetch == "neofetch" then
|
||||
pkgs.neofetch + "/bin/neofetch"
|
||||
else if fetch == "nerdfetch" then
|
||||
"nerdfetch"
|
||||
else if fetch == "pfetch" then
|
||||
"echo; ${pkgs.pfetch}/bin/pfetch"
|
||||
else
|
||||
""}
|
||||
${
|
||||
if fetch == "neofetch"
|
||||
then pkgs.neofetch + "/bin/neofetch"
|
||||
else if fetch == "nerdfetch"
|
||||
then "nerdfetch"
|
||||
else if fetch == "pfetch"
|
||||
then "echo; ${pkgs.pfetch}/bin/pfetch"
|
||||
else ""
|
||||
}
|
||||
|
||||
function sesh-sessions() {
|
||||
session=$(sesh list -t -c | fzf --height 70% --reverse)
|
||||
|
||||
Reference in New Issue
Block a user