diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..4f5946d --- /dev/null +++ b/flake.nix @@ -0,0 +1,46 @@ +{ + inputs = { + home-manager = { + url = "github:nix-community/home-manager"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + nixpkgs = { + url = "github:nixos/nixpkgs/nixos-unstable"; + }; + flake-utils = { + url = "github:numtide/flake-utils"; + }; + }; + outputs = inputs: { + nixosConfigurations = { + w1n5t0n = import ./machines/w1n5t0n.nix inputs; + }; + homeConfigurations = { + me = inputs.home-manager.lib.homeManagerConfiguration { + system = "x86_64-linux"; + username = "me"; + homeDirectory = "/home/me"; + extraSpecialArgs = { + inherit inputs; + system = "x86_64-linux"; + hostname = "w1n5t0n"; + }; + configuration.imports = [ ./users/me.nix ]; + }; + }; + } + // + inputs.flake-utils.lib.eachDefaultSystem (system: + let pkgs = import inputs.nixpkgs { + inherit system; + }; + in + { + devShell = pkgs.mkShell { + packages = with pkgs; [ + inputs.home-manager.defaultPackage.${system}; + ]; + } + } + ); +} diff --git a/home/bat.nix b/home/bat.nix new file mode 100644 index 0000000..7b5e139 --- /dev/null +++ b/home/bat.nix @@ -0,0 +1,3 @@ +{ ... }: { + programs.bat.enable = true; +} diff --git a/home/default.nix b/home/default.nix new file mode 100644 index 0000000..d5336da --- /dev/null +++ b/home/default.nix @@ -0,0 +1,33 @@ +user: +{ ... }: { + imports = [ + ./bat.nix + ./direnv.nix + ./dunst.nix + ./feh.nix + ./firefox.nix + ./flameshot.nix + ./fzf.nix + ./gnome-keyring.nix + (import ./git.nix user) + ./go.nix + ./htop.nix + ./i3.nix + ./lsd.nix + ./man.nix + ./neovim.nix + ./nextcloud.nix + ./pasystray.nix + ./picom.nix + ./polybar.nix + ./programs.nix + ./qt.nix + ./redshift.nix + ./rofi.nix + ./rust.nix + ./tmux.nix + ./xdg.nix + ./zathura.nix + ./zsh.nix + ]; +} diff --git a/home/direnv.nix b/home/direnv.nix new file mode 100644 index 0000000..34c4d8c --- /dev/null +++ b/home/direnv.nix @@ -0,0 +1,14 @@ +{ ... }: { + programs.direnv = { + enable = true; + enableZshIntegration = true; + nix-direnv = { + enable = true; + }; + }; + + xdg.configFile."direnv/config.toml".text = '' + [global] + warn_timeout = "1000s" + ''; +} diff --git a/home/dunst.nix b/home/dunst.nix new file mode 100644 index 0000000..0ac9251 --- /dev/null +++ b/home/dunst.nix @@ -0,0 +1,58 @@ +{ pkgs, ... }: { + services.dunst = { + enable = true; + settings = { + global = { + font = "Monospace 8"; + allow_markup = true; + format = "%a: %s\n%b"; + sort = true; + indicate_hidden = true; + alignment = "left"; + bounce_freq = 0; + show_age_threshold = 60; + word_wrap = true; + ignore_newline = false; + geometry = "300x5-30+20"; + transparency = 0; + idle_threshold = 120; + monitor = 0; + follow = "keyboard"; + sticky_history = true; + line_height = 0; + separator_height = 2; + padding = 8; + horizontal_padding = 8; + separator_color = "frame"; + startup_notification = true; + dmenu = "dmenu -p dunst:"; + browser = "firefox -new-tab"; + }; + frame = { + width = 0; + color = "#000000"; + }; + shortcuts = { + close = "mod4+m"; + close_all = "mod4+shift+m"; + history = "mod4+n"; + context = "mod4+shift+i"; + }; + urgency_low = { + background = "#222222"; + foreground = "#888888"; + timeout = 10; + }; + urgency_normal = { + background = "#285577"; + foreground = "#ffffff"; + timeout = 10; + }; + urgency_critical = { + background = "#900000"; + foreground = "#ffffff"; + timeout = 0; + }; + }; + }; +} diff --git a/home/feh.nix b/home/feh.nix new file mode 100644 index 0000000..c1c2949 --- /dev/null +++ b/home/feh.nix @@ -0,0 +1,3 @@ +{ ... }: { + programs.feh.enable = true; +} diff --git a/home/firefox.nix b/home/firefox.nix new file mode 100644 index 0000000..3e0f362 --- /dev/null +++ b/home/firefox.nix @@ -0,0 +1,5 @@ +{ pkgs, ... }: { + programs.firefox = { + enable = true; + }; +} diff --git a/home/flameshot.nix b/home/flameshot.nix new file mode 100644 index 0000000..ecc3823 --- /dev/null +++ b/home/flameshot.nix @@ -0,0 +1,3 @@ +{ ... }: { + services.flameshot.enable = true; +} diff --git a/home/fzf.nix b/home/fzf.nix new file mode 100644 index 0000000..45521ed --- /dev/null +++ b/home/fzf.nix @@ -0,0 +1,8 @@ +{ ... }: { + programs.fzf = { + enable = true; + enableZshIntegration = true; + fileWidgetCommand = "fd --type f --no-ignore"; + historyWidgedOptions = [ "--reverse" "--sort" "--exact" ]; + }; +} diff --git a/home/git.nix b/home/git.nix new file mode 100644 index 0000000..db57843 --- /dev/null +++ b/home/git.nix @@ -0,0 +1,25 @@ +user: +{ ... }: { + programs.git = { + enable = true; + userName = user.git.name; + userEmail = user.git.email; + delta = { + enable = true; + options = { + theme = "base16"; + }; + }; + extraConfig = { + diff = { + compactionHeuristic = true; + }; + pull = { + rebase = true; + }; + push = { + default = "simple"; + }; + }; + }; +} diff --git a/home/gnome-keyring.nix b/home/gnome-keyring.nix new file mode 100644 index 0000000..0da9c9f --- /dev/null +++ b/home/gnome-keyring.nix @@ -0,0 +1,10 @@ +{ ... }: { + services.gnome-keyring = { + enable = true; + components = [ + "pkcs11" + "secrets" + # "ssh" + ]; + }; +} diff --git a/home/go.nix b/home/go.nix new file mode 100644 index 0000000..8549531 --- /dev/null +++ b/home/go.nix @@ -0,0 +1,3 @@ +{ ... }: { + programs.go.enable = true; +} diff --git a/home/htop.nix b/home/htop.nix new file mode 100644 index 0000000..f29051f --- /dev/null +++ b/home/htop.nix @@ -0,0 +1,13 @@ +{ ... }: { + programs.htop = { + enable = true; + settings = { + hide_kernel_threads = true; + hide_threads = true; + hide_userland_threads = true; + show_program_path = false; + tree_view = true; + vim_mode = true; + }; + }; +} diff --git a/home/i3.nix b/home/i3.nix new file mode 100644 index 0000000..2b2496a --- /dev/null +++ b/home/i3.nix @@ -0,0 +1,157 @@ +{ lib, pkgs, ... }: +let + mod = "Mod4"; + ws1 = "1: "; + ws2 = "2: "; + ws3 = "3: "; + ws4 = "4: "; + ws5 = "5: "; + ws6 = "6: "; + ws7 = "7: "; + ws8 = "8"; + ws9 = "9"; + ws10 = "10: "; + + mode_system = "System: L :  | S :  | P :  | R :  | E : "; +in { + xsession.windowManager.i3 = { + enable = true; + # package = pkgs.i3-gaps; + config = { + modifier = mod; + + workspaceAutoBackAndForth = true; + + fonts = { + names = [ "NotoSans-Regular" "FontAwesome" ]; + style = "Monospace"; + size = 12.0; + }; + + # disable titlebar + focus.newWindow = "none"; + + assigns = { + "${ws1}" = [ + { class = "^Firefox$"; } + { class = "firefox"; } + { class = "Firefox"; } + ]; + "${ws4}" = [{ class="Pidgin"; }]; + "${ws5}" = [{ class="Thunar"; }]; + "${ws6}" = [{ class="libreoffice-startcenter"; }]; + "${ws7}" = [{ class="Thunderbird"; }]; + }; + + floating = { + criteria = [ + { window_role = "pop-up"; } + { window_role = "task_dialog"; } + { title = "Preferences$"; } + { class = "Keepassx2"; } + { class = "keepassxc"; } + { class = "KeePassXC"; } + { class = "^Pavucontrol$"; } + { class = "^Pinentry-gtk-2$"; } + ]; + }; + + keybindings = lib.mkOptionDefault { + "${mod}+Return" = "exec termite"; + "${mod}+Shift+q" = "kill"; + "${mod}+h" = "focus left"; + "${mod}+j" = "focus down"; + "${mod}+k" = "focus up"; + "${mod}+l" = "focus right"; + "${mod}+Left" = "focus left"; + "${mod}+Down" = "focus down"; + "${mod}+Up" = "focus up"; + "${mod}+Right" = "focus right"; + "${mod}+Shift+h" = "move left"; + "${mod}+Shift+j" = "move down"; + "${mod}+Shift+k" = "move up"; + "${mod}+Shift+l" = "move right"; + "${mod}+Shift+Left" = "move left"; + "${mod}+Shift+Down" = "move down"; + "${mod}+Shift+Up" = "move up"; + "${mod}+Shift+Right" = "move right"; + "${mod}+b" = "split h"; + "${mod}+v" = "split v"; + "${mod}+f" = "fullscreen toggle"; + "${mod}+s" = "layout stacking"; + "${mod}+w" = "layout tabbed"; + "${mod}+e" = "layout toggle split"; + "${mod}+Shift+space" = "floating toggle"; + "${mod}+space" = "focus mode_toggle"; + "${mod}+a" = "focus parent"; + "${mod}+d" = "exec rofi -show drun -matching fuzzy"; + "${mod}+Tab" = "exec rofi -show window -matching fuzzy"; + + "${mod}+1" = "workspace ${ws1}"; + "${mod}+2" = "workspace ${ws2}"; + "${mod}+3" = "workspace ${ws3}"; + "${mod}+4" = "workspace ${ws4}"; + "${mod}+5" = "workspace ${ws5}"; + "${mod}+6" = "workspace ${ws6}"; + "${mod}+7" = "workspace ${ws7}"; + "${mod}+8" = "workspace ${ws8}"; + "${mod}+9" = "workspace ${ws9}"; + "${mod}+0" = "workspace ${ws10}"; + "${mod}+Shift+1" = "move container to workspace ${ws1}"; + "${mod}+Shift+2" = "move container to workspace ${ws2}"; + "${mod}+Shift+3" = "move container to workspace ${ws3}"; + "${mod}+Shift+4" = "move container to workspace ${ws4}"; + "${mod}+Shift+5" = "move container to workspace ${ws5}"; + "${mod}+Shift+6" = "move container to workspace ${ws6}"; + "${mod}+Shift+7" = "move container to workspace ${ws7}"; + "${mod}+Shift+8" = "move container to workspace ${ws8}"; + "${mod}+Shift+9" = "move container to workspace ${ws9}"; + "${mod}+Shift+0" = "move container to workspace ${ws10}"; + + "${mod}+Shift+c" = "reload"; + "${mod}+Shift+r" = "restart"; + "${mod}+Shift+e" = "exec \"i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -b 'Yes, exit i3' 'i3-msg exit'\""; + + "${mod}+r" = "mode \"resize\""; + "${mod}+x" = "mode \"${mode_system}\""; + + "${mod}+Shift+x" = "exec i3lock-fancy -n"; + }; + + modes = { + resize = { + h = "resize shrink width 10 px or 10 ppt"; + j = "resize grow height 10 px or 10 ppt"; + k = "resize shrink height 10 px or 10 ppt"; + l = "resize grow width 10 px or 10 ppt"; + + Left = "resize shrink width 10 px or 10 ppt"; + Down = "resize grow height 10 px or 10 ppt"; + Up = "resize shrink height 10 px or 10 ppt"; + Right = "resize grow width 10 px or 10 ppt"; + + Return = "mode \"default\""; + Escape = "mode \"default\""; + }; + "${mode_system}" = { + l = "exec ~/bin/lock.sh, mode \"default\""; + s = "exec $Lock systemctl suspend, mode \"default\""; + p = "exec systemctl poweroff -i, mode \"default\""; + r = "exec systemctl reboot, mode \"default\""; + e = "exec i3-msg exit, mode \"default\""; + + # back to normal: Enter or Escape or mod+x again + Return = "mode \"default\""; + Escape = "mode \"default\""; + "${mod}+x" = "mode \"default\""; + }; + }; + window = { + hideEdgeBorders = "both"; + titlebar = false; + }; + }; + + }; +} + diff --git a/home/lsd.nix b/home/lsd.nix new file mode 100644 index 0000000..71971a7 --- /dev/null +++ b/home/lsd.nix @@ -0,0 +1,6 @@ +{ ... }: { + programs.lsd = { + enable = true; + enableAliases = true; + }; +} diff --git a/home/man.nix b/home/man.nix new file mode 100644 index 0000000..04583b4 --- /dev/null +++ b/home/man.nix @@ -0,0 +1,6 @@ +{ ... }: { + programs.man = { + enable = true; + generateCaches = true; + }; +} diff --git a/home/neovim.nix b/home/neovim.nix new file mode 100644 index 0000000..63d445f --- /dev/null +++ b/home/neovim.nix @@ -0,0 +1,452 @@ +{ pkgs, ... }: +let + config = { + plugins = with pkgs.vimPlugins; [ + vim-colors-solarized + + coc-nvim + coc-rust-analyzer + coc-pyright + coc-go + + ctrlp-vim + editorconfig-vim + vim-gist + goyo-vim + # gopls + neomake + rust-vim + solarized + vim-commentary + vim-dispatch + vim-fugitive + vim-gitgutter + vim-lastplace + vim-nix + vim-polyglot + vim-repeat + # vim-scala + vim-sleuth + vim-surround + vim-trailing-whitespace + # vimtex + vimux + vimwiki + ]; + enable = true; + extraConfig = '' + set background=dark + " allow switching away from unsaved buffers + set hidden + set history=1000 + + set updatetime=300 + + set expandtab + set shiftwidth=2 + set tabstop=2 + + set ignorecase + set smartcase + + set number + set relativenumber + + set backupdir=$HOME/.vim/backupfiles// + set directory=$HOME/.vim/swapfiles// + set undodir=$HOME/.vim/undofiles// + set undofile + + set nocompatible + + filetype plugin indent on + + " always set autoindenting on + set autoindent + " smart indent; stop indent when closing brackets etc + set smartindent + " two spaces after .?! when joining lines + set joinspaces + + " highlight search result + set hlsearch + " incremental search + set incsearch + set nolazyredraw + + " delete whitespace, line break and char using + set backspace=indent,eol,start + " always show curser position + set ruler + + " yank into system clipboard + set clipboard=unnamedplus + + colorscheme solarized + " true color + set termguicolors + " make true colors work in tmux + let &t_8f = "\[38;2;%lu;%lu;%lum" + let &t_8b = "\[48;2;%lu;%lu;%lum" + + set textwidth=80 + set colorcolumn=+1 + set signcolumn=yes + " highlight current line + set cursorline + + " encoding + set fileencoding=utf-8 + + " break at last word instead of last char + set linebreak + + " autoload file changes + set autoread + + set smarttab + + set softtabstop=2 + set shiftround + + " invisible characters + set list + " set listchars=tab:â\ ,eol:¬,trail:â,extends:â¯,precedes:â® + " set showbreak=⪠+ + " code folding settings + " fold based on syntax + set foldmethod=indent + " don't fold by default + set nofoldenable + set foldlevel=1 + + " smoother redrawing + set ttyfast + " diff with vertical split + set diffopt+=vertical + " show the status line all the time + set laststatus=2 + " keep 5 lines on the screen when scrolling + set scrolloff=5 + " enhanced command line completion + set wildmenu + " Search down into subfolders + " Provides tab-completion for all file-related tasks + set path+=** + + " show incomplete commands + set showcmd + + " complete files like a shell + set wildmode=list:longest + + " command bar height + set cmdheight=1 + " set terminal title + set title + " set shortmess+=TOFwatc + set shortmess+=c + + " show matching braces + set showmatch + " how many tenths of a second to blink + set mat=2 + " set spell langs + set spelllang=de,en + + syntax enable + " let g:polyglot_disabled=['latex'] + " highlight clear SpellBad + " highlight SpellBad cterm=undercurl + + " " Only do this part when compiled with support for autocommands. + " if has("autocmd") + " " Put these in an autocmd group, so that we can delete them easily. + " augroup vimrcEx + " au! + " autocmd FileType text setlocal foldtext< + " augroup END + " endif " has("autocmd") + + " error bells + set errorbells + set visualbell + set timeoutlen=500 + + " turn on manpages (:Man) + runtime ftplugin/man.vim + + " set a map leader for more key combos + let mapleader=',' + + " clear highlighted search + noremap :nohlsearch + + " enable . command in visual mode + vnoremap . :normal . + + " make the highlighting of tabs and other non-text less annoying + highlight SpecialKey ctermbg=none ctermfg=8 + highlight NonText ctermbg=none ctermfg=8 + + " other color for popup + highlight Pmenu ctermbg=gray guibg=gray + + " ctrlp + " order top to bottom + let g:ctrlp_match_window='bottom,order::ttb' + " open files in new buffer + let g:ctrlp_switch_buffer=0 + " use ripgrep if available + if executable('rg') + set grepprg=rg\ --color=never + let g:ctrlp_user_command='rg %s --files -i --color=never --glob ""' + let g:ctrlp_use_caching=0 + endif + + " set textwidth for mails + autocmd FileType mail setlocal textwidth=72 + + " count wraped lines as one line when doing relative jumps + noremap j (v:count == 0 ? 'gj' : 'j') + noremap k (v:count == 0 ? 'gk' : 'k') + + " scroll the viewport faster + nnoremap 3 + nnoremap 3 + + "" Section AutoGroups {{{ + "" file type specific settings + augroup configgroup + autocmd! + + " automatically resize panes on resize + autocmd VimResized * exe 'normal! \=' + autocmd BufWritePost .vimrc,.vimrc.local,init.vim source % + " save all files on focus lost, ignoring warnings about untitled buffers + autocmd FocusLost * silent! wa + + " make quickfix windows take all the lower section of the screen + " when there are multiple windows open + autocmd FileType qf wincmd J + + autocmd! BufWritePost * Neomake + augroup END + " }}} + + " Append modeline after last line in buffer. + " Use substitute() instead of printf() to handle '%%s' modeline in LaTeX files. + function! AppendModeline() + let l:modeline = printf(" vim: set filetype=%s ts=%d sw=%d tw=%d %s :", + \ &filetype, &tabstop, &shiftwidth, &textwidth, &expandtab ? 'et' : 'noet') + let l:modeline = substitute(&commentstring, "%s", l:modeline, "") + call append(line("$"), l:modeline) + endfunction + nnoremap ml :call AppendModeline() + + " netrw settings + " disable banner + let g:netrw_banner=0 + " open in prior window + let g:netrw_browse_split=4 + " open splits to the right + let g:netrw_altv=1 + " treeview + let g:netrw_liststyle=3 + let g:netrw_list_hide=netrw_gitignore#Hide() + let g:netrw_list_hide.=',\(^\|\s\s\)\zs\.\S\+' + + " vimux mappings + " Prompt for a command + map vp :VimuxPromptCommand + " Prompt for a make command + map vm :VimuxPromptCommand("make ") + " Inspect runner pane + map vi :VimuxInspectRunner + " Close runner + map vq :VimuxCloseRunner + " Rerun last command + map vv :VimuxRunLastCommand + " Stop running command + map vs :VimuxInterruptRunner + + " close Goyo *and* vim with :q + function! s:goyo_enter() + let b:quitting=0 + let b:quitting_bang=0 + autocmd QuitPre let b:quitting=1 + cabbrev q! let b:quitting_bang=1 q! + endfunction + + function! s:goyo_leave() + " Quit Vim if this is the only remaining buffer + if b:quitting && len(filter(range(1, bufnr('$')), 'buflisted(v:val)')) == 1 + if b:quitting_bang + qa! + else + qa + endif + endif + endfunction + autocmd! User GoyoEnter call goyo_enter() + autocmd! User GoyoLeave call goyo_leave() + + " run rustfmt when saving a file + let g:rustfmt_autosave=1 + + au BufRead,BufNewFile *.sbt set filetype=scala + + " textwidth for emails + au BufRead /tmp/*mutt-* set tw=72 + augroup filetypedetect + " Mail + autocmd BufRead,BufNewFile *mutt-* setfiletype mail + augroup END + + + let g:coc_global_extensions = [ + \ 'coc-explorer', + \ 'coc-snippets', + \ 'coc-pairs' + \ ] + nmap ge :CocCommand explorer + " Use tab for trigger completion with characters ahead and navigate. + " Use command ':verbose imap ' to make sure tab is not mapped by other plugin. + inoremap + \ pumvisible() ? "\" : + \ check_back_space() ? "\" : + \ coc#refresh() + inoremap pumvisible() ? "\" : "\" + + function! s:check_back_space() abort + let col = col('.') - 1 + return !col || getline('.')[col - 1] =~# '\s' + endfunction + + " Use to trigger completion. + inoremap coc#refresh() + + " Use to confirm completion, `u` means break undo chain at current position. + " Coc only does snippet and additional edit on confirm. + inoremap pumvisible() ? "\" : "\u\" + " Or use `complete_info` if your vim support it, like: + " inoremap complete_info()["selected"] != "-1" ? "\" : "\u\" + + " Use `[g` and `]g` to navigate diagnostics + nmap [g (coc-diagnostic-prev) + nmap ]g (coc-diagnostic-next) + + " Remap keys for gotos + nmap gd (coc-definition) + nmap gy (coc-type-definition) + nmap gi (coc-implementation) + nmap gr (coc-references) + + " Use K to show documentation in preview window + nnoremap K :call show_documentation() + + function! s:show_documentation() + if (index(['vim','help'], &filetype) >= 0) + execute 'h '.expand('') + else + call CocAction('doHover') + endif + endfunction + + " Highlight symbol under cursor on CursorHold + autocmd CursorHold * silent call CocActionAsync('highlight') + + " Remap for rename current word + nmap rn (coc-rename) + + " Remap for format selected region + xmap f (coc-format-selected) + nmap f (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 + + " Remap for do codeAction of selected region, ex: `aap` for current paragraph + xmap a (coc-codeaction-selected) + nmap a (coc-codeaction-selected) + + " Remap for do codeAction of current line + nmap ac (coc-codeaction) + " Fix autofix problem of current line + nmap qf (coc-fix-current) + + " Create mappings for function text object, requires document symbols feature of languageserver. + xmap if (coc-funcobj-i) + xmap af (coc-funcobj-a) + omap if (coc-funcobj-i) + omap af (coc-funcobj-a) + + " Use for select selections ranges, needs server support, like: coc-tsserver, coc-python + nmap (coc-range-select) + xmap (coc-range-select) + + " Use `:Format` to format current buffer + command! -nargs=0 Format :call CocAction('format') + + " Use `:Fold` to fold current buffer + command! -nargs=? Fold :call CocAction('fold', ) + + " use `:OR` for organize import of current buffer + command! -nargs=0 OR :call CocAction('runCommand', 'editor.action.organizeImport') + + " Add status line support, for integration with other plugin, checkout `:h coc-status` + " set statusline^=%{coc#status()}%{get(b:,'coc_current_function',''')} + + " Using CocList + " Show all diagnostics + nnoremap a :CocList diagnostics + " Manage extensions + nnoremap e :CocList extensions + " Show commands + nnoremap c :CocList commands + " Find symbol of current document + nnoremap o :CocList outline + " Search workspace symbols + nnoremap s :CocList -I symbols + " Do default action for next item. + nnoremap j :CocNext + " Do default action for previous item. + nnoremap k :CocPrev + " Resume latest coc list + nnoremap p :CocListResume + + " properly find root for py projects in workspace + autocmd FileType python let b:coc_root_patterns = ['.git', '.env', 'venv', '.venv', 'setup.cfg', 'setup.py', 'pyproject.toml', 'pyrightconfig.json'] + + " let g:tex_flavor = 'latex' + ''; + }; +in { + # Note that this doesn’t merge deeply, so you couldn’t add to plugins. For that + # you can use the nixos module system’s mkMerge with + # programs.neovim = lib.mkMerge [ config { vimAlias = true; } ] + + programs.neovim = { + vimAlias = true; + viAlias = true; + coc = { + enable = true; + settings = { + "rust-analyzer.serverPath" = "${pkgs.rust-analyzer}/bin/rust-analyzer"; + "gopls.experimentalWorkspaceModule" = true; + }; + }; + } // config; + programs.vim = config; + + # xdg.configFile."nvim/coc-settings.json".text = builtins.toJSON { + # # "go.goplsPath" = "${gopls}/bin/gopls"; + # }; + +} diff --git a/home/nextcloud.nix b/home/nextcloud.nix new file mode 100644 index 0000000..9ad1001 --- /dev/null +++ b/home/nextcloud.nix @@ -0,0 +1,3 @@ +{ ... }: { + services.nextcloud-client.enable = true; +} diff --git a/home/pasystray.nix b/home/pasystray.nix new file mode 100644 index 0000000..f5dccfb --- /dev/null +++ b/home/pasystray.nix @@ -0,0 +1,3 @@ +{ ... }: { + services.pasystray.enable = true; +} diff --git a/home/picom.nix b/home/picom.nix new file mode 100644 index 0000000..6af4159 --- /dev/null +++ b/home/picom.nix @@ -0,0 +1,6 @@ +{ ... }: { + services.picom = { + enable = true; + # inactiveDim = "0.3"; + }; +} diff --git a/home/polybar.nix b/home/polybar.nix new file mode 100644 index 0000000..6f9275f --- /dev/null +++ b/home/polybar.nix @@ -0,0 +1,130 @@ +{ pkgs, ... }: { + services.polybar = { + enable = true; + config = { + "bar/top" = { + monitor = "\${env:MONITOR:}"; + # monitor = "\${env:MONITOR:DVI-D-1}"; + width = "100%"; + height = "34"; + background = "#00000000"; + foreground = "#ccffffff"; + # line-color = "\${bar/top.background}"; + line-size = "16"; + spacing = "2"; + padding-right = "5"; + module-margin = "4"; + + font-0 = "NotoSans-Regular:size=8;-1"; + font-1 = "MaterialIcons:size=10;0"; + font-2 = "Termsynu:size=8:antialias=false;-2"; + font-3 = "FontAwesome:size=10;0"; + + # modules-left = "powermenu"; + modules-left = "i3"; + modules-right = "cpu memory volume wired-network date"; + + tray-position = "right"; + tray-padding = "2"; + }; + + "module/volume" = { + type = "internal/pulseaudio"; + speaker-mixer = "Speaker"; + headphone-mixer = "Headphone"; + headphone-id = "9"; + + format-volume = " "; + label-muted = " muted"; + label-muted-foreground = "#66"; + + ramp-volume-0 = ""; + ramp-volume-1 = ""; + ramp-volume-2 = ""; + # ramp-volume-3 = "4"; + }; + + "module/i3" = { + type = "internal/i3"; + format = " "; + index-sort = true; + pin-workspaces = true; + }; + + "module/wired-network" = { + type = "internal/network"; + interface = "eno1"; + interval = "3.0"; + + label-connected = "%{T3}%local_ip%%{T-}"; + label-disconnected-foreground = "#66"; + }; + + "module/date" = { + type = "internal/date"; + date = "%%{F#99}%Y-%m-%d%%{F-} %%{F#fff}%H:%M%%{F-}"; + date-alt = "%%{F#fff}%A, %d %B %Y %%{F#fff}%H:%M%%{F#666}:%%{F#fba922}%S%%{F-}"; + }; + + "module/memory" = { + type = "internal/memory"; + format = "