-
Notifications
You must be signed in to change notification settings - Fork 1
/
configuration.nix
213 lines (192 loc) · 7.36 KB
/
configuration.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
{ config, pkgs, ... }:
{
imports = [
(import <mobile-nixos/lib/configuration.nix> { device = "pine64-pinephone"; })
./on-screen-keyboard.nix
];
users.users."sepp" = {
isNormalUser = true;
initialPassword = "";
extraGroups = [ "wheel" "networkmanager" "input" ];
};
nixpkgs.overlays = [
(self: super: {
myVim = super.vim_configurable.customize {
name = "vi"; # The name is used as a binary!
vimrcConfig = {
customRC = ''
set encoding=utf-8
au BufNewFile,BufFilePre,BufRead *.md set filetype=markdown
au BufNewFile,BufRead,BufReadPost *.f90 set syntax=fortran
au VimEnter * if &diff | execute 'windo set wrap' | endif
filetype plugin indent on
set backspace=2 " make backspace work like most other program
set bg=dark
set tabstop=4
set shiftwidth=4
set expandtab
set wildmenu
set autoindent
set smartindent
let g:ycm_python_binary_path = 'python'
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_key_list_select_completion = ['<TAB>']
let g:ycm_key_list_previous_completion = ['<S-TAB>']
let g:ycm_key_list_stop_completion = ['<C-y>', '<UP>', '<DOWN>']
let g:ycm_semantic_triggers = {
\ 'python': [ 're!\w{2}' ]
\ }
let g:gitgutter_enabled = 1
colorscheme gruvbox
" Show whitespace
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
autocmd BufWinEnter * match ExtraWhitespace /\s\+$/
autocmd InsertEnter * match ExtraWhitespace /\s\+\%#\@<!$/
autocmd InsertLeave * match ExtraWhitespace /\s\+$/
autocmd BufWinLeave * call clearmatches()
" Keep visual mode active
vnoremap < <gv
vnoremap > >gv
" Remember last position
if has("autocmd")
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
endif
" sync default register to clipboard
if has('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
if executable('pyls')
au User lsp_setup call lsp#register_server({
\ 'name': 'pyls',
\ 'cmd': {server_info->['pyls']},
\ 'whitelist': ['python'],
\ })
endif
set foldmethod=expr
\ foldexpr=lsp#ui#vim#folding#foldexpr()
\ foldtext=lsp#ui#vim#folding#foldtext()
let g:lsp_diagnostics_echo_cursor = 1 " Show the error in the status bar
if executable('clangd')
augroup lsp_clangd
autocmd!
autocmd User lsp_setup call lsp#register_server({
\ 'name': 'clangd',
\ 'cmd': {server_info->['clangd', '--compile-commands-dir=build', '--log=verbose']},
\ 'whitelist': ['c', 'cpp', 'objc', 'objcpp'],
\ })
autocmd FileType c setlocal omnifunc=lsp#complete
autocmd FileType cpp setlocal omnifunc=lsp#complete
autocmd FileType objc setlocal omnifunc=lsp#complete
autocmd FileType objcpp setlocal omnifunc=lsp#complete
augroup end
endif
'';
packages.myVimPackage = with super.vimPlugins; {
start = let
async-vim = super.vimUtils.buildVimPluginFrom2Nix {
pname = "async-vim";
version = "2019-07-18";
src = super.fetchFromGitHub {
owner = "prabirshrestha";
repo = "async.vim";
rev = "627a8c4092df24260d3dc2104bc1d944c78f91ca";
sha256 = "1hqrfk3wi82gq4qw71xcy1zyplwb8w7bnm6kybpn27hgpipygrvv";
};
};
vim-lsp = super.vimUtils.buildVimPluginFrom2Nix {
pname = "vim-lsp";
version = "2019-11-02";
src = super.fetchFromGitHub {
owner = "prabirshrestha";
repo = "vim-lsp";
rev = "efff12608f334edcc6878ce9a790b136c7fa92c6";
sha256 = "1lb6fylsr7krk471lh4m23j18hp6xa0izxzg14xw1xzaacf4p603";
};
}; in
[
# youcompleteme
async-vim
ctrlp
vim-airline
vim-airline-themes
fugitive
nerdtree
gitgutter
molokai
vim-colorstepper # Use F6/F7 to select your favorite colorscheme
awesome-vim-colorschemes
vim-yapf
vim-lsp
];
opt = [ ];
};
};
};
}
)];
documentation.dev.enable = true;
environment.systemPackages = with pkgs; [
(writeShellScriptBin "firefox" ''
export MOZ_USE_XINPUT2=1
exec ${pkgs.firefox}/bin/firefox "$@"
'')
chromium
myVim
fzf
htop
git
sgtpuzzles
];
services.ntp.enable = true;
services.xserver = {
enable = true;
videoDrivers = [ "modesetting" ];
desktopManager.xfce.enable = true;
desktopManager.xfce.enableXfwm = false;
displayManager.autoLogin.user = "sepp";
displayManager.autoLogin.enable = true;
displayManager.lightdm.enable = true;
};
programs.bash = {
enableCompletion = true;
interactiveShellInit = ''
source "$(fzf-share)/key-bindings.bash"
source "$(fzf-share)/completion.bash"
'';
};
networking.hostName = "flakephone";
networking.wireless = {
enable = true;
networks = {
knoedelnetz = {
# Generated using `wpa_passphrase knoedelnetz`. A slight security issue, but I don't have wired networking yet...
pskRaw = "1aeec582e79412fc44efa16ebfd399e22be96bbcf7a7eab9e00b94972c487c18";
};
bananaNet = {
# Generated using `wpa_passphrase bananaNet`. A slight security issue, but I don't have wired networking yet...
pskRaw = "8932ea09b8f3b13d65a770a6f49c1ed84383bd5d7bc0c9b2cd3d5d5ea883863c";
};
};
};
systemd.services.wpa_supplicant.serviceConfig = {
# First login attempt doesn't work for whatever reason
Restart = "always";
RestartSec = 8;
StartLimitIntervalSec = 0; # Don't stop trying after a couple of restarts
};
networking.useDHCP = false;
networking.interfaces.wlan0.useDHCP = true;
networking.enableIPv6 = false;
# Enable the OpenSSH daemon.
services.openssh.enable = true;
services.openssh.permitRootLogin = "yes";
time.timeZone = "Europe/Vienna";
users.users.root = {
openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC/Z8395cyaul/PIgLDCSgHWrg3h1xiALouLu8gAOYb9CtN05VTSOINuI95rcdPFIQC+2vconZ/sW2j+mUmsrIP6b2eFm1XRg6Nicu9tPK+fqksSqL2TjPijwmeptljDwUN/F5YfCRCFCixAtRq5wTARbEzC8hDvnfaoimiRD4JyMCnRJvEAZxh5AsY5vD42sQVmS1xh7lx80gd7ARdeKh5xBV/ccnFzON0U9HTM4DNSa2URV+QCJec1ORYHAfo+DdmR+q7J96lVp5UbLki1Ym4KEW6eCUeOZ6bAq8aaFlWmlwFIMNOzfEc/kZRDurRj8IJx5BWzI1RPRg9Z+ChqbZh josef.kemetmueller@PC-18801"
];
};
}