-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfiguration.nix
250 lines (206 loc) · 5.25 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
# 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
];
boot = {
# Use the GRUB 2 boot loader.
loader = {
grub.enable = true;
grub.version = 2;
# Define on which hard drive you want to install Grub.
grub.device = "/dev/sda";
};
kernelModules = [ "tp_smapi" ];
extraModulePackages = [ config.boot.kernelPackages.tp_smapi ];
# tmpOnTmpfs = true;
};
networking = {
hostName = "T420";
hostId = "49a4a0e6";
useDHCP = true;
interfaceMonitor = {
enable = true;
# beep = true;
};
nameservers = [
"8.8.8.8"
];
# enableIPv6 = false; # To make wifi work
# wireless.enable = true;
networkmanager.enable = true;
};
powerManagement.enable = true;
powerManagement.cpuFreqGovernor = "ondemand";
# Select internationalisation properties.
i18n = {
consoleFont = "lat9w-16";
consoleKeyMap = "us";
defaultLocale = "en_US.UTF-8";
};
# List packages installed in system profile. To search by name, run:
# $ nix-env -qaP | grep wget
environment.systemPackages = with pkgs; [
# basic
zip
unzip
fish
which
file
# system
acpi
hdparm
# pmutils
# x11
autorandr
# windowmanager
bspwm
sxhkd
dmenu
# web
chromium
firefoxWrapper
wget
# monitoring
# conky
htop
powertop
# pstree
# dev, user env
gitAndTools.gitFull
meld
python
sourceHighlight
# from https://github.com/magnetophon/nixosConfig
ranger
atool
highlight
libcaca
# mediainfo
perlPackages.ImageExifTool
poppler
sublime
];
nixpkgs.config = {
allowUnfree = true;
firefox = {
# enableGoogleTalkPlugin = true;
enableAdobeFlash = true;
};
chromium = {
enablePepperFlash = true; # Chromium removed support for Mozilla (NPAPI) plugins so Adobe Flash no longer works
enablePepperPDF = true;
};
};
programs.nano.nanorc = ''
set nowrap
set tabstospaces
set tabsize 4
include ${pkgs.nano}/share/nano/makefile.nanorc
include ${pkgs.nano}/share/nano/html.nanorc
include ${pkgs.nano}/share/nano/python.nanorc
include ${pkgs.nano}/share/nano/sh.nanorc
'';
programs.bash = {
enableCompletion = true;
# shellAliases = { };
interactiveShellInit = ''
function ranger-cd {
tempfile='/tmp/chosendir'
ranger --choosedir="$tempfile" "''${@:-$(pwd)}"
test -f "$tempfile" &&
if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
cd -- "$(cat "$tempfile")"
fi
rm -f -- "$tempfile"
}
# This binds Ctrl-O to ranger-cd:
bind '"\C-o":"ranger-cd\C-m"'
'';
};
# List services that you want to enable:
# Enable the OpenSSH daemon.
# services.openssh.enable = true;
# Enable CUPS to print documents.
# services.printing.enable = true;
# ThinkPad ACPI
services.acpid = {
enable = true;
powerEventCommands = ''
echo 2 > /proc/acpi/ibm/beep
'';
lidEventCommands = ''
echo 3 > /proc/acpi/ibm/beep
'';
acEventCommands = ''
echo 4 > /proc/acpi/ibm/beep
'';
};
# Avahi - local network discovery
services.avahi = {
enable = true;
hostName = config.networking.hostName;
publishing = true;
# browseDomains = [];
# wideArea = false;
ipv4 = true;
ipv6 = false;
# resolve .local names
nssmdns = true;
};
# Enable the X11 windowing system.
services.xserver = {
# autoStart = true;
enable = true;
exportConfiguration = true; # needed?
vaapiDrivers = [ pkgs.vaapiIntel pkgs.vaapiVdpau ];
videoDrivers = ["intel"];
layout = "us,hu";
# services.xserver.xkbOptions = "eurosign:e";
xkbOptions = "grp:caps_toggle, grp_led:caps, terminate:ctrl_alt_bksp";
# use trackpoint exclusively
synaptics.enable = false;
displayManager.slim.defaultUser = "kr";
displayManager.session = [ {
name = "bspwm";
manage = "window";
start = "
${pkgs.sxhkd}/bin/sxhkd -c /etc/nixos/sxhkdrc &
${pkgs.bspwm}/bin/bspwm -c /etc/nixos/bspwmrc
";
} ];
desktopManager = {
default = "none";
xterm.enable = false;
};
# do not have a desktop manager - nor powermanager, lid will be managed by ACPI/systemd
displayManager.desktopManagerHandlesLidAndPower = false;
# configure laptop display & display on dock
config = ''
Section "Monitor"
Identifier "laptop panel"
EndSection
Section "Monitor"
Identifier "big display"
Option "Primary" "true"
EndSection
'';
deviceSection = ''
Option "Monitor-LVDS1" "laptop panel"
Option "Monitor-HDMI3" "big display"
'';
};
# Define a user account. Don't forget to set a password with ‘passwd’.
users.extraUsers.kr = {
isNormalUser = true;
uid = 1000;
extraGroups = [
"wheel"
"networkmanager"
];
};
}