-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdesktop.nix
206 lines (175 loc) · 5.63 KB
/
desktop.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
{ config, pkgs, ... }:
let
nonfree = import <nixos> { config.allowUnfree = true; };
secrets = import ./secrets.nix;
in {
systemd.services.display-manager.serviceConfig = {
StartLimitBurst = 16;
StartLimitIntervalSec = 4;
};
services.xserver = {
enable = true;
layout = "us,ru"; # see also home-manager.nix
xkbOptions = "ctrl:nocaps,grp:rctrl_toggle"; # see also home-manager.nix
dpi = 282; # 15.6 inch, 3840x2160, comment out in case of nvidia
windowManager.xmonad.enable = true;
};
systemd.user.services.xmodmap = {
description = "xmodmap hotplug";
wantedBy = [ "graphical-session.target" ];
partOf = [ "graphical-session.target" ];
unitConfig = {
StartLimitIntervalSec = 0;
};
serviceConfig = {
PassEnvironment = "DISPLAY";
Restart = "always";
RestartSec = 0;
};
script = ''
${pkgs.inotify-tools}/bin/inotifywait -e create /dev/input
sleep 1s
${pkgs.xorg.xmodmap}/bin/xmodmap -e 'add mod3 = Muhenkan'
'';
};
#services.xserver.videoDrivers = [ "nvidia" ];
services.xserver.xautolock = {
enable = true;
time = 5; # minutes
locker = "${pkgs.xsecurelock}/bin/xsecurelock";
notify = 10; # seconds
notifier = "${pkgs.libnotify}/bin/notify-send \"Locking in 10 seconds\"";
extraOptions = [ "-secure" ];
};
location = {
latitude = secrets.latitude;
longitude = secrets.longitude;
};
services.redshift = {
enable = true;
};
programs.dconf.enable = true;
programs.light.enable = true;
hardware.opengl.enable = true;
hardware.opengl.extraPackages = [ pkgs.vaapiVdpau pkgs.vaapiIntel ];
sound.enable = true;
# > bluetooth audio
services.blueman.enable = true;
hardware.bluetooth = {
enable = true;
settings = {
General = {
Enable = "Source,Sink,Media,Socket";
};
};
};
hardware.pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
};
# < bluetooth audio
environment.variables = {
GDK_SCALE = "2";
GDK_DPI_SCALE = "0.4";
};
fonts = {
fontDir.enable = true;
enableGhostscriptFonts = true;
fonts = with pkgs; [
ubuntu_font_family
noto-fonts-emoji
cantarell-fonts
cm_unicode
google-fonts
go-font
cm_unicode
nonfree.corefonts
];
};
environment.etc."X11/xorg.conf.d/60-trackball.conf".text = ''
Section "InputClass"
Identifier "Marble Mouse"
MatchProduct "Logitech USB Trackball"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "evdev"
Option "ButtonMapping" "3 8 1 4 5 6 7 2 2"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "9"
Option "EmulateWheelInertia" "10"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection
'';
environment.etc."X11/xorg.conf.d/61-trackpoint.conf".text = ''
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
Driver "evdev"
MatchProduct "TPPS/2 Elan TrackPoint"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
Option "Device Accel Constant Deceleration" "0.5"
EndSection
'';
services.udev.extraHwdb = ''
keyboard:usb:*
evdev:input:*
KEYBOARD_KEY_700E7=rightctrl # Super_R -> Control_R
KEYBOARD_KEY_7B=leftalt # Muhenkan -> Alt_R
KEYBOARD_KEY_38=muhenkan # Alt_R -> Muhenkan
KEYBOARD_KEY_70=rightalt # KATAKANAHIRAGANA -> Alt_R
'';
programs.chromium = {
enable = true;
extensions = [
"cjpalhdlnbpafiamejdnhcphjbkeiagm" # uBlock Origin
"dbepggeogbaibhgnhhndojpepiihcmeb" # Vimium
"aapbdbdomjkkjkaonfhkkikfgjllcleb" # Google Translate
"naepdomgkenhinolocfifgehidddafch" # Browserpass
"fihnjjcciajhdojfnbdddfaoknhalnja" # I don't care about cookies
"mnjggcdmjocbbbhaepdhchncahnbgone" # SponsorBlock
"gkmndgjgpolmikgnipipfekglbbgjcel" # AutoHideDownloadsBar
];
extraOpts = {
DefaultBrowserSettingEnabled = true;
TranslateEnabled = false;
SpellcheckEnabled = false;
SpellCheckServiceEnabled = false;
PrintingEnabled = false;
SearchSuggestEnabled = false;
PasswordManagerEnabled = false;
SafeBrowsingEnabled = false;
AutofillAddressEnabled = false;
AutofillCreditCardEnabled = false;
MetricsReportingEnabled = false;
BuiltInDnsClientEnabled = false;
EnableMediaRouter = false;
PromotionalTabsEnabled = false;
SyncDisabled = true;
SigninAllowed = false;
# AudioCaptureAllowed = false;
# VideoCaptureAllowed = false;
SSLErrorOverrideAllowed = false;
AutoplayAllowed = false;
# 0 = Disable browser sign-in
BrowserSignin = 0;
#DefaultSearchProviderEnabled = true;
#DefaultSearchProviderSearchURL = "https://duckduckgo.com/"
#+ "?kae=d&k1=-1&kc=1&kav=1&kd=-1&kh=1&q={searchTerms}";
# Do not allow any site to show desktop notifications
DefaultNotificationsSetting = 2;
# Do not allow any site to track the users' physical location
DefaultGeolocationSetting = 2;
# Block the Flash plugin
DefaultPluginsSetting = 2;
};
};
networking.localCommands = ''
mkdir -p /tmp/chromium && chown user:users /tmp/chromium
mkdir -p /tmp/downloads && chown user:users /tmp/downloads
'';
}