Browse Source

new configs added

master
Juni Kim 2 years ago
parent
commit
016274b100
  1. 38
      configuration.nix
  2. 33
      dotfiles/.cwmrc
  3. 2
      dotfiles/.xinitrc
  4. 19
      dotfiles/.zshrc
  5. 6
      dotfiles/cwm.sh
  6. 201
      dotfiles/init.vim
  7. 35
      dotfiles/kitty.conf
  8. 8
      dotfiles/picom.conf
  9. 173
      dotfiles/polybar/config
  10. 16
      dotfiles/polybar/launch.sh
  11. 2
      dotfiles/tmux.conf
  12. 72
      home.nix

38
configuration.nix

@ -72,21 +72,49 @@
users.users.junikim = {
isNormalUser = true;
extraGroups = [ "wheel" "video" "audio" "input" ]; # Enable ‘sudo’ for the user.
shell = pkgs.zsh;
};
programs.zsh.enable = true;
programs.zsh.ohMyZsh.enable = true;
programs.zsh.autosuggestions.enable = true;
programs.zsh.shellAliases = {
"gac" = "git add . && git commit";
"v" = "nvim";
"c" = "clear";
"s" = "ls";
"e" = "exit";
"sy" = "systemctl";
"cp" = "cp -r";
"vc" = "nvim ~/.config/nvim/init.vim";
};
programs.zsh.ohMyZsh.plugins = [ "git" "command-not-found" ];
programs.zsh.syntaxHighlighting.enable = true;
nixpkgs.config.allowUnfree = true;
environment.homeBinInPath = true;
environment.variables = {
"EDITOR" = "nvim";
};
# List packages installed in system profile. To search, run:
# $ nix search wget
fonts.fonts = with pkgs; [ jetbrains-mono dejavu_fonts ];
environment.systemPackages = with pkgs; [
vim neovim wget zsh brave
vim neovim neofetch tmux
fff
nodejs shellcheck
dash
wget brave
nfs-utils gcc gnumake
];
# Some programs need SUID wrappers, can be configured further or are
# started in user sessions.
# programs.mtr.enable = true;
# programs.gnupg.agent = {
# enable = true;
# enableSSHSupport = true;
# };
programs.gnupg.agent = {
enable = true;
#enableSSHSupport = true;
};
# List services that you want to enable:

33
dotfiles/.cwmrc

@ -0,0 +1,33 @@
command term kitty
bind-key 4-d dmenu_run
bind-key 4-f window-fullscreen
bind-key 4-Q window-close
bind-key 4-c window-cycle
bind-key 4-C window-rcycle
bind-key 4-h window-hide
bind-key 4-d "dmenu_run -fn \"JetBrains Mono:size=14\""
bind-key 4-space "dmenu_run -fn \"JetBrains Mono:size=14\""
bind-key 4-W brave
bind-key 4-Return terminal
bind-key M-Up "pactl set-sink-volume 0 +5%"
bind-key M-Down "pactl set-sink-volume 0 -5%"
bind-key M-m "pactl set-sink-mute 0 toggle"
mousebind M-1 window_move
mousebind CM-1 window_resize
bind-key 4-H window-htile
bind-key 4-V window-vtile
sticky yes
bind-key 4-1 group-only-1
bind-key 4-2 group-only-2
bind-key 4-3 group-only-3
bind-key 4S-1 window-movetogroup-1
bind-key 4S-2 window-movetogroup-2
bind-key 4S-3 window-movetogroup-3
gap 60 0 0 0

2
dotfiles/.xinitrc

@ -0,0 +1,2 @@
xrandr -s 1600x900
exec dbus-run-session "$HOME/cwm.sh"

19
dotfiles/.zshrc

@ -0,0 +1,19 @@
set -o vi
export MT_EDITOR=nvim
export VISUAL=nvim
eval "$(starship init zsh)"
f() {
fff "$@"
cd "$(cat "${XDG_CACHE_HOME:=${HOME}/.cache}/fff/.fff_d")"
}
export PATH=~/cp:$PATH
resetcursor() {
printf '\033]50;CursorShape=1\x7'
}
export PS1="$(resetcursor)$PS1"

6
dotfiles/cwm.sh

@ -0,0 +1,6 @@
#!/bin/sh
command -V nitrogen && nitrogen --restore &
test -x ~/.config/polybar/launch.sh && ~/.config/polybar/launch.sh
picom &
cwm

201
dotfiles/init.vim

@ -0,0 +1,201 @@
map j gj
map k gk
set mouse+=a
"let g:airline_theme ='base16_atelier_heath_light'
set number
set norelativenumber
set wrap
set linebreak
" use indents of 4 spaces, and have them copied down lines:
set shiftwidth=2
set tabstop=2
set softtabstop=2
set expandtab
set smarttab
set autoindent
set textwidth=80
filetype indent off
" enable filetype detection:
filetype on
autocmd FileType markdown,tex,text set nosmarttab noautoindent
" for C-like programming, have automatic indentation:
autocmd FileType c,cpp,slang set cindent
" * Keystrokes -- Insert Mode
autocmd Filetype python set shiftwidth=4 tabstop=4 softtabstop=4
"Coc Stuff
set encoding=utf-8
" TextEdit might fail if hidden is not set.
set hidden
" Some servers have issues with backup files, see #649.
set nobackup
set nowritebackup
" Give more space for displaying messages.
set cmdheight=2
" Having longer updatetime (default is 4000 ms = 4 s) leads to noticeable
" delays and poor user experience.
set updatetime=300
" Don't pass messages to |ins-completion-menu|.
set shortmess+=c
" Always show the signcolumn, otherwise it would shift the text each time
" diagnostics appear/become resolved.
if has("nvim-0.5.0") || has("patch-8.1.1564")
" Recently vim can merge signcolumn and number column into one
set signcolumn=number
else
set signcolumn=yes
endif
" Use tab for trigger completion with characters ahead and navigate.
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ pumvisible() ? "\<C-n>" :
\ <SID>check_back_space() ? "\<TAB>" :
\ coc#refresh()
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"
function! s:check_back_space() abort
let col = col('.') - 1
return !col || getline('.')[col - 1] =~# '\s'
endfunction
" Use <c-space> to trigger completion.
if has('nvim')
inoremap <silent><expr> <c-space> coc#refresh()
else
inoremap <silent><expr> <c-@> coc#refresh()
endif
" Make <CR> auto-select the first completion item and notify coc.nvim to
" format on enter, <cr> could be remapped by other vim plugin
inoremap <silent><expr> <cr> pumvisible() ? coc#_select_confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Use `[g` and `]g` to navigate diagnostics
" Use `:CocDiagnostics` to get all diagnostics of current buffer in location list.
nmap <silent> [g <Plug>(coc-diagnostic-prev)
nmap <silent> ]g <Plug>(coc-diagnostic-next)
" GoTo code navigation.
nmap <silent> gd <Plug>(coc-definition)
nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> gi <Plug>(coc-implementation)
nmap <silent> gr <Plug>(coc-references)
" Use K to show documentation in preview window.
nnoremap <silent> K :call <SID>show_documentation()<CR>
function! s:show_documentation()
if (index(['vim','help'], &filetype) >= 0)
execute 'h '.expand('<cword>')
elseif (coc#rpc#ready())
call CocActionAsync('doHover')
else
execute '!' . &keywordprg . " " . expand('<cword>')
endif
endfunction
" Highlight the symbol and its references when holding the cursor.
autocmd CursorHold * silent call CocActionAsync('highlight')
" Symbol renaming.
nmap <leader>rn <Plug>(coc-rename)
" Formatting selected code.
xmap <leader>f <Plug>(coc-format-selected)
nmap <leader>f <Plug>(coc-format-selected)
augroup mygroup
autocmd!
" Setup formatexpr specified filetype(s).
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
" Update signature help on jump placeholder.
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
augroup end
" Applying codeAction to the selected region.
" Example: `<leader>aap` for current paragraph
xmap <leader>a <Plug>(coc-codeaction-selected)
nmap <leader>a <Plug>(coc-codeaction-selected)
" Remap keys for applying codeAction to the current buffer.
nmap <leader>ac <Plug>(coc-codeaction)
" Apply AutoFix to problem on the current line.
nmap <leader>qf <Plug>(coc-fix-current)
" Run the Code Lens action on the current line.
nmap <leader>cl <Plug>(coc-codelens-action)
" Map function and class text objects
" NOTE: Requires 'textDocument.documentSymbol' support from the language server.
xmap if <Plug>(coc-funcobj-i)
omap if <Plug>(coc-funcobj-i)
xmap af <Plug>(coc-funcobj-a)
omap af <Plug>(coc-funcobj-a)
xmap ic <Plug>(coc-classobj-i)
omap ic <Plug>(coc-classobj-i)
xmap ac <Plug>(coc-classobj-a)
omap ac <Plug>(coc-classobj-a)
" Remap <C-f> and <C-b> for scroll float windows/popups.
if has('nvim-0.4.0') || has('patch-8.2.0750')
nnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
nnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
inoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(1)\<cr>" : "\<Right>"
inoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? "\<c-r>=coc#float#scroll(0)\<cr>" : "\<Left>"
vnoremap <silent><nowait><expr> <C-f> coc#float#has_scroll() ? coc#float#scroll(1) : "\<C-f>"
vnoremap <silent><nowait><expr> <C-b> coc#float#has_scroll() ? coc#float#scroll(0) : "\<C-b>"
endif
" Use CTRL-S for selections ranges.
" Requires 'textDocument/selectionRange' support of language server.
nmap <silent> <C-s> <Plug>(coc-range-select)
xmap <silent> <C-s> <Plug>(coc-range-select)
" Add `:Format` command to format current buffer.
command! -nargs=0 Format :call CocActionAsync('format')
" Add `:Fold` command to fold current buffer.
command! -nargs=? Fold :call CocAction('fold', <f-args>)
" Add `:OR` command for organize imports of the current buffer.
command! -nargs=0 OR :call CocActionAsync('runCommand', 'editor.action.organizeImport')
" Add (Neo)Vim's native statusline support.
" NOTE: Please see `:h coc-status` for integrations with external plugins that
" provide custom statusline: lightline.vim, vim-airline.
set statusline^=%{coc#status()}%{get(b:,'coc_current_function','')}
" Mappings for CoCList
" Show all diagnostics.
nnoremap <silent><nowait> <space>a :<C-u>CocList diagnostics<cr>
" Manage extensions.
nnoremap <silent><nowait> <space>e :<C-u>CocList extensions<cr>
" Show commands.
nnoremap <silent><nowait> <space>c :<C-u>CocList commands<cr>
" Find symbol of current document.
nnoremap <silent><nowait> <space>o :<C-u>CocList outline<cr>
" Search workspace symbols.
nnoremap <silent><nowait> <space>s :<C-u>CocList -I symbols<cr>
" Do default action for next item.
nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
" Do default action for previous item.
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
" END Coc

35
dotfiles/kitty.conf

@ -0,0 +1,35 @@
# vim:ft=conf
font_family JetBrains Mono
font_size 11.5
background_opacity 0.8
dynamic_background_opacity yes
window_margin_width 5
bell_path none
bell_on_tab no
enable_audio_bell no
background #2b2c2e
foreground #d2d8d9
cursor #708183
selection_background #e3e8ed
color0 #7c8a8f
color8 #888888
color1 #b23a51
color9 #f24840
color2 #789a69
color10 #80c46f
color3 #b9ab4a
color11 #ffeb62
color4 #2a7fac
color12 #4095ff
color5 #bc4f5a
color13 #fb5175
color6 #44a799
color14 #52ccbd
color7 #d2d8d9
color15 #d2d8d9
selection_foreground #2b2c2e

8
dotfiles/picom.conf

@ -0,0 +1,8 @@
#vim:ft=conf
fade-in-step = 1.0;
fade-out-step = 1.0;
rounded-corners-exclude = [
"class_g = 'Polybar'"
]

173
dotfiles/polybar/config

@ -0,0 +1,173 @@
;==========================================================
;
;
; ██████╗ ██████╗ ██╗ ██╗ ██╗██████╗ █████╗ ██████╗
; ██╔══██╗██╔═══██╗██║ ╚██╗ ██╔╝██╔══██╗██╔══██╗██╔══██╗
; ██████╔╝██║ ██║██║ ╚████╔╝ ██████╔╝███████║██████╔╝
; ██╔═══╝ ██║ ██║██║ ╚██╔╝ ██╔══██╗██╔══██║██╔══██╗
; ██║ ╚██████╔╝███████╗██║ ██████╔╝██║ ██║██║ ██║
; ╚═╝ ╚═════╝ ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝
;
;
; To learn more about how to configure Polybar
; go to https://github.com/polybar/polybar
;
; The README contains a lot of information
;
;==========================================================
[colors]
background = #222
background-alt = #444
;foreground = ${xrdb:color7:#222}
foreground = #dfdfdf
foreground-alt = #555
primary = #cec0af
secondary = #242e35
alert = #bd2c40
black = #000
white = #fff
grey = #aaa
darkgrey = #555
red = #f00
green = #0f0
blue = #2d02d0
yellow = #d2b55b
[bar/main]
modules-center = date
font-0 = Jetbrains Mono:style=Regular
height = 30
width = 320
offset-x = 15
offset-y = 15
background = ${colors.primary}
radius=5
override-redirect=true
[module/date]
type = internal/date
date = "%h-%d-20%y %r"
label-foreground = #000000
[bar/pulse]
modules-center = pulseaudio
height = 30
width = 200
offset-y = 15
#offset-x = 1300
offset-x = 350
radius=5
override-redirect=true
background = ${colors.secondary}
foreground = #fff
font-0 = Jetbrains Mono:style=Regular
font-1 = FontAwesome:style=Regular
font-2 = "Iosevka:pixelsize=12;0"
font-3 = RobotoMono Nerd Font:pixelsize=12;1
[module/xworkspaces]
type = internal/xworkspaces
label-active = %name%
label-active-background = ${colors.background-alt}
label-active-underline= ${colors.primary}
label-active-padding = 1
label-occupied = %name%
label-occupied-padding = 1
label-urgent = %name%
label-urgent-background = ${colors.alert}
label-urgent-padding = 1
label-empty = %name%
label-empty-foreground = ${colors.disabled}
label-empty-padding = 1
[module/xwindow]
type = internal/xwindow
label = %title:0:60:...%
[module/filesystem]
type = internal/fs
interval = 25
mount-0 = /
label-mounted = %{F#F0C674}%mountpoint%%{F-} %percentage_used%%
label-unmounted = %mountpoint% not mounted
label-unmounted-foreground = ${colors.disabled}
[module/pulseaudio]
type = internal/pulseaudio
format-volume-prefix = "VOL "
format-volume-prefix-foreground = ${colors.primary}
format-volume = <label-volume>
label-volume = %percentage%%
label-muted = muted
label-muted-foreground = ${colors.disabled}
[module/xkeyboard]
type = internal/xkeyboard
blacklist-0 = num lock
label-layout = %layout%
label-layout-foreground = ${colors.primary}
label-indicator-padding = 2
label-indicator-margin = 1
label-indicator-foreground = ${colors.background}
label-indicator-background = ${colors.secondary}
[module/memory]
type = internal/memory
interval = 2
format-prefix = "RAM "
format-prefix-foreground = ${colors.primary}
label = %percentage_used:2%%
[module/cpu]
type = internal/cpu
interval = 2
format-prefix = "CPU "
format-prefix-foreground = ${colors.primary}
label = %percentage:2%%
[network-base]
type = internal/network
interval = 5
format-connected = <label-connected>
format-disconnected = <label-disconnected>
label-disconnected = %{F#F0C674}%ifname%%{F#707880} disconnected
[module/wlan]
inherit = network-base
interface-type = wireless
label-connected = %{F#F0C674}%ifname%%{F-} %essid% %local_ip%
[module/eth]
inherit = network-base
interface-type = wired
label-connected = %{F#F0C674}%ifname%%{F-} %local_ip%
#[module/date]
#type = internal/date
#interval = 1
#date = %H:%M
#date-alt = %Y-%m-%d %H:%M:%S
#label = %date%
#label-foreground = ${colors.primary}
[settings]
screenchange-reload = true
pseudo-transparency = true
; vim:ft=dosini

16
dotfiles/polybar/launch.sh

@ -0,0 +1,16 @@
#!/bin/sh
#!/bin/bash
# Terminate already running bar instances
pkill polybar
# Wait until the processes have been shut down
while pgrep -u $UID -x polybar >/dev/null; do sleep 1; done
# Launch Polybar, using default config location ~/.config/polybar/config
polybar main & sleep 0.5
polybar pulse &
echo "Polybar launched..."

2
dotfiles/tmux.conf

@ -0,0 +1,2 @@
set -sg escape-time 0
set -g mouse on

72
home.nix

@ -0,0 +1,72 @@
{ config, pkgs, ... }:
{
# Home Manager needs a bit of information about you and the
# paths it should manage.
home.username = "junikim";
home.homeDirectory = "/home/junikim";
# This value determines the Home Manager release that your
# configuration is compatible with. This helps avoid breakage
# when a new Home Manager release introduces backwards
# incompatible changes.
#
# You can update Home Manager without changing this value. See
# the Home Manager release notes for a list of state version
# changes in each release.
home.stateVersion = "22.05";
# Let Home Manager install and manage itself.
programs.home-manager.enable = true;
programs.starship = {
enable = true;
};
home.packages = with pkgs; [
vim xclip neofetch tmux
fff
nodejs shellcheck
dash
wget brave
cwm polybarFull kitty nitrogen dmenu picom
nfs-utils gcc gnumake pulsemixer
];
programs.neovim = {
enable = true;
plugins = with pkgs.vimPlugins; [
coc-nvim
neovim-sensible
vim-airline
vim-airline-themes
vim-nix
];
extraConfig = builtins.readFile ./dotfiles/init.vim;
};
programs.git = {
package = pkgs.gitAndTools.gitFull;
enable = true;
userName = "Juni Kim";
userEmail = "junikimm717@gmail.com";
};
programs.zsh.oh-my-zsh.enable = true;
programs.zsh.oh-my-zsh.theme = "robbyrussell";
home.file = {
#".config/nvim/init.vim".source = ./dotfiles/init.vim;
".config/polybar" = {
source = ./dotfiles/polybar;
recursive = true;
};
".config/kitty/kitty.conf".source = ./dotfiles/kitty.conf;
".config/picom/picom.conf".source = ./dotfiles/picom.conf;
".cwmrc".source = ./dotfiles/.cwmrc;
"cwm.sh".source = ./dotfiles/cwm.sh;
".xinitrc".source = ./dotfiles/.xinitrc;
".zshrc".source = ./dotfiles/.zshrc;
".tmux.conf".source = ./dotfiles/tmux.conf;
};
}
Loading…
Cancel
Save