-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfiguration.nix
669 lines (604 loc) · 15.7 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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, ... }:
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
nixpkgs.config = {
allowUnfree = true;
#allowBroken = true;
#permittedInsecurePackages = [ "webkitgtk-2.4.11" ];
firefox = {
enableGoogleTalkPlugin = true;
enablePepperFlash = true;
#enableAdobeFlash = true;
#enableGTK3 = true; # recompilation required :(
# ffmpegSupport = false;
# jre = true;
# enableMPlayer = true; # will use MPV instead, see: https://addons.mozilla.org/en-US/firefox/addon/watch-with-mpv/
icedtea = true;
};
#chromium = {
# enablePepperFlash = true;
# enablePepperPDF = true;
#enableAdobeFlash = true; # for Chromium
# enableWideVine = true;
# hiDPISupport = true; # recompilation required :(
# jre = true;
# icedtea = true;
#};
pulseaudio = true;
packageOverrides = pkgs:
{
#sway = pkgs.sway.overrideAttrs (oldAttrs: { buildInputs = oldAttrs.buildInputs ++ [pkgs.gdk_pixbuf];});
#polybar = pkgs.polybar.overrideAttrs (oldAttrs: { i3Support = true; jsoncpp =true; });
};
};
# Use the systemd-boot EFI boot loader.
# boot.loader.systemd-boot.enable = true;
# boot.loader.efi.canTouchEfiVariables = true;
boot.loader.grub.device = "/dev/sda";
boot.initrd.checkJournalingFS = false;
fileSystems."/U_DRIVE" = {
fsType = "vboxsf";
device = "U_DRIVE";
options = [ "rw" ];
};
fileSystems."/vmshare" = {
fsType = "vboxsf";
device = "vmshare";
options = [ "rw" ];
};
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "dvorak";
defaultLocale = "en_US.UTF-8";
};
# Set your time zone.
time.timeZone = "Europe/Berlin";
environment.shells = with pkgs; [bashInteractive zsh];
#virtualization.virtualbox.guest = {
# enable = true;
# x11 = true;
#};
virtualisation.libvirtd.enable = true; # qemu
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
#virtualbox
gnumake
automake
autoconf
ninja
libtool
pkgconfig
clang
gcc
binutils
zlib
nix-repl
nix-serve
nix-prefetch-git
git
stow
hdparm
acpi
acpid
acpitool
pmtools
wget
bash
bash-completion
bashInteractive
kbd
#way-cooler
#lemonbar
#polybar
sway
ffmpeg # for sway
#gdk-pixbuf # for sway
libjpeg
#imagemagick
imagemagickBig
# i3-gaps required for sway configuration until everything is dropped
i3lock
# i3status
# i3blocks-gaps
i3blocks
scrot # screenshot
feh
#arandr
#autorandr
lm_sensors
sysstat
playerctl
pango
perlPackages.Pango
xwayland
networkmanager
networkmanagerapplet
wpa_supplicant
#dunst
pamixer
ponymix
pasystray
pavucontrol
volnoti
kakoune
tmux
dmenu
firefox
thunderbird
#vivaldi
#vimb
vlc
xfce.thunar
gnome3.nautilus
darktable
rxvt_unicode-with-plugins
#st # terminal
urxvt_perls
terminator termite
zathura
#fontconfig-ultimate
#freetype
ghc
stack
cabal-install
# bluez
bluez-tools
silver-searcher
platinum-searcher
#zsh
#zsh-autosuggestions
#zsh-completions
#zsh-navigation-tools
#zsh-syntax-highlighting
# libva
# libvdpau
# libvdpau-va-gl
# vaapiIntel # libva-intel-driver
# vaapiVdpau # libva-vdpau-driver
# microcodeIntel # microcode-intel
powertop #intel
intel-gpu-tools
beignet
#brightnessctl light
#bluetoothctl
xsel
#mesa_noglu
libnotify
vtk
unzip
#dejavu_fonts
#freefont_ttf
#ttf_bitstream_vera
w3m ranger tree
vim
thermald
texlive.combined.scheme-full
rsync
#redshift
#geoclue
#despotify
#python27
ruby bundix
#python35
##python27Packages.numpy
#python35Packages.numpy
##python27Packages.scipy
#python35Packages.scipy
##python27Packages.matplotlib
#python35Packages.matplotlib
##python27Packages.seaborn
#python35Packages.seaborn
##python27Packages.pandas
#python35Packages.pandas
##python27Packages.ipython
#python35Packages.ipython
##python27Packages.pandocfilters
#python35Packages.pandocfilters
##python27Packages.pypandoc
##python35Packages.pypandoc
#paraview
#pygmentex
mlocate
lm_sensors
linuxHeaders
libreoffice-fresh
hunspell
aspell
aspellDicts.de
aspellDicts.en
aspellDicts.fr
inkscape
i7z
htop
# cups
# cups-filters
# hplip
# gutenprint
# gutenprintBin # cups_gutenprint_binary
# foomatic-filters
# cups-bjnp
# cups-dymo
gpart
gparted
hdf5
ncurses
gnupg pinentry
#gpicview
geeqie
clutter clutter-gtk
gpicview
#gliv
fasd
pandoc
stack
dbus
cryptsetup
clamav
cmake
chromium
#linuxPackages.cpupower
cpufrequtils
boost
mkpasswd
meson
cairo
#kmscon
#libtsm
conky
dropbox
exfat
];
networking = {
hostName = "pgeier"; # Define your hostname.
networkmanager.enable = true;
wireless.enable = false; # Enables wireless support via wpa_supplicant.
wireless.userControlled.enable = true;
wireless.userControlled.group = "network";
extraHosts = ''
127.0.0.1 db
'';
firewall = {
# Open ports in the firewall.
allowedTCPPorts = [
22 # ssh - automaticall
80 # HTTP
443 # HTTPS
];
allowedUDPPorts = [
# 5353 # MDNS - multicast dns
# 427 # SLP - server location protocol
];
# Or disable the firewall altogether.
enable = true;
allowPing = true;
};
};
# Define a user account. Don't forget to set a password with ‘passwd’.
# users.extraUsers.guest = {
# isNormalUser = true;
# uid = 1000;
# };
users.defaultUserShell = pkgs.zsh;
#users.users.geier =
users.extraUsers.geier =
{
isNormalUser = true;
name = "geier";
home = "/home/geier";
hashedPassword = "$6$cG2jGEtZXcQ/4U4L$8z6a.OUetzdmy9/TZslXXMsoZ0QUhlftkxF.ZjPFz2qUQ2tk9RVRwwjdO45TkQmgAigmfjRDR/.chZgLVvcab0"; # mkpasswd -m sha-512
initialHashedPassword = "$6$cG2jGEtZXcQ/4U4L$8z6a.OUetzdmy9/TZslXXMsoZ0QUhlftkxF.ZjPFz2qUQ2tk9RVRwwjdO45TkQmgAigmfjRDR/.chZgLVvcab0"; # mkpasswd -m sha-512
uid = 1000;
description = "Philpp Geier";
extraGroups = [ "wheel" "networkmanager" "audio" "video" "sys" "scanner" "kvm" "optical" "storage" "input" "disk" "floppy" "uucp" "lock" "docker" "sway"];
};
#users.mutableUsers = false;
# The NixOS release to be compatible with for stateful data such as databases.
system = {
autoUpgrade.enable = true;
stateVersion = "18.03";
};
systemd.services.kbdrate = {
description = "Keyboard repeat rate in tty";
serviceConfig = {
Type = "simple";
RemainAfterExit="yes";
StandardInput="tty";
StandardOutput="tty";
#ExecStart = "${pkgs.ipfs}/bin/kbdrate -s -d 150 -r 50";
ExecStart = "${pkgs.kbd}/bin/kbdrate -s -d 150 -r 50";
#ExecStop = "pkill ....";
Restart = "on-failure";
};
wantedBy = [ "multi-user.target" ];
enable = true;
};
# https://github.com/shosti/nixos-config/blob/master/configuration.nix
# Make sure screen is locked on suspend
systemd.services."i3lock" = {
enable = true;
description = "i3lock";
wantedBy = [ "suspend.target" "hibernate.target" ];
before = [ "systemd-suspend.service" "systemd-hibernate.target" ];
serviceConfig = {
Type = "forking";
User = "geier"; # unfortunately necessary :(
};
script = "${pkgs.i3lock}/bin/i3lock";
postStart = "${pkgs.coreutils}/bin/sleep 1";
environment = { DISPLAY = ":0"; };
};
# List services that you want to enable:
services = {
syncthing = {
user = "geier";
enable = true;
dataDir = "/home/geier/.syncthing";
};
#ntp.enable = true;
timesyncd.enable = true;
locate = {
enable = true;
interval = "hourly";
localuser = null;
locate = pkgs.mlocate;
extraFlags = [ "-n '.git .backups .Trash .mail .cache vendor'" ];
};
# allow access for user
#udev.path = with pkgs; [utillinux];
udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chgrp video /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="backlight", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/backlight/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="${pkgs.coreutils}/bin/chgrp input /sys/class/leds/%k/brightness"
ACTION=="add", SUBSYSTEM=="leds", RUN+="${pkgs.coreutils}/bin/chmod g+w /sys/class/leds/%k/brightness"
'';
kmscon = {
enable = false; # disabled - as login with sway
extraConfig = ''
xkb-layout=us,de
xkb-variant=dvorak,
xkb-options=grp:switch,grp:menu_toggle
xkb-repeat-delay=150
xkb-repeat-rate=50
'';
hwRender = true;
};
acpid = {
enable = true;
};
hdapsd = {
enable = true;
};
# Enable the OpenSSH daemon.
openssh = {
permitRootLogin = "no";
enable = true;
};
dnscrypt-proxy = {
enable = true;
localPort = 43;
};
dnsmasq = {
enable = true;
servers = [ "127.0.0.1#43" ];
};
privoxy.enable = true;
tor = {
enable = true;
client = {
enable = true;
privoxy.enable = true;
};
tsocks.enable = true;
};
redshift = {
enable = true;
latitude = "49.398750";
longitude = "8.672434";
};
tlp = {
enable = true;
extraConfig = ''
DEVICES_TO_DISABLE_ON_STARTUP="bluetooth"
'';
};
upower.enable = true;
udisks2.enable = true;
printing = {
enable = true;
browsing = true;
drivers = with pkgs; [ splix hplip hplipWithPlugin gutenprint gutenprintBin cups cups-filters foomatic-filters cups-bjnp cups-dymo ]; # hplip hplipWithPlugins
};
avahi = {
enable = true;
nssmdns = true;
};
xserver = {
enable = false;
autorun = false;
exportConfiguration = true;
autoRepeatDelay = 150;
autoRepeatInterval = 50;
modules = with pkgs; [
xorg.xf86inputsynaptics # xf86-input-synaptics
#xorg.xf86videointel # xf86-video-intel
xorg.xf86inputevdev # xf86-input-evdev
xorg.xf86inputkeyboard
xorg.xf86inputlibinput
#libinput
xorg.xrdb
xorg.xinit
xorg.xorgserver
xorg.setxkbmap
xorg.xrandr
xorg.xauth
];
libinput.enable = true;
#videoDrivers = ["intel" "mesa-noglu"];
videoDrivers = ["intel" "mesa-noglu"];
layout = "us,de";
xkbVariant = "dvorak,";
xkbOptions = "grp:switch,grp:menu_toggle";
#windowManager.i3.enable = true;
#windowManager.i3.package = pkgs.i3-gaps;
#windowManager.sway.enable = true;
#windowManager.waycooler.enable = true;
inputClassSections = [''
Identifier "touchpad"
Driver "synaptics"
MatchIsTouchpad "on"
Option "TapButton1" "1"
Option "TapButton2" "2"
Option "TapButton3" "3"
Option "VertEdgeScroll" "on"
Option "VertTwoFingerScroll" "on"
Option "HorizEdgeScroll" "on"
Option "HorizTwoFingerScroll" "on"
Option "CircularScrolling" "on"
Option "CircScrollTrigger" "2"
#Option "EmulateTwoFingerMinZ" "40"
#Option "EmulateTwoFingerMinW" "8"
#Option "CoastingSpeed" "0"
#Option "FingerLow" "30"
#Option "FingerHigh" "50"
#Option "MaxTapTime" "125"
''
''
Identifier "keyboard"
MatchIsKeyboard "yes"
Option "XkbLayout" "us,de"
Option "XkbVariant" "dvorak,"
Option "XkbOptions" "grp:switch,grp:menu_toggle"
Option "AutoRepeat" "150 50"
''];
# Enable the KDE Desktop Environment.
# services.xserver.displayManager.sddm.enable = true;
# services.xserver.desktopManager.plasma5.enable = true;
desktopManager = {
gnome3.enable = true;
default = "none";
};
};
};
hardware = {
#brightnessctl.enable = true;
opengl = {
enable = true;
extraPackages = with pkgs; [vaapiIntel vaapiVdpau libvdpau-va-gl glxinfo]; # mesa_drivers
extraPackages32 = with pkgs; [vaapiIntel vaapiVdpau libvdpau-va-gl glxinfo]; # mesa_drivers
driSupport = true;
#driSupport32Bit = true;
s3tcSupport = true;
};
enableAllFirmware = true;
pulseaudio = {
enable = true;
#support32Bit = true;
package = pkgs.pulseaudioFull;
};
sane = {
enable = true;
#extraBackends = [ pkgs.hplipWithPlugin ];
};
bluetooth = {
enable = true;
powerOnBoot = false;
};
#cpu.intel.updateMicrocode = true;
};
systemd.user.services.pulseaudio.enable = true;
virtualisation.docker.enable = true;
fonts = {
enableDefaultFonts = true;
enableCoreFonts = true;
enableGhostscriptFonts = false;
enableFontDir = true;
fonts = with pkgs; [
dejavu_fonts
freefont_ttf
ttf_bitstream_vera
terminus_font
terminus_font_ttf
siji # for i3blocks
symbola
font-awesome-ttf
libertine
# code2000
# code2001
# code2002
terminus_font
ubuntu_font_family
liberation_ttf
inconsolata
vistafonts
freefont_ttf
unifont
cm_unicode
ipafont
baekmuk-ttf
source-han-sans-japanese
source-han-sans-korean
source-han-sans-simplified-chinese
source-han-sans-traditional-chinese
source-sans-pro
source-serif-pro
source-code-pro
fira
fira-code
fira-mono
hasklig
];
fontconfig = {
#defaultFonts = {
# # monospace = [ "Source Code Pro" ];
# # sansSerif = [ "Source Sans Pro" ];
# # serif = [ "Source Serif Pro" ];
# # monospace = [ "DejaVu Sans Serif" ];
# # sansSerif = [ "DejaVu Sans Serif" ];
# # serif = [ "DejaVu Sans Serif" ];
#};
penultimate = {
enable = true;
};
};
};
programs.sway = {
enable = true;
};
programs.light = {
enable = true;
};
programs.zsh = {
enable = true;
enableAutosuggestions = true;
#autosuggestions.enable = true;
enableCompletion = true;
syntaxHighlighting.enable = true;
};
programs.gnupg.agent = {
enable = true;
enableSSHSupport = true;
};
sound.enable = true;
powerManagement = {
enable = true;
#cpuFreqGovernor = "ondemand"; #"powersave"; tlp does it
#powerDownCommands = "${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda";
#powerUpCommands = "${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda";
#scsiLinkPolicy = "medium_power"; # tlp does it
# "min_power"
# "max_performance"
# "medium_power"
# "med_power_with_dipm"
};
#services.logind.extraConfig = "HandleLidSwitch=ignore";
#security.pam
security.apparmor.enable = true;
}