-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.nix
231 lines (196 loc) · 4 KB
/
common.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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
{ config, pkgs, ... }:
let
findup = pkgs.writeScriptBin "findup" ''
#! ${pkgs.bash}/bin/bash
arg="$1"
if test -z "$arg"; then exit 1; fi
while ! test -e "$arg"; do
cd ..
if test "$PWD" = "/"; then
exit 1
fi
done
echo $PWD/$arg
'';
nd = pkgs.writeScriptBin "nd" ''
#! ${pkgs.bash}/bin/bash
if [ $? -eq 0 ]; then
notify-send $@
else
notify-send "($?) "$@
fi
'';
neovim = pkgs.neovim.override {
vimAlias = true;
};
in
rec {
environment.systemPackages = with pkgs; [
acpi
awscli
bind
cacert
chromium
direnv
dragon-drop
dstat
dunst
file
findup
firefox-bin
fpp
git
gnumake
gnupg
htop
i3blocks-gaps
i3lock
inotify-tools
imagemagick
jq
keybase
libnotify
lemonbar-xft
lsof
mysql
ncdu
nd
neovim
nettools
ngrok
nix-prefetch-git
nox
ntfs3g
pass
patchelf
pavucontrol
pciutils
rofi
rofi-pass
silver-searcher
spotify
sysstat
tree
unzip
usbutils
wget
which
xclip
xfce.terminal
xorg.xbacklight
xorg.xev
zsh
];
environment.variables."SSL_CERT_FILE" = "/etc/ssl/certs/ca-bundle.crt";
environment.etc = {
editrc.text = ''
bind -v
bind "^R" em-inc-search-prev
bind \\t rl_complete
'';
inputrc.text = ''
# inputrc borrowed from CentOS (RHEL).
set bell-style none
set meta-flag on
set input-meta on
set convert-meta off
set output-meta on
set colored-stats on
#set mark-symlinked-directories on
$if mode=emacs
# for linux console and RH/Debian xterm
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": beginning-of-history
"\e[6~": end-of-history
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e[1;5C": forward-word
"\e[1;5D": backward-word
# for rxvt
"\e[8~": end-of-line
# for non RH/Debian xterm, can't hurt for RH/DEbian xterm
"\eOH": beginning-of-line
"\eOF": end-of-line
# for freebsd console
"\e[H": beginning-of-line
"\e[F": end-of-line
$endif
set editing-mode vi
$if mode=vi
set keymap vi-command
Control-l: clear-screen
set keymap vi-insert
Control-l: clear-screen
$endif
'';
pyrc.text = ''
import rlcompleter
import readline
readline.parse_and_bind("tab: complete")
'';
"user-dirs.defaults".text = ''
XDG_DESKTOP_DIR="$HOME"
XDG_DOCUMENTS_DIR="$HOME"
XDG_DOWNLOAD_DIR="$HOME/dl"
XDG_MUSIC_DIR="$HOME"
XDG_PICTURES_DIR="$HOME"
XDG_PUBLICSHARE_DIR="$HOME/public"
XDG_TEMPLATES_DIR="$HOME"
XDG_VIDEOS_DIR="$HOME"
'';
};
i18n = {
consoleFont = "Lat2-Terminus16";
consoleUseXkbConfig = true;
defaultLocale = "en_US.UTF-8";
};
fonts = {
enableFontDir = true;
enableGhostscriptFonts = true;
fonts = with pkgs; [
corefonts
inconsolata
powerline-fonts
source-code-pro
];
fontconfig = {
enable = true;
};
};
hardware = {
cpu.intel.updateMicrocode = true;
pulseaudio = {
enable = true;
support32Bit = true;
package = pkgs.pulseaudioFull;
};
};
nix = {
buildCores = 0;
extraOptions = ''
auto-optimise-store = true
'';
nixPath = [ "/etc/nixos" "nixos-config=/etc/nixos/config" ];
useSandbox = true;
};
nixpkgs.config = {
allowUnfree = true;
chromium = {
enablePepperFlash = true;
enablePepperPDF = true;
};
};
security = {
audit.enable = false;
sudo.extraConfig = ''
Defaults !lecture,tty_tickets,!fqdn,insults
'';
};
system.copySystemConfiguration = true;
system.stateVersion = "19.03";
time.timeZone = "America/Los_Angeles";
users.defaultUserShell = "/run/current-system/sw/bin/zsh";
}