Add basic packages and configured zsh and nvim

This commit is contained in:
2023-05-16 22:50:07 +02:00
parent 10930e861a
commit 0c9e597c63
10 changed files with 169 additions and 1 deletions

10
bash/bash.nix Normal file
View File

@@ -0,0 +1,10 @@
{ pkgs, ... }: {
programs.bash = {
enable = true;
profileExtra = builtins.readFile ./bash_profile;
initExtra = builtins.readFile ./bashrc;
};
}

0
bash/bash_profile Normal file
View File

0
bash/bashrc Normal file
View File

9
git/git.nix Normal file
View File

@@ -0,0 +1,9 @@
{ pkgs, ... }: {
programs.git = {
enable = true;
includes = [{ path = "~/.config/home-manager/gitconfig"; }];
};
}

3
git/gitconfig Normal file
View File

@@ -0,0 +1,3 @@
[user]
name = Bart Riemens
email = briemens@crafity.com

View File

@@ -1,6 +1,24 @@
{ pkgs, ... }: {
{ pkgs, lib, ... }: {
home.username = "briemens";
home.homeDirectory = "/Users/briemens";
home.stateVersion = "22.11";
programs.home-manager.enable = true;
imports = [
./bash/bash.nix
./git/git.nix
./nvim/nvim.nix
./zsh/zsh.nix
];
home.packages = with pkgs; [
bashInteractive # don't ask me why
vifm
];
programs.htop.enable = true;
programs.fzf = {
enable = true;
};
}

76
nvim/base.vim Normal file
View File

@@ -0,0 +1,76 @@
filetype off
filetype plugin indent on
set nocompatible
scriptencoding utf-8
set encoding=utf-8
set autoindent
set backspace=2
set bs=indent,eol,start
set completeopt-=preview
set nocursorcolumn
set cursorline
set guioptions=
" set colorcolumn=120
set diffopt+=vertical
set expandtab
set formatoptions=qr
set hidden
set history=5000
set laststatus=2
set signcolumn=yes
" set list listchars=tab:»·,trail:·,nbsp:·,eol:¬,extends:,precedes:
" set list listchars=tab:»·,trail:·,extends:,precedes:
" set list listchars=tab:»·,trail:·,extends:,precedes:
set list listchars=tab:\ \ ,trail,extends:,precedes:
set mouse=a
set noautochdir
set noswapfile
set novisualbell
set nowrap
set number
set numberwidth=5
set relativenumber
set ruler
set scrolloff=5 "Start scrolling when we're 8 lines away from margins
syntax sync minlines=256
set synmaxcol=100000
set shiftround
set shiftwidth=2
set shortmess=filnxtToOcI
set softtabstop=2
set splitbelow
set splitright
set switchbuf=usetab
set tabstop=2
set textwidth=120
set lbr
set timeoutlen=1000
set updatetime=10
set notimeout
set ttimeoutlen=0
set ttyfast
set matchtime=3
set wildmenu
set wildmode=list:longest
set virtualedit=block
set fileformat=unix
set clipboard=unnamedplus
set foldmarker={{{,}}}
set t_ZH=
set t_ZR=
set background=dark
syntax enable
if v:lang =~ "utf8$" || v:lang =~ "UTF-8$"
set fileencodings=ucs-bom,utf-8,latin1
endif
if v:version > 703 || v:version == 703 && has('patch541')
set formatoptions+=j
endif
autocmd StdinReadPre * let s:std_in=1
colorscheme quiet

12
nvim/nvim.nix Normal file
View File

@@ -0,0 +1,12 @@
{ pkgs, lib, ... }: {
programs.neovim = {
enable = true;
defaultEditor = true;
extraConfig = builtins.concatStringsSep "\n" [
(lib.strings.fileContents ./base.vim)
];
};
}

28
zsh/zsh.nix Normal file
View File

@@ -0,0 +1,28 @@
{ pkgs, ... }: {
programs.zsh = {
enable = true;
enableCompletion = true;
enableAutosuggestions = true;
defaultKeymap = "viins";
history.extended = true;
initExtra = ''
${builtins.readFile ./zshrc}
'';
sessionVariables = rec {
EDITOR = "nvim";
};
plugins = [
{
name = "zsh-autosuggestions";
src = pkgs.fetchFromGitHub {
owner = "zsh-users";
repo = "zsh-autosuggestions";
rev = "v0.6.3";
sha256 = "1h8h2mz9wpjpymgl2p7pc146c1jgb3dggpvzwm9ln3in336wl95c";
};
}
];
};
}

12
zsh/zshrc Normal file
View File

@@ -0,0 +1,12 @@
echo Welcome to ZSH
eval "$(ssh-agent -s)"
ssh-add $HOME/.ssh/id_rsa
alias vim='nvim'
alias f='vifm'
alias l='ls -al'
alias gs='git status'
alias ga='git add'
alias ga.='git add .'
alias homerc='vim ~/.config/home-manager/home.nix'