Make mail configurable
Inspired by: https://librephoenix.com/2024-01-28-program-a-modular-control-center-for-your-config-using-special-args-in-nixos-flakes.html
This commit is contained in:
parent
f639fb31b9
commit
875c360794
@ -29,18 +29,27 @@
|
|||||||
./home/rothe.nix
|
./home/rothe.nix
|
||||||
./home/wayland
|
./home/wayland
|
||||||
];
|
];
|
||||||
|
extraSpecialArgs = {
|
||||||
|
mail = "mail@johannes-rothe.de";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
"rothe@johannes-powermachine" = home-manager.lib.homeManagerConfiguration {
|
"rothe@johannes-powermachine" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
./home/rothe.nix
|
./home/rothe.nix
|
||||||
];
|
];
|
||||||
|
extraSpecialArgs = {
|
||||||
|
mail = "mail@johannes-rothe.de";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
"rothe@pdemu1cml000301" = home-manager.lib.homeManagerConfiguration {
|
"rothe@pdemu1cml000301" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
modules = [
|
modules = [
|
||||||
./home/rothe.nix
|
./home/rothe.nix
|
||||||
];
|
];
|
||||||
|
extraSpecialArgs = {
|
||||||
|
mail = "rothe@magazino.eu";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -1,223 +1,224 @@
|
|||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, mail, ... }:
|
||||||
|
|
||||||
{
|
{
|
||||||
home.packages = with pkgs; [
|
config = {
|
||||||
black
|
home.packages = with pkgs; [
|
||||||
go
|
black
|
||||||
gopls
|
go
|
||||||
gotools
|
gopls
|
||||||
htop
|
gotools
|
||||||
jq
|
htop
|
||||||
pylint
|
jq
|
||||||
python311
|
pylint
|
||||||
python311Packages.flake8
|
python311
|
||||||
python311Packages.ipython
|
python311Packages.flake8
|
||||||
rusti-cal
|
python311Packages.ipython
|
||||||
roboto-mono
|
rusti-cal
|
||||||
silver-searcher
|
roboto-mono
|
||||||
shellcheck
|
silver-searcher
|
||||||
(nerdfonts.override { fonts = [ "RobotoMono" ]; })
|
shellcheck
|
||||||
];
|
(nerdfonts.override { fonts = [ "RobotoMono" ]; })
|
||||||
fonts.fontconfig.enable = true;
|
];
|
||||||
|
fonts.fontconfig.enable = true;
|
||||||
|
|
||||||
programs.fish = {
|
programs.fish = {
|
||||||
enable = true;
|
|
||||||
# start sway on login
|
|
||||||
loginShellInit = ''
|
|
||||||
if test -z "$DISPLAY" -a $XDG_VTNR = 1
|
|
||||||
exec sway
|
|
||||||
end
|
|
||||||
'';
|
|
||||||
# TODO make mails configurable
|
|
||||||
# disable greeting
|
|
||||||
shellInit = ''
|
|
||||||
set fish_greeting
|
|
||||||
fish_add_path ~/bin/
|
|
||||||
fish_add_path ~/go/bin/
|
|
||||||
export DEBFULLNAME="Johannes Rothe"
|
|
||||||
export DEBEMAIL="mail@johannes-rothe.de"
|
|
||||||
export GIT_AUTHOR_NAME="Johannes Rothe"
|
|
||||||
export GIT_AUTHOR_EMAIL="rothe@magazino.eu"
|
|
||||||
export GIT_COMMITTER_NAME="Johannes Rothe"
|
|
||||||
export GIT_COMMITTER_EMAIL="rothe@magazino.eu"
|
|
||||||
export VAULT_ADDR="https://passwords.magazino.eu:8201"
|
|
||||||
'';
|
|
||||||
shellAliases = {
|
|
||||||
"..." = "cd ../..";
|
|
||||||
"cds" = "cd ~/src/";
|
|
||||||
"ll" = "ls -lh";
|
|
||||||
"cal" = "rusti-cal --color -w";
|
|
||||||
"ip" = "ip -c";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
enable = true;
|
|
||||||
userEmail = "mail@johannes-rothe.de";
|
|
||||||
userName = "Johannes Rothe";
|
|
||||||
aliases = {
|
|
||||||
a = "add";
|
|
||||||
ci = "commit";
|
|
||||||
ca = "commit --amend --no-edit";
|
|
||||||
st = "status";
|
|
||||||
co = "checkout";
|
|
||||||
br = "branch";
|
|
||||||
};
|
|
||||||
lfs = {
|
|
||||||
enable = true;
|
enable = true;
|
||||||
};
|
# start sway on login
|
||||||
difftastic = {
|
loginShellInit = ''
|
||||||
enable = true;
|
if test -z "$DISPLAY" -a $XDG_VTNR = 1
|
||||||
background = "dark";
|
exec sway
|
||||||
};
|
end
|
||||||
extraConfig = {
|
'';
|
||||||
core = {
|
# disable greeting
|
||||||
editor = "vim";
|
shellInit = ''
|
||||||
|
set fish_greeting
|
||||||
|
fish_add_path ~/bin/
|
||||||
|
fish_add_path ~/go/bin/
|
||||||
|
export DEBFULLNAME="Johannes Rothe"
|
||||||
|
export DEBEMAIL="${mail}"
|
||||||
|
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"
|
||||||
|
'';
|
||||||
|
shellAliases = {
|
||||||
|
"..." = "cd ../..";
|
||||||
|
"cds" = "cd ~/src/";
|
||||||
|
"ll" = "ls -lh";
|
||||||
|
"cal" = "rusti-cal --color -w";
|
||||||
|
"ip" = "ip -c";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
programs.tmux = {
|
programs.git = {
|
||||||
enable = true;
|
enable = true;
|
||||||
prefix = "C-a";
|
userEmail = "${mail}";
|
||||||
historyLimit = 150000;
|
userName = "Johannes Rothe";
|
||||||
keyMode = "vi";
|
aliases = {
|
||||||
customPaneNavigationAndResize = true;
|
a = "add";
|
||||||
extraConfig = ''
|
ci = "commit";
|
||||||
bind-key Space next-window
|
ca = "commit --amend --no-edit";
|
||||||
|
st = "status";
|
||||||
|
co = "checkout";
|
||||||
|
br = "branch";
|
||||||
|
};
|
||||||
|
lfs = {
|
||||||
|
enable = true;
|
||||||
|
};
|
||||||
|
difftastic = {
|
||||||
|
enable = true;
|
||||||
|
background = "dark";
|
||||||
|
};
|
||||||
|
extraConfig = {
|
||||||
|
core = {
|
||||||
|
editor = "vim";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
set -g status-right '#[fg=colour242]#S'
|
programs.tmux = {
|
||||||
set -g status-left ' '
|
enable = true;
|
||||||
set -g window-status-format '#I:#W'
|
prefix = "C-a";
|
||||||
set -g window-status-current-format '#I:#W'
|
historyLimit = 150000;
|
||||||
set -g allow-rename off
|
keyMode = "vi";
|
||||||
|
customPaneNavigationAndResize = true;
|
||||||
|
extraConfig = ''
|
||||||
|
bind-key Space next-window
|
||||||
|
|
||||||
# default statusbar colors
|
set -g status-right '#[fg=colour242]#S'
|
||||||
set-option -g status-style bg=colour232,fg=colour239,default
|
set -g status-left ' '
|
||||||
|
set -g window-status-format '#I:#W'
|
||||||
|
set -g window-status-current-format '#I:#W'
|
||||||
|
set -g allow-rename off
|
||||||
|
|
||||||
# border
|
# default statusbar colors
|
||||||
set -g pane-border-style fg=colour234,bg=default
|
set-option -g status-style bg=colour232,fg=colour239,default
|
||||||
set -g pane-active-border-style fg=colour236,bg=default
|
|
||||||
|
|
||||||
# active window title colors
|
# border
|
||||||
set-window-option -g window-status-current-style fg=colour231,bg=default
|
set -g pane-border-style fg=colour234,bg=default
|
||||||
set-window-option -g window-status-style fg=colour239,bg=default
|
set -g pane-active-border-style fg=colour236,bg=default
|
||||||
|
|
||||||
# bell
|
# active window title colors
|
||||||
set-window-option -g window-status-bell-style fg=colour232,bg=colour253
|
set-window-option -g window-status-current-style fg=colour231,bg=default
|
||||||
|
set-window-option -g window-status-style fg=colour239,bg=default
|
||||||
|
|
||||||
# Correct colors
|
# bell
|
||||||
set -g default-terminal "tmux-256color"
|
set-window-option -g window-status-bell-style fg=colour232,bg=colour253
|
||||||
set -ga terminal-overrides ",*256col*:Tc"
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.vim = {
|
# Correct colors
|
||||||
enable = true;
|
set -g default-terminal "tmux-256color"
|
||||||
defaultEditor = true;
|
set -ga terminal-overrides ",*256col*:Tc"
|
||||||
# List of supported plugins: nix-env -f '<nixpkgs>' -qaP -A vimPlugins
|
'';
|
||||||
# TODO Black plugin missing
|
};
|
||||||
plugins = [
|
|
||||||
pkgs.vimPlugins.ale
|
|
||||||
pkgs.vimPlugins.gitgutter
|
|
||||||
pkgs.vimPlugins.indentLine
|
|
||||||
pkgs.vimPlugins.nerdtree
|
|
||||||
pkgs.vimPlugins.python-syntax
|
|
||||||
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
|
|
||||||
set colorcolumn=88
|
|
||||||
set background=dark
|
|
||||||
set cursorline
|
|
||||||
set encoding=utf-8
|
|
||||||
|
|
||||||
" Theme
|
programs.vim = {
|
||||||
if has('termguicolors')
|
enable = true;
|
||||||
set termguicolors
|
defaultEditor = true;
|
||||||
endif
|
# List of supported plugins: nix-env -f '<nixpkgs>' -qaP -A vimPlugins
|
||||||
let g:sonokai_style = "atlantis"
|
# TODO Black plugin missing
|
||||||
let g:sonokai_disable_italic_comment = 1
|
plugins = [
|
||||||
colorscheme sonokai
|
pkgs.vimPlugins.ale
|
||||||
let g:airline_theme = "sonokai"
|
pkgs.vimPlugins.gitgutter
|
||||||
|
pkgs.vimPlugins.indentLine
|
||||||
|
pkgs.vimPlugins.nerdtree
|
||||||
|
pkgs.vimPlugins.python-syntax
|
||||||
|
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
|
||||||
|
set colorcolumn=88
|
||||||
|
set background=dark
|
||||||
|
set cursorline
|
||||||
|
set encoding=utf-8
|
||||||
|
|
||||||
" Filetypes
|
" Theme
|
||||||
au BufNewFile,BufRead *.launch set filetype=xml
|
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"
|
||||||
|
|
||||||
augroup indent
|
" Filetypes
|
||||||
autocmd FileType python,go,dockerfile,js,toml :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
|
au BufNewFile,BufRead *.launch set filetype=xml
|
||||||
autocmd FileType terraform,sh,json,yaml,html,css :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
|
|
||||||
augroup end
|
|
||||||
|
|
||||||
augroup spell
|
augroup indent
|
||||||
autocmd FileType gitcommit :set spell
|
autocmd FileType python,go,dockerfile,js,toml :set tabstop=4 softtabstop=4 shiftwidth=4 expandtab autoindent fileformat=unix
|
||||||
autocmd FileType markdown :set spell
|
autocmd FileType terraform,sh,json,yaml,html,css :set tabstop=2 softtabstop=2 shiftwidth=2 expandtab autoindent fileformat=unix
|
||||||
augroup end
|
augroup end
|
||||||
|
|
||||||
augroup shortcuts
|
augroup spell
|
||||||
autocmd FileType terraform nnoremap <F9> :! terraform fmt<CR>
|
autocmd FileType gitcommit :set spell
|
||||||
autocmd FileType python nnoremap <F9> :Black<CR> :Isort <CR>
|
autocmd FileType markdown :set spell
|
||||||
autocmd FileType go nnoremap <F9> <Plug>(go-fmt)<Plug>(go-lint)
|
augroup end
|
||||||
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
|
augroup shortcuts
|
||||||
let g:ale_linters = {'python': ['flake8', 'mypy'],'javascript': ['eslint']}
|
autocmd FileType terraform nnoremap <F9> :! terraform fmt<CR>
|
||||||
let g:ale_fixers = {'python': ['black', 'isort']}
|
autocmd FileType python nnoremap <F9> :Black<CR> :Isort <CR>
|
||||||
let g:ale_python_pylint_options = '--disable=C0111,C0114'
|
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
|
||||||
|
|
||||||
" YouCompleteMe
|
" Ale
|
||||||
let g:ycm_gopls_binary_path = "${pkgs.gopls}/bin/gopls"
|
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'
|
||||||
|
|
||||||
" Black
|
" YouCompleteMe
|
||||||
let g:black_linelength = 88
|
let g:ycm_gopls_binary_path = "${pkgs.gopls}/bin/gopls"
|
||||||
|
|
||||||
" NERDTREE
|
" Black
|
||||||
" open nerdtree when no file is specified on startup
|
let g:black_linelength = 88
|
||||||
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
|
" NERDTREE
|
||||||
let g:webdevicons_conceal_nerdtree_brackets = 1
|
" open nerdtree when no file is specified on startup
|
||||||
syntax enable
|
autocmd StdinReadPre * let s:std_in=1
|
||||||
if exists("g:loaded_webdevicons")
|
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
|
||||||
call webdevicons#refresh()
|
" toggle nerdtree keyboard shortcut
|
||||||
endif
|
map <C-t> :NERDTreeToggle<CR>
|
||||||
|
|
||||||
" terraform
|
" Devicons
|
||||||
let g:terraform_fmt_on_save = 1
|
let g:webdevicons_conceal_nerdtree_brackets = 1
|
||||||
let g:terraform_align = 1
|
syntax enable
|
||||||
'';
|
if exists("g:loaded_webdevicons")
|
||||||
};
|
call webdevicons#refresh()
|
||||||
|
endif
|
||||||
|
|
||||||
programs.ssh = {
|
" terraform
|
||||||
enable = true;
|
let g:terraform_fmt_on_save = 1
|
||||||
extraConfig = ''
|
let g:terraform_align = 1
|
||||||
AddKeysToAgent yes
|
'';
|
||||||
SendEnv GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
|
};
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.newsboat = {
|
programs.ssh = {
|
||||||
enable = true;
|
enable = true;
|
||||||
extraConfig = "
|
extraConfig = ''
|
||||||
urls-source \"miniflux\"\n
|
AddKeysToAgent yes
|
||||||
miniflux-url \"https://feeds.johannes-rothe.de/\"\n
|
SendEnv GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
|
||||||
miniflux-login \"johannes\"\n
|
'';
|
||||||
miniflux-passwordfile ~/.minifluxpw\n
|
};
|
||||||
";
|
|
||||||
|
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
|
||||||
|
";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user