Various updates

work
Matthew Ess 2020-05-28 13:29:19 -04:00
parent ed1daf5d72
commit f104978e38
19 changed files with 292 additions and 134 deletions

81
Session.vim Normal file
View File

@ -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("<sfile>: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("<sfile>: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 :

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -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"

75
assets/init.vim Normal file
View File

@ -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 <Esc> <C-\><C-n><CR>
"nohl
nnoremap <silent> ,<space> :nohlsearch<CR>
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 <silent> <c-b> :NERDTreeToggle<CR>
"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 <silent> K :call LanguageClient#textDocument_hover()<CR>
nnoremap <silent> f :call LanguageClient#textDocument_rangeFormatting()<CR>
nnoremap <silent> F :call LanguageClient#textDocument_formatting()<CR>
nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
nnoremap <silent> gr :call LanguageClient#textDocument_references()<CR>
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 <ESC> instead.
inoremap <c-c> <ESC>
" When the <Enter> 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 <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
" Use <TAB> to select the popup menu:
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"

21
assets/kitty-theme.conf Normal file
View File

@ -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

View File

@ -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="
];
};
}

View File

@ -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="
];
};
}

View File

@ -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=" ];
};
}

7
cachix/iohk.nix Normal file
View File

@ -0,0 +1,7 @@
{
nix = {
binaryCaches = [ "https://iohk.cachix.org" ];
binaryCachePublicKeys =
[ "iohk.cachix.org-1:DpRUyj7h7V830dp/i6Nti+NEO2/nhblbov/8MW7Rqoo=" ];
};
}

View File

@ -1,12 +1,8 @@
{
nix = {
binaryCaches = [
"https://matthewess.cachix.org"
];
binaryCaches = [ "https://matthewess.cachix.org" ];
binaryCachePublicKeys = [
"matthewess.cachix.org-1:dlcWfdyp8KTqlWXYIupL2+GM3hkWAojTl+WOBqGt/X0="
];
};
}

8
cachix/miso-haskell.nix Normal file
View File

@ -0,0 +1,8 @@
{
nix = {
binaryCaches = [ "https://miso-haskell.cachix.org" ];
binaryCachePublicKeys = [
"miso-haskell.cachix.org-1:6N2DooyFlZOHUfJtAx1Q09H0P5XXYzoxxQYiwn6W1e8="
];
};
}

View File

@ -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=" ];
};
}

View File

@ -0,0 +1,8 @@
{
nix = {
binaryCaches = [ "https://neovim-nightly.cachix.org" ];
binaryCachePublicKeys = [
"neovim-nightly.cachix.org-1:feIoInHRevVEplgdZvQDjhp11kYASYCE2NGY9hNrwxY="
];
};
}

View File

@ -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=" ];
};
}

View File

@ -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=" ];
};
}

7
cachix/todo-cli.nix Normal file
View File

@ -0,0 +1,7 @@
{
nix = {
binaryCaches = [ "https://todo-cli.cachix.org" ];
binaryCachePublicKeys =
[ "todo-cli.cachix.org-1:4nlgpKFUyaacIwtthY7DJtdvudzZRS5uDu+41xiXFys=" ];
};
}

View File

@ -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 = {

View File

@ -6,9 +6,9 @@ let
workEmail = "mess@yelp.com";
lockCmd = "i3lock -i ~/.lockscreen-image";
statusCmd = "i3status-rs ~/.config/i3status.toml";
unstable = import <nixos-unstable> { 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 <Esc> <C-\><C-n><CR>
"nohl
nnoremap <silent> ,<space> :nohlsearch<CR>
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; };
};
};
}

26
i3.nix
View File

@ -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 = ''