2024-12-28 21:50:39 +01:00
|
|
|
|
{ config, pkgs, mail, ... }:
|
2024-09-29 21:36:36 +02:00
|
|
|
|
|
|
|
|
|
{
|
2024-12-21 01:30:34 +01:00
|
|
|
|
imports = [ ./nixvim ];
|
|
|
|
|
|
2024-10-03 19:30:10 +02:00
|
|
|
|
config = {
|
2024-12-21 01:30:34 +01:00
|
|
|
|
home.username = "rothe";
|
|
|
|
|
home.homeDirectory = "/home/rothe";
|
|
|
|
|
|
|
|
|
|
# Add extra variables like $EDITOR
|
|
|
|
|
home.sessionVariables = {
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-03 19:30:10 +02:00
|
|
|
|
home.packages = with pkgs; [
|
|
|
|
|
black
|
2024-10-08 08:15:34 +02:00
|
|
|
|
devenv
|
2024-11-22 20:26:34 +01:00
|
|
|
|
fzf
|
2024-10-30 09:03:53 +01:00
|
|
|
|
gitleaks
|
2024-10-03 19:30:10 +02:00
|
|
|
|
go
|
|
|
|
|
gopls
|
|
|
|
|
gotools
|
2024-10-22 20:43:50 +02:00
|
|
|
|
goreleaser
|
2024-10-03 19:30:10 +02:00
|
|
|
|
htop
|
|
|
|
|
jq
|
|
|
|
|
pylint
|
|
|
|
|
python311
|
|
|
|
|
python311Packages.flake8
|
|
|
|
|
python311Packages.ipython
|
2024-12-21 15:08:54 +01:00
|
|
|
|
ripgrep
|
2024-10-03 19:30:10 +02:00
|
|
|
|
rusti-cal
|
|
|
|
|
roboto-mono
|
|
|
|
|
silver-searcher
|
|
|
|
|
shellcheck
|
2024-12-04 11:36:12 +01:00
|
|
|
|
sops
|
2024-12-21 01:30:34 +01:00
|
|
|
|
(nerdfonts.override { fonts = [
|
2024-12-20 09:19:48 +01:00
|
|
|
|
"JetBrainsMono"
|
|
|
|
|
"RobotoMono"
|
|
|
|
|
]; })
|
2024-10-03 19:30:10 +02:00
|
|
|
|
];
|
|
|
|
|
fonts.fontconfig.enable = true;
|
2024-09-29 21:36:36 +02:00
|
|
|
|
|
2024-10-03 19:30:10 +02:00
|
|
|
|
programs.fish = {
|
2024-09-29 21:36:36 +02:00
|
|
|
|
enable = true;
|
2024-10-03 19:30:10 +02:00
|
|
|
|
# disable greeting
|
|
|
|
|
shellInit = ''
|
|
|
|
|
set fish_greeting
|
|
|
|
|
fish_add_path ~/bin/
|
|
|
|
|
fish_add_path ~/go/bin/
|
|
|
|
|
export DEBFULLNAME="Johannes Rothe"
|
|
|
|
|
export DEBEMAIL="${mail}"
|
2024-12-21 18:38:18 +01:00
|
|
|
|
export GIT_EDITOR="nvim"
|
2024-10-03 19:30:10 +02:00
|
|
|
|
export GIT_AUTHOR_NAME="Johannes Rothe"
|
|
|
|
|
export GIT_AUTHOR_EMAIL="${mail}"
|
|
|
|
|
export GIT_COMMITTER_NAME="Johannes Rothe"
|
|
|
|
|
export GIT_COMMITTER_EMAIL="${mail}"
|
|
|
|
|
export VAULT_ADDR="https://passwords.magazino.eu:8201"
|
2024-12-20 09:05:30 +01:00
|
|
|
|
export NIX_PATH=$HOME/.nix-defexpr/channels
|
2024-10-03 19:30:10 +02:00
|
|
|
|
'';
|
|
|
|
|
shellAliases = {
|
|
|
|
|
"..." = "cd ../..";
|
|
|
|
|
"cds" = "cd ~/src/";
|
2024-10-04 16:18:35 +02:00
|
|
|
|
"cdc" = "cd ~/catkin_ws/src/";
|
2024-10-03 19:30:10 +02:00
|
|
|
|
"ll" = "ls -lh";
|
|
|
|
|
"cal" = "rusti-cal --color -w";
|
|
|
|
|
"ip" = "ip -c";
|
2024-10-14 10:41:37 +02:00
|
|
|
|
"preview" = "mpv av://v4l2:/dev/video0 --profile=low-latency";
|
|
|
|
|
"cam" = "gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video0";
|
2024-10-15 08:09:43 +02:00
|
|
|
|
"upd" = "sudo apt update";
|
|
|
|
|
"upg" = "sudo apt upgrade";
|
2024-11-22 20:26:34 +01:00
|
|
|
|
"gch" = "git checkout “$(git branch --all | fzf | tr -d ‘[:space:]’)”";
|
2024-10-03 19:30:10 +02:00
|
|
|
|
};
|
2024-09-29 21:36:36 +02:00
|
|
|
|
};
|
2024-10-03 19:30:10 +02:00
|
|
|
|
|
|
|
|
|
programs.git = {
|
2024-09-29 21:36:36 +02:00
|
|
|
|
enable = true;
|
2024-10-03 19:30:10 +02:00
|
|
|
|
userEmail = "${mail}";
|
|
|
|
|
userName = "Johannes Rothe";
|
|
|
|
|
aliases = {
|
|
|
|
|
a = "add";
|
|
|
|
|
ci = "commit";
|
|
|
|
|
ca = "commit --amend --no-edit";
|
2024-10-22 22:45:18 +02:00
|
|
|
|
ds = "diff --staged";
|
|
|
|
|
df = "diff";
|
2024-10-03 19:30:10 +02:00
|
|
|
|
st = "status";
|
|
|
|
|
co = "checkout";
|
|
|
|
|
br = "branch";
|
2024-10-16 15:14:47 +02:00
|
|
|
|
p = "pull -r";
|
2024-10-03 19:30:10 +02:00
|
|
|
|
};
|
|
|
|
|
lfs = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
difftastic = {
|
|
|
|
|
enable = true;
|
|
|
|
|
background = "dark";
|
|
|
|
|
};
|
|
|
|
|
extraConfig = {
|
|
|
|
|
core = {
|
|
|
|
|
editor = "vim";
|
|
|
|
|
};
|
2024-09-29 21:36:36 +02:00
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
2024-10-03 19:30:10 +02:00
|
|
|
|
programs.tmux = {
|
|
|
|
|
enable = true;
|
|
|
|
|
prefix = "C-a";
|
|
|
|
|
historyLimit = 150000;
|
|
|
|
|
keyMode = "vi";
|
|
|
|
|
customPaneNavigationAndResize = true;
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
bind-key Space next-window
|
|
|
|
|
|
|
|
|
|
set -g status-right '#[fg=colour242]#S'
|
|
|
|
|
set -g status-left ' '
|
|
|
|
|
set -g window-status-format '#I:#W'
|
|
|
|
|
set -g window-status-current-format '#I:#W'
|
|
|
|
|
set -g allow-rename off
|
|
|
|
|
|
2024-10-07 22:44:44 +02:00
|
|
|
|
# Start windows and panes at 1, not 0
|
|
|
|
|
set -g base-index 1
|
|
|
|
|
setw -g pane-base-index 1
|
|
|
|
|
|
2024-10-03 19:30:10 +02:00
|
|
|
|
# default statusbar colors
|
|
|
|
|
set-option -g status-style bg=colour232,fg=colour239,default
|
|
|
|
|
|
|
|
|
|
# border
|
|
|
|
|
set -g pane-border-style fg=colour234,bg=default
|
|
|
|
|
set -g pane-active-border-style fg=colour236,bg=default
|
|
|
|
|
|
|
|
|
|
# active window title colors
|
|
|
|
|
set-window-option -g window-status-current-style fg=colour231,bg=default
|
|
|
|
|
set-window-option -g window-status-style fg=colour239,bg=default
|
|
|
|
|
|
|
|
|
|
# bell
|
|
|
|
|
set-window-option -g window-status-bell-style fg=colour232,bg=colour253
|
|
|
|
|
|
|
|
|
|
# Correct colors
|
|
|
|
|
set -g default-terminal "tmux-256color"
|
|
|
|
|
set -ga terminal-overrides ",*256col*:Tc"
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-09-29 21:36:36 +02:00
|
|
|
|
|
2024-10-03 19:30:10 +02:00
|
|
|
|
programs.vim = {
|
|
|
|
|
enable = true;
|
|
|
|
|
defaultEditor = true;
|
|
|
|
|
# List of supported plugins: nix-env -f '<nixpkgs>' -qaP -A vimPlugins
|
|
|
|
|
# TODO Black plugin missing
|
|
|
|
|
plugins = [
|
|
|
|
|
pkgs.vimPlugins.ale
|
2024-10-04 08:17:13 +02:00
|
|
|
|
pkgs.vimPlugins.committia
|
2024-10-03 19:30:10 +02:00
|
|
|
|
pkgs.vimPlugins.gitgutter
|
|
|
|
|
pkgs.vimPlugins.indentLine
|
2024-10-04 16:15:15 +02:00
|
|
|
|
pkgs.vimPlugins.polyglot
|
2024-10-03 19:30:10 +02:00
|
|
|
|
pkgs.vimPlugins.nerdtree
|
|
|
|
|
pkgs.vimPlugins.rainbow
|
|
|
|
|
pkgs.vimPlugins.sonokai
|
|
|
|
|
pkgs.vimPlugins.vim-airline
|
|
|
|
|
pkgs.vimPlugins.vim-devicons
|
|
|
|
|
pkgs.vimPlugins.vim-go
|
|
|
|
|
pkgs.vimPlugins.vim-hcl
|
|
|
|
|
pkgs.vimPlugins.vim-isort
|
|
|
|
|
pkgs.vimPlugins.vim-terraform
|
|
|
|
|
pkgs.vimPlugins.YouCompleteMe
|
|
|
|
|
];
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
set number
|
2024-10-04 16:15:15 +02:00
|
|
|
|
set nocompatible
|
2024-10-03 19:30:10 +02:00
|
|
|
|
set colorcolumn=88
|
|
|
|
|
set background=dark
|
|
|
|
|
set cursorline
|
|
|
|
|
set encoding=utf-8
|
|
|
|
|
|
|
|
|
|
" Theme
|
|
|
|
|
if has('termguicolors')
|
|
|
|
|
set termguicolors
|
|
|
|
|
endif
|
|
|
|
|
let g:sonokai_style = "atlantis"
|
|
|
|
|
let g:sonokai_disable_italic_comment = 1
|
|
|
|
|
colorscheme sonokai
|
|
|
|
|
let g:airline_theme = "sonokai"
|
|
|
|
|
|
|
|
|
|
" Filetypes
|
|
|
|
|
au BufNewFile,BufRead *.launch set filetype=xml
|
|
|
|
|
|
|
|
|
|
augroup indent
|
|
|
|
|
autocmd FileType python,go,dockerfile,js,toml :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
|
|
|
|
|
autocmd FileType terraform,sh,json,yaml,html,css :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
|
|
|
|
|
augroup end
|
|
|
|
|
|
|
|
|
|
augroup spell
|
|
|
|
|
autocmd FileType gitcommit :set spell
|
2024-11-02 11:06:40 +01:00
|
|
|
|
autocmd FileType git :set nospell
|
2024-10-03 19:30:10 +02:00
|
|
|
|
autocmd FileType markdown :set spell
|
|
|
|
|
augroup end
|
|
|
|
|
|
|
|
|
|
augroup shortcuts
|
|
|
|
|
autocmd FileType terraform nnoremap <F9> :! terraform fmt<CR>
|
|
|
|
|
autocmd FileType python nnoremap <F9> :Black<CR> :Isort <CR>
|
|
|
|
|
autocmd FileType go nnoremap <F9> <Plug>(go-fmt)<Plug>(go-lint)
|
|
|
|
|
autocmd FileType go nnoremap <F7> <Plug>(go-build)
|
|
|
|
|
autocmd FileType go nnoremap <F8> <Plug>(go-run)
|
|
|
|
|
autocmd FileType go nnoremap gd <Plug>(go-def)
|
|
|
|
|
augroup end
|
|
|
|
|
|
|
|
|
|
" Ale
|
|
|
|
|
let g:ale_linters = {'python': ['flake8', 'mypy'],'javascript': ['eslint']}
|
|
|
|
|
let g:ale_fixers = {'python': ['black', 'isort']}
|
|
|
|
|
let g:ale_python_pylint_options = '--disable=C0111,C0114'
|
|
|
|
|
|
|
|
|
|
" YouCompleteMe
|
|
|
|
|
let g:ycm_gopls_binary_path = "${pkgs.gopls}/bin/gopls"
|
|
|
|
|
|
|
|
|
|
" Black
|
|
|
|
|
let g:black_linelength = 88
|
|
|
|
|
|
|
|
|
|
" NERDTREE
|
|
|
|
|
" open nerdtree when no file is specified on startup
|
|
|
|
|
autocmd StdinReadPre * let s:std_in=1
|
|
|
|
|
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
|
|
|
|
" toggle nerdtree keyboard shortcut
|
|
|
|
|
map <C-t> :NERDTreeToggle<CR>
|
|
|
|
|
|
|
|
|
|
" Devicons
|
|
|
|
|
let g:webdevicons_conceal_nerdtree_brackets = 1
|
|
|
|
|
syntax enable
|
|
|
|
|
if exists("g:loaded_webdevicons")
|
|
|
|
|
call webdevicons#refresh()
|
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
" terraform
|
|
|
|
|
let g:terraform_fmt_on_save = 1
|
|
|
|
|
let g:terraform_align = 1
|
2024-10-22 21:33:49 +02:00
|
|
|
|
|
|
|
|
|
hi clear SpellBad
|
|
|
|
|
hi SpellBad cterm=underline ctermfg=red
|
2024-10-03 19:30:10 +02:00
|
|
|
|
'';
|
|
|
|
|
};
|
2024-09-29 21:36:36 +02:00
|
|
|
|
|
2024-10-03 19:30:10 +02:00
|
|
|
|
programs.ssh = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraConfig = ''
|
|
|
|
|
AddKeysToAgent yes
|
|
|
|
|
SendEnv GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
|
|
|
|
|
'';
|
|
|
|
|
};
|
2024-09-29 21:36:36 +02:00
|
|
|
|
|
2024-10-03 19:30:10 +02:00
|
|
|
|
programs.newsboat = {
|
|
|
|
|
enable = true;
|
|
|
|
|
extraConfig = "
|
|
|
|
|
urls-source \"miniflux\"\n
|
|
|
|
|
miniflux-url \"https://feeds.johannes-rothe.de/\"\n
|
|
|
|
|
miniflux-login \"johannes\"\n
|
|
|
|
|
miniflux-passwordfile ~/.minifluxpw\n
|
|
|
|
|
";
|
|
|
|
|
};
|
2024-10-14 09:26:52 +02:00
|
|
|
|
|
|
|
|
|
programs.direnv = {
|
|
|
|
|
enable = true;
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-28 21:50:39 +01:00
|
|
|
|
home.file = {
|
|
|
|
|
"${config.xdg.configHome}/ghostty/config".source = ./ghostty/config;
|
|
|
|
|
};
|
|
|
|
|
|
2024-12-21 01:30:34 +01:00
|
|
|
|
# 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 should not change this value, even if you update Home Manager. If you do
|
|
|
|
|
# want to update the value, then make sure to first check the Home Manager
|
|
|
|
|
# release notes.
|
|
|
|
|
home.stateVersion = "23.05"; # Please read the comment before changing.
|
2024-09-29 21:36:36 +02:00
|
|
|
|
|
2024-12-21 01:30:34 +01:00
|
|
|
|
# Let Home Manager install and manage itself.
|
|
|
|
|
programs.home-manager.enable = true;
|
|
|
|
|
};
|
|
|
|
|
}
|