diff --git a/Session.vim b/Session.vim new file mode 100644 index 0000000..15efa88 --- /dev/null +++ b/Session.vim @@ -0,0 +1,81 @@ +let SessionLoad = 1 +let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0 +let v:this_session=expand(":p") +silent only +cd ~/dotfiles.nix +if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' + let s:wipebuf = bufnr('%') +endif +set shortmess=aoO +badd +28 home.nix +badd +1 assets/i3status.toml +badd +66 assets/i3status-cfg +argglobal +silent! argdel * +$argadd home.nix +edit assets/i3status-cfg +set splitbelow splitright +wincmd _ | wincmd | +vsplit +1wincmd h +wincmd w +set nosplitright +wincmd t +set winminheight=0 +set winheight=1 +set winminwidth=0 +set winwidth=1 +exe 'vert 1resize ' . ((&columns * 66 + 66) / 133) +exe 'vert 2resize ' . ((&columns * 66 + 66) / 133) +argglobal +setlocal fdm=manual +setlocal fde=0 +setlocal fmr={{{,}}} +setlocal fdi=# +setlocal fdl=0 +setlocal fml=1 +setlocal fdn=20 +setlocal fen +silent! normal! zE +let s:l = 66 - ((23 * winheight(0) + 14) / 29) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +66 +normal! 0 +wincmd w +argglobal +if bufexists('assets/i3status.toml') | buffer assets/i3status.toml | else | edit assets/i3status.toml | endif +setlocal fdm=manual +setlocal fde=0 +setlocal fmr={{{,}}} +setlocal fdi=# +setlocal fdl=0 +setlocal fml=1 +setlocal fdn=20 +setlocal fen +silent! normal! zE +let s:l = 39 - ((26 * winheight(0) + 14) / 29) +if s:l < 1 | let s:l = 1 | endif +exe s:l +normal! zt +39 +normal! 011| +wincmd w +2wincmd w +exe 'vert 1resize ' . ((&columns * 66 + 66) / 133) +exe 'vert 2resize ' . ((&columns * 66 + 66) / 133) +tabnext 1 +if exists('s:wipebuf') && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal' + silent exe 'bwipe ' . s:wipebuf +endif +unlet! s:wipebuf +set winheight=1 winwidth=20 winminheight=1 winminwidth=1 shortmess=filnxtToOF +let s:sx = expand(":p:r")."x.vim" +if file_readable(s:sx) + exe "source " . fnameescape(s:sx) +endif +let &so = s:so_save | let &siso = s:siso_save +doautoall SessionLoadPost +unlet SessionLoad +" vim: set ft=vim : diff --git a/assets/background-image b/assets/background-image index 210e6d8..b223bfa 100644 Binary files a/assets/background-image and b/assets/background-image differ diff --git a/assets/i3status.toml b/assets/i3status.toml index 1941651..40779ae 100644 --- a/assets/i3status.toml +++ b/assets/i3status.toml @@ -37,7 +37,7 @@ block = "sound" [[block]] block = "time" interval = 60 -format = "%a %m/%d %R" +format = "%a %m/%d %I:%M%P" [[block]] block = "battery" diff --git a/assets/init.vim b/assets/init.vim new file mode 100644 index 0000000..72fa05c --- /dev/null +++ b/assets/init.vim @@ -0,0 +1,75 @@ +syntax on +filetype plugin indent on +set cursorline "highlight current line +set showmatch "highlight matching [{()}] +set tabstop=2 "number of visual spaces per TAB when reading +set softtabstop=2 "number of spaces per TAB when editing +set expandtab "tabs are spaces +set shiftwidth=2 "indents +set ww=<,>,[,] "wrap +set splitbelow "split underneath +set splitright "split to the right + +command Mks NERDTreeClose | mksession! +command Term split | term +command Vterm vsplit | term + +"command Hsfmt mark H | %!./styler.sh | if v:shell_error | undo | else | `H | delm H | endif + +"save readonly +cmap w!! w !sudo tee >/dev/null % +"terminal exit +tnoremap +"nohl +nnoremap , :nohlsearch + +colorscheme Tomorrow-Night-Eighties + +let g:lightline = {'colorscheme': 'jellybeans'} + +"cursor saving +autocmd BufReadPost * if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif + +"nerdtree +"show hidden files +let NERDTreeShowHidden=1 +"open on vim open +"autocmd vimenter * NERDTree +"switch to editing window +"autocmd vimenter * wincmd p +"close if only nerdtree is left +autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +"show/hide nerdtree +nnoremap :NERDTreeToggle + +"LSP support +set hidden +let g:LanguageClient_rootMarkers = ['*.cabal', 'stack.yaml'] +let g:LanguageClient_serverCommands = { + \ 'haskell': ['ghcide', '--lsp'], + \ } +let g:LanguageClient_preferredMarkupKind = ['plaintext'] +let g:LanguageClient_completionPreferTextEdit = 1 +nnoremap K :call LanguageClient#textDocument_hover() +nnoremap f :call LanguageClient#textDocument_rangeFormatting() +nnoremap F :call LanguageClient#textDocument_formatting() +nnoremap gd :call LanguageClient#textDocument_definition() +nnoremap gr :call LanguageClient#textDocument_references() +set cmdheight=2 +set updatetime=300 +set signcolumn=yes + +"NCM2 +autocmd bufenter * call ncm2#enable_for_buffer() +au User Ncm2PopupOpen set completeopt=noinsert,menuone,noselect +au User Ncm2PopupClose set completeopt=menuone +set shortmess+=c +" CTRL-C doesn't trigger the InsertLeave autocmd . map to instead. +inoremap +" When the key is pressed while the popup menu is visible, it only +" hides the menu. Use this mapping to close the menu and also start a new +" line. +inoremap (pumvisible() ? "\\" : "\") +" Use to select the popup menu: +inoremap pumvisible() ? "\" : "\" +inoremap pumvisible() ? "\" : "\" diff --git a/assets/kitty-theme.conf b/assets/kitty-theme.conf new file mode 100644 index 0000000..346f3dc --- /dev/null +++ b/assets/kitty-theme.conf @@ -0,0 +1,21 @@ +background #000000 +foreground #e9e9e9 +cursor #e9e9e9 +selection_background #424242 +color0 #000000 +color8 #000000 +color1 #d44d53 +color9 #d44d53 +color2 #b9c949 +color10 #b9c949 +color3 #e6c446 +color11 #e6c446 +color4 #79a6da +color12 #79a6da +color5 #c396d7 +color13 #c396d7 +color6 #70c0b1 +color14 #70c0b1 +color7 #fffefe +color15 #fffefe +selection_foreground #000000 diff --git a/cachix/ghcide-nix.nix b/cachix/ghcide-nix.nix index a25ea0d..5fa74de 100644 --- a/cachix/ghcide-nix.nix +++ b/cachix/ghcide-nix.nix @@ -1,12 +1,8 @@ - { nix = { - binaryCaches = [ - "https://ghcide-nix.cachix.org" - ]; + binaryCaches = [ "https://ghcide-nix.cachix.org" ]; binaryCachePublicKeys = [ "ghcide-nix.cachix.org-1:ibAY5FD+XWLzbLr8fxK6n8fL9zZe7jS+gYeyxyWYK5c=" ]; }; } - \ No newline at end of file diff --git a/cachix/hercules-ci.nix b/cachix/hercules-ci.nix index a925aa3..5fa4f78 100644 --- a/cachix/hercules-ci.nix +++ b/cachix/hercules-ci.nix @@ -1,12 +1,8 @@ - { nix = { - binaryCaches = [ - "https://hercules-ci.cachix.org" - ]; + binaryCaches = [ "https://hercules-ci.cachix.org" ]; binaryCachePublicKeys = [ "hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0=" ]; }; } - \ No newline at end of file diff --git a/cachix/hie-nix.nix b/cachix/hie-nix.nix index 827d0a3..10b79d6 100644 --- a/cachix/hie-nix.nix +++ b/cachix/hie-nix.nix @@ -1,12 +1,7 @@ - { nix = { - binaryCaches = [ - "https://hie-nix.cachix.org" - ]; - binaryCachePublicKeys = [ - "hie-nix.cachix.org-1:EjBSHzF6VmDnzqlldGXbi0RM3HdjfTU3yDRi9Pd0jTY=" - ]; + binaryCaches = [ "https://hie-nix.cachix.org" ]; + binaryCachePublicKeys = + [ "hie-nix.cachix.org-1:EjBSHzF6VmDnzqlldGXbi0RM3HdjfTU3yDRi9Pd0jTY=" ]; }; } - \ No newline at end of file diff --git a/cachix/iohk.nix b/cachix/iohk.nix new file mode 100644 index 0000000..e59b919 --- /dev/null +++ b/cachix/iohk.nix @@ -0,0 +1,7 @@ +{ + nix = { + binaryCaches = [ "https://iohk.cachix.org" ]; + binaryCachePublicKeys = + [ "iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=" ]; + }; +} diff --git a/cachix/matthewess.nix b/cachix/matthewess.nix index f12a820..4626555 100644 --- a/cachix/matthewess.nix +++ b/cachix/matthewess.nix @@ -1,12 +1,8 @@ - { nix = { - binaryCaches = [ - "https://matthewess.cachix.org" - ]; + binaryCaches = [ "https://matthewess.cachix.org" ]; binaryCachePublicKeys = [ "matthewess.cachix.org-1:dlcWfdyp8KTqlWXYIupL2+GM3hkWAojTl+WOBqGt/X0=" ]; }; } - \ No newline at end of file diff --git a/cachix/miso-haskell.nix b/cachix/miso-haskell.nix new file mode 100644 index 0000000..c4698d3 --- /dev/null +++ b/cachix/miso-haskell.nix @@ -0,0 +1,8 @@ +{ + nix = { + binaryCaches = [ "https://miso-haskell.cachix.org" ]; + binaryCachePublicKeys = [ + "miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8=" + ]; + }; +} diff --git a/cachix/mothbot.nix b/cachix/mothbot.nix index d79f4fd..ba3fe02 100644 --- a/cachix/mothbot.nix +++ b/cachix/mothbot.nix @@ -1,12 +1,7 @@ - { nix = { - binaryCaches = [ - "https://mothbot.cachix.org" - ]; - binaryCachePublicKeys = [ - "mothbot.cachix.org-1:+frc2gaYS3tGHaHCeuwlWkBSR6xwskmCfvIX3YjMcV8=" - ]; + binaryCaches = [ "https://mothbot.cachix.org" ]; + binaryCachePublicKeys = + [ "mothbot.cachix.org-1:+frc2gaYS3tGHaHCeuwlWkBSR6xwskmCfvIX3YjMcV8=" ]; }; } - \ No newline at end of file diff --git a/cachix/neovim-nightly.nix b/cachix/neovim-nightly.nix new file mode 100644 index 0000000..8f1e534 --- /dev/null +++ b/cachix/neovim-nightly.nix @@ -0,0 +1,8 @@ +{ + nix = { + binaryCaches = [ "https://neovim-nightly.cachix.org" ]; + binaryCachePublicKeys = [ + "neovim-nightly.cachix.org-1:feIoInHRevVEplgdZvQDjhp11kYASYCE2NGY9hNrwxY=" + ]; + }; +} diff --git a/cachix/nix-tools.nix b/cachix/nix-tools.nix index 6a22eb7..a043afe 100644 --- a/cachix/nix-tools.nix +++ b/cachix/nix-tools.nix @@ -1,12 +1,7 @@ - { nix = { - binaryCaches = [ - "https://nix-tools.cachix.org" - ]; - binaryCachePublicKeys = [ - "nix-tools.cachix.org-1:ebBEBZLogLxcCvipq2MTvuHlP7ZRdkazFSQsbs0Px1A=" - ]; + binaryCaches = [ "https://nix-tools.cachix.org" ]; + binaryCachePublicKeys = + [ "nix-tools.cachix.org-1:ebBEBZLogLxcCvipq2MTvuHlP7ZRdkazFSQsbs0Px1A=" ]; }; } - \ No newline at end of file diff --git a/cachix/pynchon.nix b/cachix/pynchon.nix index 6b9c410..e9bc374 100644 --- a/cachix/pynchon.nix +++ b/cachix/pynchon.nix @@ -1,12 +1,7 @@ - { nix = { - binaryCaches = [ - "https://pynchon.cachix.org" - ]; - binaryCachePublicKeys = [ - "pynchon.cachix.org-1:9Cj9t6FxSOQKMkjdd12Q2n7djp8CYBx+J2bIwzwaW+8=" - ]; + binaryCaches = [ "https://pynchon.cachix.org" ]; + binaryCachePublicKeys = + [ "pynchon.cachix.org-1:9Cj9t6FxSOQKMkjdd12Q2n7djp8CYBx+J2bIwzwaW+8=" ]; }; } - \ No newline at end of file diff --git a/cachix/todo-cli.nix b/cachix/todo-cli.nix new file mode 100644 index 0000000..7e76971 --- /dev/null +++ b/cachix/todo-cli.nix @@ -0,0 +1,7 @@ +{ + nix = { + binaryCaches = [ "https://todo-cli.cachix.org" ]; + binaryCachePublicKeys = + [ "todo-cli.cachix.org-1:4nlgpKFUyaacIwtthY7DJtdvudzZRS5uDu+41xiXFys=" ]; + }; +} diff --git a/configuration.nix b/configuration.nix index 243039f..169fc63 100644 --- a/configuration.nix +++ b/configuration.nix @@ -19,7 +19,8 @@ boot.loader.systemd-boot.configurationLimit = 64; boot.loader.efi.canTouchEfiVariables = true; - boot.earlyVconsoleSetup = true; + console.earlySetup = true; + console.keyMap = "us"; system.autoUpgrade.enable = true; @@ -61,10 +62,7 @@ }; # Select internationalisation properties. - i18n = { - consoleKeyMap = "us"; - defaultLocale = "en_US.UTF-8"; - }; + i18n = { defaultLocale = "en_US.UTF-8"; }; # Set your time zone. time.timeZone = "America/New_York"; @@ -73,10 +71,7 @@ # $ nix search wget environment.systemPackages = with pkgs; [ # System utilities - curl - fish git - htop tmux tree vim @@ -89,7 +84,7 @@ # programs.gnupg.agent = { enable = true; enableSSHSupport = true; }; programs = { - fish.enable = true; + fish.enable = false; light.enable = true; nm-applet.enable = true; seahorse.enable = true; @@ -98,7 +93,10 @@ # List services that you want to enable: services = { - fprintd.enable = true; + fprintd = { + enable = true; + package = pkgs.fprintd-thinkpad; + }; openssh.enable = true; clipmenu.enable = true; geoclue2.enable = true; @@ -109,23 +107,21 @@ enable = true; layout = "us"; - config = '' - Section "Device" - Identifier "Intel Graphics" - Driver "intel" - - Option "TearFree" "true" - EndSection + videoDrivers = [ "intel" ]; + deviceSection = '' + Option "DRI" "3" + Option "TearFree" "true" ''; + useGlamor = true; # Enable touchpad support. libinput = { enable = true; naturalScrolling = true; + disableWhileTyping = true; }; desktopManager = { - default = "home-manager"; session = [{ name = "home-manager"; start = '' @@ -135,6 +131,7 @@ }]; }; displayManager = { + defaultSession = "home-manager"; lightdm = { enable = true; autoLogin = { diff --git a/home.nix b/home.nix index 1eabcbc..88e8660 100644 --- a/home.nix +++ b/home.nix @@ -6,9 +6,9 @@ let workEmail = "mess@yelp.com"; lockCmd = "i3lock -i ~/.lockscreen-image"; statusCmd = "i3status-rs ~/.config/i3status.toml"; - unstable = import { config.allowUnfree = true; }; in { + nixpkgs = { config = { allowUnfree = true; }; }; home = { sessionVariables = { EDITOR = "vim"; @@ -18,24 +18,27 @@ in { packages = with pkgs; [ # nix utilities cachix - unstable.niv + niv nixfmt nix-prefetch-git # command line utilities ag + python37Packages.cookiecutter + du-dust exercism fzy imagemagick jq + haskell.packages.ghc865.pointfree rlwrap tldr unzip # graphical applications - atom - unstable.discord + discord (dunst.override { dunstify = true; }) enpass firefox + httpie kitty nheko slack @@ -45,7 +48,7 @@ in { clipnotify dmenu i3lock - unstable.i3status-rust + i3status-rust libnotify rofi xclip @@ -73,8 +76,7 @@ in { ''; ".config/fish/completions/systemctl.fish".source = ./assets/systemctl.fish; - ".config/fish/functions/colortest.fish".source = - ./assets/colortest.fish; + ".config/fish/functions/colortest.fish".source = ./assets/colortest.fish; ".config/fish/functions/kbl.fish".text = '' function kbl -a level set -l initial (cat /sys/class/leds/tpacpi\:\:kbd_backlight/brightness) @@ -100,11 +102,13 @@ in { font_family Fira Code Regular bold_font Fira Code Bold font_size 15.0 + include ./theme.conf ''; + ".config/kitty/theme.conf".source = ./assets/kitty-theme.conf; + ".config/nvim/init.vim".source = ./assets/init.vim; ".config/rofi/theme.rasi".source = ./assets/sidetab.rasi; }; }; - nixpkgs = { config.allowUnfree = true; }; programs = { alacritty = { enable = false; @@ -123,6 +127,7 @@ in { firefox.enable = true; fish = { enable = true; + package = pkgs.fish; interactiveShellInit = '' echo 'ヽ(´ᗜ`)ノ welcome ヽ(´ᗜ`)ノ' if not functions -q fisher @@ -144,10 +149,21 @@ in { alias upgrade="sudo rm -rf /root/.cache/nix/tarballs; and sudo nixos-rebuild switch --upgrade" alias clip="xclip -selection c" alias cxuse="sudo cachix use -d ~/dotfiles.nix" - alias cxpsh="nix build -f shell.nix; nix-store -qR --include-outputs (nix-instantiate shell.nix) | cachix push" + alias cxpsh="nix-shell --command exit; nix-store -qR --include-outputs (nix-instantiate shell.nix) | cachix push" + alias cxpush=cxpsh alias home="vim ~/dotfiles.nix/home.nix +'cd %:p:h'" alias i3="vim ~/dotfiles.nix/i3.nix +'cd %:p:h'" + alias config="vim ~/dotfiles.nix/configuration.nix +'cd %:p:h'" alias vims="vim -S Session.vim" + + bind \cr 'fzy_select_history (commandline -b)' + bind -M insert \cr 'fzy_select_history (commandline -b)' + + bind \cf 'fzy_select_directory' + bind -M insert \cf 'fzy_select_directory' + + bind -M insert ! __history_previous_command + bind -M insert '$' __history_previous_command_arguments ''; }; git = { @@ -171,6 +187,8 @@ in { enable = true; viAlias = true; vimAlias = true; + withNodeJs = true; + extraPython3Packages = ps: with ps; [ pynvim ]; plugins = with pkgs.vimPlugins; [ neovim-sensible vim-fugitive @@ -183,45 +201,14 @@ in { haskell-vim auto-pairs vim-fish + LanguageClient-neovim + ncm2 + ncm2-path + nvim-yarp + ctrlp + dhall-vim ]; - extraConfig = '' - syntax on - filetype plugin indent on - set cursorline "highlight current line - set showmatch "highlight matching [{()}] - set tabstop=2 "number of visual spaces per TAB when reading - set softtabstop=2 "number of spaces per TAB when editing - set expandtab "tabs are spaces - set shiftwidth=2 "indents - set ww=<,>,[,] "wrap - set splitbelow "split underneath - - command Mks NERDTreeClose | mksession! - - "save readonly - cmap w!! w !sudo tee >/dev/null % - "terminal exit - tnoremap - "nohl - nnoremap , :nohlsearch - - colorscheme Tomorrow-Night-Eighties - "lightline options - let g:lightline = {'colorscheme': 'jellybeans'} - - "cursor saving - autocmd BufReadPost * if @% !~# '\.git[\/\\]COMMIT_EDITMSG$' && line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif - - "nerdtree - "show hidden files - let NERDTreeShowHidden=1 - "open on vim open - autocmd vimenter * NERDTree - "switch to editing window - autocmd vimenter * wincmd p - "close if only nerdtree is left - autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif - ''; + extraConfig = builtins.readFile ./assets/init.vim; }; rofi = { enable = true; @@ -235,6 +222,11 @@ in { extraOptionOverrides = { "AddKeysToAgent" = "true"; }; }; starship.enable = true; + vscode = { + enable = true; + package = pkgs.vscodium; + # extensions = with pkgs.vscode-extensions; []; + }; }; services = { dunst = { @@ -262,7 +254,7 @@ in { }; shortcuts = { close = "ctrl+space"; - history = "ctrl+grave"; + history = "ctrl+shift+grave"; }; urgency_low = { background = "#282828"; @@ -286,7 +278,7 @@ in { provider = "geoclue2"; }; screen-locker = { - enable = true; + enable = false; lockCmd = "${lockCmd}"; }; }; @@ -294,11 +286,7 @@ in { enable = true; scriptPath = ".hm-xsession"; windowManager = { - i3 = import ./i3.nix { - inherit lib; - inherit lockCmd; - inherit statusCmd; - }; + i3 = import ./i3.nix { inherit lib lockCmd statusCmd; }; }; }; } diff --git a/i3.nix b/i3.nix index 8a2d64c..55614be 100644 --- a/i3.nix +++ b/i3.nix @@ -33,11 +33,11 @@ childBorder = "#0C0C0C"; }; urgent = { - border = "#D890A8"; - background = "#D890A8"; + border = "#1086E0"; + background = "#1086E0"; text = "#383632"; - indicator = "#D890A8"; - childBorder = "#D890A8"; + indicator = "#1086E0"; + childBorder = "#1086E0"; }; }; bars = [{ @@ -63,13 +63,13 @@ text = "#CDC5B4"; }; urgentWorkspace = { - border = "#D890A8"; - background = "#D890A8"; + border = "#1086E0"; + background = "#1086E0"; text = "#383632"; }; bindingMode = { - border = "#D890A8"; - background = "#D890A8"; + border = "#1086E0"; + background = "#1086E0"; text = "#383632"; }; }; @@ -78,7 +78,7 @@ keybindings = lib.mkOptionDefault { "${modifier}+c" = "exec CM_ONESHOT=1 clipmenud"; "${modifier}+v" = "exec clipmenu"; - "${modifier}+Escape" = "exec ${lockCmd}"; + # "${modifier}+Escape" = "exec ${lockCmd}"; "${modifier}+0" = "workspace number 0"; "${modifier}+1" = "workspace number 1"; "${modifier}+2" = "workspace number 2"; @@ -98,15 +98,13 @@ workspaceLayout = "tabbed"; assigns = { "1: web" = [{ class = "Firefox"; }]; - "2: devel" = [ { class = "(K|k)itty"; } { class = "Atom"; } ]; + "2: devel" = [ { class = "(?i)kitty"; } { class = "(?i)(vsc|c)odium"; } ]; "3: social" = [ - { class = "(N|n)heko"; } + { class = "(?i)nheko"; } { class = "Slack"; } { class = "discord"; } ]; - "4: admin" = [{ class = "Enpass"; }]; - "5: games" = [{ class = "(S|s)team"; }]; - "6: other" = [{ class = ".*"; }]; + "4: other" = [{ class = ".*"; }]; }; }; extraConfig = ''