rm dotbot; move everything to home manager

This commit is contained in:
cy 2024-12-15 02:14:00 -05:00
parent cedd2c1983
commit c1b64baea7
39 changed files with 7 additions and 37 deletions

43
home/yt/chunk.nix Normal file
View file

@ -0,0 +1,43 @@
{
config,
pkgs,
lib,
inputs,
outputs,
...
}: {
imports = [
./common.nix
];
home = {
username = "yt";
homeDirectory = "/home/yt";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
systemd.user.startServices = "sd-switch";
programs.git = {
enable = true;
userName = "cy";
userEmail = "hi@cything.io";
delta.enable = true;
};
programs.neovim.enable = true;
home.packages = with pkgs; [
lua-language-server
vim-language-server
python312Packages.python-lsp-server
nixd
gopls
bash-language-server
llvmPackages_19.clang-tools
rust-analyzer
yt-dlp
gnumake
btop
];
}

14
home/yt/common.nix Normal file
View file

@ -0,0 +1,14 @@
{...}: {
imports = [
./tmux.nix
./zsh
];
home.sessionVariables = {
"EDITOR" = "nvim";
};
xdg.configFile = {
nvim.source = ../nvim;
};
}

52
home/yt/foot.nix Normal file
View file

@ -0,0 +1,52 @@
{...}: {
programs.foot = {
enable = true;
settings = {
main = {
font = "RobotoMono Nerd Font:size=8";
dpi-aware = "yes";
};
bell = {
urgent = "no";
notify = "no";
visual = "no";
};
cursor = {
style = "beam";
blink = "yes";
blink-rate = 500;
beam-thickness = 1.5;
};
mouse = {
hide-when-typing = "yes";
};
# tokyonight: https://codeberg.org/dnkl/foot/src/branch/master/themes/tokyonight-night
colors = {
background = "1a1b26";
foreground = "c0caf5";
regular0 = "15161E";
regular1 = "f7768e";
regular2 = "9ece6a";
regular3 = "e0af68";
regular4 = "7aa2f7";
regular5 = "bb9af7";
regular6 = "7dcfff";
regular7 = "a9b1d6";
bright0 = "414868";
bright1 = "f7768e";
bright2 = "9ece6a";
bright3 = "e0af68";
bright4 = "7aa2f7";
bright5 = "bb9af7";
bright6 = "7dcfff";
bright7 = "c0caf5";
};
key-bindings = {
clipboard-copy = "Control+Shift+c XF86Copy";
clipboard-paste = "Control+Shift+v XF86Paste";
quit = "Control+q";
};
};
};
}

33
home/yt/tmux.nix Normal file
View file

@ -0,0 +1,33 @@
{pkgs, ...}: {
programs.tmux = {
enable = true;
baseIndex = 1;
historyLimit = 50000;
keyMode = "emacs";
mouse = false;
plugins = with pkgs.tmuxPlugins; [
yank
tokyo-night-tmux
{
plugin = resurrect;
extraConfig = "set -g @resurrect-capture-pane-contents 'on'";
}
{
plugin = continuum;
extraConfig = "set -g @continnum-restore 'on'";
}
];
prefix = "C-f";
sensibleOnTop = true;
terminal = "tmux-256color";
extraConfig = ''
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
bind u attach-session -c "#{pane_current_path}"
bind v split-window -c "#{pane_current_path}" -h
bind s split-window -c "#{pane_current_path}" -v
'';
};
}

138
home/yt/ytnix.nix Normal file
View file

@ -0,0 +1,138 @@
{
config,
pkgs,
lib,
inputs,
outputs,
...
}: {
imports = [
./common.nix
./foot.nix
];
home = {
username = "yt";
homeDirectory = "/home/yt";
stateVersion = "24.05";
};
programs.home-manager.enable = true;
systemd.user.startServices = "sd-switch";
qt = {
enable = true;
platformTheme.name = "gtk";
style.name = "adwaita-dark";
style.package = pkgs.adwaita-qt;
};
gtk = {
enable = true;
cursorTheme = {
package = pkgs.bibata-cursors;
name = "Bibata-Modern";
};
theme = {
package = pkgs.adw-gtk3;
name = "adw-gtk3-dark";
};
iconTheme = {
package = pkgs.adwaita-icon-theme;
name = "Adwaita";
};
};
home.sessionVariables = {
ANKI_WAYLAND = "1";
};
programs.git = {
enable = true;
userName = "cy";
userEmail = "hi@cything.io";
delta.enable = true;
};
programs.neovim.enable = true;
home.packages = with pkgs; [
firefox
inputs.chromium.legacyPackages.${system}.ungoogled-chromium
# ungoogled-chromium
librewolf
bitwarden-desktop
bitwarden-cli
aerc
fastfetch
discord
nwg-look
element-desktop-wayland
kdePackages.gwenview
kdePackages.okular
kdePackages.qtwayland
mpv
yt-dlp
signal-desktop
azure-cli
pavucontrol
btop
grim
slurp
rofi-wayland
rofimoji
cliphist
jq
bash-language-server
sqlite
usbutils
llvmPackages_19.clang-tools
calibre
tor-browser
wtype
bat
yarn
rclone
go
rustc
cargo
clang_19
rust-analyzer
clippy
pwgen
lua-language-server
gnumake
foot
minisign
unzip
lm_sensors
sshfs
nextcloud-client
python312Packages.python-lsp-server
gopls
anki-bin
];
programs.waybar.enable = true;
programs.feh.enable = true;
services.mako = {
enable = true;
backgroundColor = "#1a1a1a";
defaultTimeout = 5000;
borderSize = 0;
borderRadius = 10;
font = "DejaVu Sans Mono 11";
padding = "10";
textColor = "#777777";
extraConfig = ''
background-color=#c00000
border-color=#ff0000
'';
};
xdg.configFile = {
sway.source = ../sway;
rofi.source = ../rofi;
waybar.source = ../waybar;
};
}

95
home/yt/zsh/default.nix Normal file
View file

@ -0,0 +1,95 @@
{...}: {
programs.zsh = {
enable = true;
autosuggestion = {
enable = true;
strategy = ["history" "completion"];
};
syntaxHighlighting = {
enable = true;
highlighters = ["brackets"];
};
autocd = true;
defaultKeymap = "emacs";
antidote = {
enable = true;
useFriendlyNames = true; # why not?
plugins = [
"zsh-users/zsh-completions"
"romkatv/powerlevel10k"
"Aloxaf/fzf-tab"
"ohmyzsh/ohmyzsh path:plugins/colored-man-pages"
];
};
history = {
ignoreDups = true;
ignoreAllDups = true;
ignoreSpace = true;
save = 50000;
size = 50000;
append = true;
};
historySubstringSearch = {
enable = true;
searchUpKey = "^p";
searchDownKey = "^n";
};
initExtra = ''
source ${./p10k.zsh}
zstyle ':completion:*' matcher-list 'm:{a-z}={A-Za-z}'
zstyle ':completion:*' menu no
zstyle ':fzf-tab:complete:cd:*' fzf-preview 'ls $realpath'
zstyle ':fzf-tab:complete:__zoxide_z:*' fzf-prewview 'ls $realpath'
'';
shellAliases = {
"vi" = "nvim";
"vim" = "nvim";
"t" = "tmux";
"tl" = "tmux list-sessions";
"ta" = "tmux new-session -A -s";
"se" = "sudoedit";
"s" = "sudo";
"nrs" = "sudo nixos-rebuild switch --flake .";
"nrt" = "sudo nixos-rebuild test --flake .";
"hrs" = "home-manager switch --flake .";
"g" = "git";
"ga" = "git add";
"gaa" = "git add --all";
"gb" = "git branch";
"gc" = "git commit --verbose";
"gcmsg" = "git commit --message";
"gd" = "git diff";
"gdca" = "git diff --cached";
"gds" = "git diff --staged";
"gl" = "git log --stat";
"glg" = "git log --graph";
"glga" = "git log --graph --decorate --all";
"glo" = "git log --oneline --decorate";
"gp" = "git push";
"gr" = "git remote";
"gra" = "git remote add";
"grv" = "git remote --verbose";
"gs" = "git status --short";
"gss" = "git status";
};
sessionVariables = {
"FZF_DEFAULT_COMMAND" = "rg";
};
};
programs.fzf = {
enable = true;
enableZshIntegration = true;
};
programs.zoxide = {
enable = true;
enableZshIntegration = true;
options = ["--cmd cd"];
};
programs.eza = {
enable = true;
enableZshIntegration = true;
};
}

199
home/yt/zsh/p10k.zsh Normal file
View file

@ -0,0 +1,199 @@
# Generated by Powerlevel10k configuration wizard on 2024-11-29 at 19:54 EST.
# Based on romkatv/powerlevel10k/config/p10k-pure.zsh.
# Wizard options: nerdfont-v3 + powerline, small icons, pure, original, 2 lines,
# compact, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config file for Powerlevel10k with the style of Pure (https://github.com/sindresorhus/pure).
#
# Differences from Pure:
#
# - Git:
# - `@c4d3ec2c` instead of something like `v1.4.0~11` when in detached HEAD state.
# - No automatic `git fetch` (the same as in Pure with `PURE_GIT_PULL=0`).
#
# Apart from the differences listed above, the replication of Pure prompt is exact. This includes
# even the questionable parts. For example, just like in Pure, there is no indication of Git status
# being stale; prompt symbol is the same in command, visual and overwrite vi modes; when prompt
# doesn't fit on one line, it wraps around with no attempt to shorten it.
#
# If you like the general style of Pure but not particularly attached to all its quirks, type
# `p10k configure` and pick "Lean" style. This will give you slick minimalist prompt while taking
# advantage of Powerlevel10k features that aren't present in Pure.
# Temporarily change options.
'builtin' 'local' '-a' 'p10k_config_opts'
[[ ! -o 'aliases' ]] || p10k_config_opts+=('aliases')
[[ ! -o 'sh_glob' ]] || p10k_config_opts+=('sh_glob')
[[ ! -o 'no_brace_expand' ]] || p10k_config_opts+=('no_brace_expand')
'builtin' 'setopt' 'no_aliases' 'no_sh_glob' 'brace_expand'
() {
emulate -L zsh -o extended_glob
# Unset all configuration options.
unset -m '(POWERLEVEL9K_*|DEFAULT_USER)~POWERLEVEL9K_GITSTATUS_DIR'
# Zsh >= 5.1 is required.
[[ $ZSH_VERSION == (5.<1->*|<6->.*) ]] || return
# Prompt colors.
local grey='242'
local red='1'
local yellow='3'
local blue='4'
local magenta='5'
local cyan='6'
local white='7'
# Left prompt segments.
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
context # user@host
dir # current directory
vcs # git status
command_execution_time # previous command duration
# =========================[ Line #2 ]=========================
newline # \n
virtualenv # python virtual environment
prompt_char # prompt symbol
)
# Right prompt segments.
typeset -g POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(
# =========================[ Line #1 ]=========================
# command_execution_time # previous command duration
# virtualenv # python virtual environment
# context # user@host
# time # current time
# =========================[ Line #2 ]=========================
newline # \n
)
# Basic style options that define the overall prompt look.
typeset -g POWERLEVEL9K_BACKGROUND= # transparent background
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_{LEFT,RIGHT}_WHITESPACE= # no surrounding whitespace
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SUBSEGMENT_SEPARATOR=' ' # separate segments with a space
typeset -g POWERLEVEL9K_{LEFT,RIGHT}_SEGMENT_SEPARATOR= # no end-of-line symbol
typeset -g POWERLEVEL9K_VISUAL_IDENTIFIER_EXPANSION= # no segment icons
# Add an empty line before each prompt except the first. This doesn't emulate the bug
# in Pure that makes prompt drift down whenever you use the Alt-C binding from fzf or similar.
typeset -g POWERLEVEL9K_PROMPT_ADD_NEWLINE=false
# Magenta prompt symbol if the last command succeeded.
typeset -g POWERLEVEL9K_PROMPT_CHAR_OK_{VIINS,VICMD,VIVIS}_FOREGROUND=$magenta
# Red prompt symbol if the last command failed.
typeset -g POWERLEVEL9K_PROMPT_CHAR_ERROR_{VIINS,VICMD,VIVIS}_FOREGROUND=$red
# Default prompt symbol.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIINS_CONTENT_EXPANSION='❯'
# Prompt symbol in command vi mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VICMD_CONTENT_EXPANSION='❮'
# Prompt symbol in visual vi mode is the same as in command mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_{OK,ERROR}_VIVIS_CONTENT_EXPANSION='❮'
# Prompt symbol in overwrite vi mode is the same as in command mode.
typeset -g POWERLEVEL9K_PROMPT_CHAR_OVERWRITE_STATE=false
# Grey Python Virtual Environment.
typeset -g POWERLEVEL9K_VIRTUALENV_FOREGROUND=$grey
# Don't show Python version.
typeset -g POWERLEVEL9K_VIRTUALENV_SHOW_PYTHON_VERSION=false
typeset -g POWERLEVEL9K_VIRTUALENV_{LEFT,RIGHT}_DELIMITER=
# Blue current directory.
typeset -g POWERLEVEL9K_DIR_FOREGROUND=$blue
# Context format when root: user@host. The first part white, the rest grey.
typeset -g POWERLEVEL9K_CONTEXT_ROOT_TEMPLATE="%F{$white}%n%f%F{$grey}@%m%f"
# Context format when not root: user@host. The whole thing grey.
typeset -g POWERLEVEL9K_CONTEXT_TEMPLATE="%F{$grey}%n@%m%f"
# Don't show context unless root or in SSH.
typeset -g POWERLEVEL9K_CONTEXT_{DEFAULT,SUDO}_CONTENT_EXPANSION=
# Show previous command duration only if it's >= 5s.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_THRESHOLD=5
# Don't show fractional seconds. Thus, 7s rather than 7.3s.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_PRECISION=0
# Duration format: 1d 2h 3m 4s.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FORMAT='d h m s'
# Yellow previous command duration.
typeset -g POWERLEVEL9K_COMMAND_EXECUTION_TIME_FOREGROUND=$yellow
# Grey Git prompt. This makes stale prompts indistinguishable from up-to-date ones.
typeset -g POWERLEVEL9K_VCS_FOREGROUND=$grey
# Disable async loading indicator to make directories that aren't Git repositories
# indistinguishable from large Git repositories without known state.
typeset -g POWERLEVEL9K_VCS_LOADING_TEXT=
# Don't wait for Git status even for a millisecond, so that prompt always updates
# asynchronously when Git state changes.
typeset -g POWERLEVEL9K_VCS_MAX_SYNC_LATENCY_SECONDS=0
# Cyan ahead/behind arrows.
typeset -g POWERLEVEL9K_VCS_{INCOMING,OUTGOING}_CHANGESFORMAT_FOREGROUND=$cyan
# Don't show remote branch, current tag or stashes.
typeset -g POWERLEVEL9K_VCS_GIT_HOOKS=(vcs-detect-changes git-untracked git-aheadbehind)
# Don't show the branch icon.
typeset -g POWERLEVEL9K_VCS_BRANCH_ICON=
# When in detached HEAD state, show @commit where branch normally goes.
typeset -g POWERLEVEL9K_VCS_COMMIT_ICON='@'
# Don't show staged, unstaged, untracked indicators.
typeset -g POWERLEVEL9K_VCS_{STAGED,UNSTAGED,UNTRACKED}_ICON=
# Show '*' when there are staged, unstaged or untracked files.
typeset -g POWERLEVEL9K_VCS_DIRTY_ICON='*'
# Show '⇣' if local branch is behind remote.
typeset -g POWERLEVEL9K_VCS_INCOMING_CHANGES_ICON=':⇣'
# Show '⇡' if local branch is ahead of remote.
typeset -g POWERLEVEL9K_VCS_OUTGOING_CHANGES_ICON=':⇡'
# Don't show the number of commits next to the ahead/behind arrows.
typeset -g POWERLEVEL9K_VCS_{COMMITS_AHEAD,COMMITS_BEHIND}_MAX_NUM=1
# Remove space between '⇣' and '⇡' and all trailing spaces.
typeset -g POWERLEVEL9K_VCS_CONTENT_EXPANSION='${${${P9K_CONTENT/⇣* :⇡/⇣⇡}// }//:/ }'
# Grey current time.
typeset -g POWERLEVEL9K_TIME_FOREGROUND=$grey
# Format for the current time: 09:51:02. See `man 3 strftime`.
typeset -g POWERLEVEL9K_TIME_FORMAT='%D{%H:%M:%S}'
# If set to true, time will update when you hit enter. This way prompts for the past
# commands will contain the start times of their commands rather than the end times of
# their preceding commands.
typeset -g POWERLEVEL9K_TIME_UPDATE_ON_COMMAND=false
# Transient prompt works similarly to the builtin transient_rprompt option. It trims down prompt
# when accepting a command line. Supported values:
#
# - off: Don't change prompt when accepting a command line.
# - always: Trim down prompt when accepting a command line.
# - same-dir: Trim down prompt when accepting a command line unless this is the first command
# typed after changing current working directory.
typeset -g POWERLEVEL9K_TRANSIENT_PROMPT=always
# Instant prompt mode.
#
# - off: Disable instant prompt. Choose this if you've tried instant prompt and found
# it incompatible with your zsh configuration files.
# - quiet: Enable instant prompt and don't print warnings when detecting console output
# during zsh initialization. Choose this if you've read and understood
# https://github.com/romkatv/powerlevel10k#instant-prompt.
# - verbose: Enable instant prompt and print a warning when detecting console output during
# zsh initialization. Choose this if you've never tried instant prompt, haven't
# seen the warning, or if you are unsure what this all means.
typeset -g POWERLEVEL9K_INSTANT_PROMPT=off
# Hot reload allows you to change POWERLEVEL9K options after Powerlevel10k has been initialized.
# For example, you can type POWERLEVEL9K_BACKGROUND=red and see your prompt turn red. Hot reload
# can slow down prompt by 1-2 milliseconds, so it's better to keep it turned off unless you
# really need it.
typeset -g POWERLEVEL9K_DISABLE_HOT_RELOAD=true
# If p10k is already loaded, reload configuration.
# This works even with POWERLEVEL9K_DISABLE_HOT_RELOAD=true.
(( ! $+functions[p10k] )) || p10k reload
}
# Tell `p10k configure` which file it should overwrite.
typeset -g POWERLEVEL9K_CONFIG_FILE=${${(%):-%x}:a}
(( ${#p10k_config_opts} )) && setopt ${p10k_config_opts[@]}
'builtin' 'unset' 'p10k_config_opts'