diff options
Diffstat (limited to 'home/core')
-rw-r--r-- | home/core/default.nix | 66 | ||||
-rw-r--r-- | home/core/fzf.nix | 6 | ||||
-rw-r--r-- | home/core/git.nix | 32 | ||||
-rw-r--r-- | home/core/keychain.nix | 14 | ||||
-rw-r--r-- | home/core/starship.nix | 23 | ||||
-rw-r--r-- | home/core/tmux.nix | 22 | ||||
-rw-r--r-- | home/core/zsh.nix | 89 |
7 files changed, 252 insertions, 0 deletions
diff --git a/home/core/default.nix b/home/core/default.nix new file mode 100644 index 0000000..575bef0 --- /dev/null +++ b/home/core/default.nix @@ -0,0 +1,66 @@ +{pkgs, ...}: { + imports = [ + ./fzf.nix + ./git.nix + ./keychain.nix + ./starship.nix + ./tmux.nix + ./zsh.nix + ]; + + programs = { + atuin = { + enable = true; + settings = { + enter_accept = false; + }; + flags = [ + "--disable-up-arrow" + ]; + }; + nix-index.enable = true; + zoxide = { + enable = true; + options = [ + "--cmd cd" + ]; + }; + }; + + home.packages = with pkgs; [ + bat + btop + comma + dnsutils + dogdns + dua + duf + exfatprogs + eza + fd + fortune + gocryptfs + htop + inetutils + jnv + jq + iperf + lm_sensors + ncdu + nmap + ntfy-sh + nvd + pwgen + rclone + restic + ripgrep + sshfs + tldr + unzip + unrar + wget + wol + zip + zstd + ]; +} diff --git a/home/core/fzf.nix b/home/core/fzf.nix new file mode 100644 index 0000000..2278cef --- /dev/null +++ b/home/core/fzf.nix @@ -0,0 +1,6 @@ +{ + programs.fzf = { + enable = true; + defaultCommand = "rg --files --no-ignore-vcs --hidden"; + }; +} diff --git a/home/core/git.nix b/home/core/git.nix new file mode 100644 index 0000000..89ed25c --- /dev/null +++ b/home/core/git.nix @@ -0,0 +1,32 @@ +{ + programs.git = { + enable = true; + userName = "Anastasis Grammenos"; + userEmail = "anastasis@learnworlds.com"; + aliases = { + retag = "!f() { git tag -f -a \"$1\" -m \"$1\" && git push origin \"$1\" -f; }; f"; + deltag = "!f() { git tag -d \"$1\" && git push --delete origin \"$1\"; }; f"; + }; + extraConfig = { + init = { + defaultBranch = "main"; + }; + diff = { + colorMoved = "zebra"; + #tool = "nvim -d"; + }; + fetch = { + prune = true; + }; + log = { + date = "iso8601"; + }; + #merge = { + # tool = "nvimdiff"; + #}; + pull = { + rebase = false; + }; + }; + }; +} diff --git a/home/core/keychain.nix b/home/core/keychain.nix new file mode 100644 index 0000000..2dcced1 --- /dev/null +++ b/home/core/keychain.nix @@ -0,0 +1,14 @@ +{ + programs.keychain = { + enable = true; + keys = [ + "github_ed25519" + "id_ed25519" + "id_rsa" + ]; + extraFlags = [ + "--quiet" + "--timeout 120" + ]; + }; +} diff --git a/home/core/starship.nix b/home/core/starship.nix new file mode 100644 index 0000000..8465f54 --- /dev/null +++ b/home/core/starship.nix @@ -0,0 +1,23 @@ +{ + programs.starship = { + enable = true; + + settings = { + directory = { + truncate_to_repo = false; + truncation_symbol = "…"; + }; + + command_timeout = 2000; + + gcloud = { + disabled = true; + }; + + kubernetes = { + disabled = false; + format = "[$symbol$context(/$namespace)]($style) in "; + }; + }; + }; +} diff --git a/home/core/tmux.nix b/home/core/tmux.nix new file mode 100644 index 0000000..6f591b8 --- /dev/null +++ b/home/core/tmux.nix @@ -0,0 +1,22 @@ +{ + programs.tmux = { + enable = true; + keyMode = "vi"; + historyLimit = 5000; + mouse = true; + terminal = "screen-256color"; + extraConfig = '' + set -as terminal-features ",*:RGB" + set-option -g status-style fg=yellow,bg=black + set-window-option -g window-status-style fg=brightblue,bg=default + set-window-option -g window-status-current-style fg=brightred,bg=default + set-option -g pane-border-style fg=black + set-option -g pane-active-border-style fg=brightgreen + set-option -g message-style fg=brightred,bg=black + set-option -g display-panes-active-colour blue + set-option -g display-panes-colour brightred + set-window-option -g clock-mode-colour green + set-window-option -g window-status-bell-style fg=black,bg=red + ''; + }; +} diff --git a/home/core/zsh.nix b/home/core/zsh.nix new file mode 100644 index 0000000..e95ac5c --- /dev/null +++ b/home/core/zsh.nix @@ -0,0 +1,89 @@ +{pkgs, ...}: { + home.sessionVariables = { + ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE = "fg=60"; + NTFY_TOPIC = "generic"; + }; + + programs.zsh = { + enable = true; + autosuggestion.enable = true; + autocd = true; + oh-my-zsh = { + enable = true; + plugins = [ + "docker" + "docker-compose" + "git" + "golang" + "kubectl" + "nmap" + "vi-mode" + ]; + }; + + initContent = '' + # run getnixindexdb first + source ${pkgs.nix-index}/etc/profile.d/command-not-found.sh + + function getnixindexdb { + local _index="index-$(uname -m | sed 's/^arm64$/aarch64/')-$(uname | tr A-Z a-z)" + local _cache=~/.cache/nix-index + local _file=''${_cache}/files + test -d ''${_cache} || mkdir -p ''${_cache} + curl -s -L -R -o ''${_file} -z ''${_file} \ + "https://github.com/Mic92/nix-index-database/releases/latest/download/''${_index}" + } + + function kwide { + kubectl $@ -o wide + } + + function ktail { + local _app=$1; shift + kubectl logs --prefix -f -l app=''${_app} $@ | \ + grep -E -v 'health|metrics' + } + + function weather { + local _city=Cholargos + [[ "$1" ]] && _city="$1" + curl -s "https://wttr.in/''${_city}?format=3" + } + + function rsb { + local _rsb=$HOME/.rsbackup + if [[ -z "$1" ]]; then + echo "available options: $(cd ''${_rsb}; echo *)" + return 2 + fi + cd "''${_rsb}/$1" + } + + echo -e "\n$(fortune -s)" + ''; + + shellAliases = { + ls = "eza --header --git --icons --long"; + l = "ls"; + la = "ls -a"; + cp = "nocorrect cp -i"; + rm = "nocorrect rm -i"; + mv = "nocorrect mv -i"; + df = "df -h"; + dmesg = "sudo dmesg -HTP"; + dpss = "docker ps --format 'table {{.ID}}\t{{.Image}}\t{{.Names}}\t{{.Status}}'"; + du = "du -hsc"; + gti = "git"; + gdet = "git deltag"; + gret = "git retag"; + mkdir = "nocorrect mkdir"; + whatsmyip = "dig -4 +short myip.opendns.com @resolver1.opendns.com"; + whatsmyip-curl = "curl -4 -s https://ifconfig.co"; + kns = "kubens"; + kctx = "kubectx"; + kingtail = "kubectl logs -f -n default daemonsets.apps/nginx-ingress-nginx-controller"; + lwdc = "docker-compose -f docker-compose.yml -f extra/account.yml -f extra/adminer.yml -f extra/website.yml -f extra/marketplace.yml -f extra/cameraman.yml -f extra/pubsub-emulator.yml -f extra/cloner.yml -f extra/lwdemomaker.yml -f extra/iplocate.yml -f extra/mailpit.yml -f docker-compose.override.yml"; + lwdctail = "lwdc logs --no-log-prefix --no-color -f"; + }; + }; +} |