-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathraskin-asus-n53j.nix
344 lines (312 loc) · 11.7 KB
/
raskin-asus-n53j.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
# ASUS N53J
#00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 18)
#00:01.0 PCI bridge: Intel Corporation Core Processor PCI Express x16 Root Port (rev 18)
#00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)
#00:16.0 Communication controller: Intel Corporation 5 Series/3400 Series Chipset HECI Controller (rev 06)
#00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
#00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset High Definition Audio (rev 06)
#00:1c.0 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 1 (rev 06)
#00:1c.1 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 2 (rev 06)
#00:1c.3 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 4 (rev 06)
#00:1c.4 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 5 (rev 06)
#00:1c.5 PCI bridge: Intel Corporation 5 Series/3400 Series Chipset PCI Express Root Port 6 (rev 06)
#00:1d.0 USB Controller: Intel Corporation 5 Series/3400 Series Chipset USB2 Enhanced Host Controller (rev 06)
#00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev a6)
#00:1f.0 ISA bridge: Intel Corporation Mobile 5 Series Chipset LPC Interface Controller (rev 06)
#00:1f.2 SATA controller: Intel Corporation 5 Series/3400 Series Chipset 4 port SATA AHCI Controller (rev 06)
#00:1f.6 Signal processing controller: Intel Corporation 5 Series/3400 Series Chipset Thermal Subsystem (rev 06)
#01:00.0 VGA compatible controller: nVidia Corporation GT215 [GeForce GT 335M] (rev a2)
#03:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)
#04:00.0 USB Controller: Device 1b73:1400 (rev 01)
#05:00.0 Class ff00: Realtek Semiconductor Co., Ltd. Device 5209 (rev 01)
#05:00.1 SD Host controller: Realtek Semiconductor Co., Ltd. Device 5209 (rev 01)
#06:00.0 Ethernet controller: Atheros Communications AR8131 Gigabit Ethernet (rev c0)
#ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 05)
#ff:00.1 Host bridge: Intel Corporation Core Processor QuickPath Architecture System Address Decoder (rev 05)
#ff:02.0 Host bridge: Intel Corporation Core Processor QPI Link 0 (rev 05)
#ff:02.1 Host bridge: Intel Corporation Core Processor QPI Physical 0 (rev 05)
#ff:02.2 Host bridge: Intel Corporation Core Processor Reserved (rev 05)
#ff:02.3 Host bridge: Intel Corporation Core Processor Reserved (rev 05)
{config, pkgs, ...}:
let
texLivePaths = with pkgs; [
texLive texLiveExtra lmodern texLiveCMSuper
texLiveLatexXColor texLivePGF
texLiveBeamer texLiveModerncv tipa texLiveContext
texDisser lmmath texinfo5 tex4ht texLiveModerntimeline
];
myTexLive = pkgs.texLiveAggregationFun {
paths = texLivePaths;
};
myKDE = pkgs.kde412;
kernelToUse = rec {
kernelPackages = pkgs.linuxPackagesFor pkgs.linux_3_14 kernelPackages;
extraModulePackages = [kernelPackages.acpi_call /*kernelPackages.aufs */
kernelPackages.sysdig];
};
packageGroups = import /etc/nixos/configurations/misc/raskin/package-groups.nix {
inherit pkgs myTexLive myKDE;
baseKernel = kernelToUse;
};
base =
{
require = [
/etc/nixos/configurations/computer/asus/n53j/n53jn-sz074v.nix
];
boot = rec {
loader.grub = {
device = "/dev/sda";
copyKernels = true;
configurationLimit = 100;
version = 2;
};
vesa = false;
kernelPackages = kernelToUse.kernelPackages;
extraModulePackages = kernelToUse.extraModulePackages;
initrd = {
kernelModules = [
"libata" "sd_mod"
"i8042" "pcips2" "serio"
"mousedev" "evdev" "psmouse" "sermouse" "synaptics_i2c"
"ext3" "lzf" "crc32c" "btrfs" "libcrc32c"
"zlib_deflate" "unix" "usbhid" "hid-generic"
"xhci_hcd" "ehci_hcd" "ehci_pci" "uhci_hcd" "ohci_hcd"
"atkbd" "xtkbd" "bfq_iosched" "dm_mod"
];
};
kernelParams = [
];
kernelModules = [
"fbcon" "i915"
"usb-storage" "tun"
"battery" "ac" "thermal" "fuse"
"8139too" "ath9k"
"cp2101" "cp210x" "pl2303"
"smsc75xx"
"ahci" "loop" "ftdi_sio" "snd_pcm"
"snd_hda_intel"
"ipip" "ipv6" "video"
"fbdev"
"pata_atiixp" "sr_mod" "ahci"
"pktcdvd" "ide-cd-mod"
"atl1c" "acpi_call" "kvm-intel"
"cpufreq-ondemand" "configs" "rtc-cmos"
"cdc-acm" "ppp-generic" "ppp-async"
"ppp-deflate" "bsd-comp" "cdc-phonet"
"uvcvideo" "cls-cgroup" "blk-cgroup"
"mmc-block" "rtsx-pci-sdmmc"
"uinput" "ax88179_178a"
"sysdig-probe"
];
hardwareScan = false;
resumeDevice = "8:2";
postBootCommands = ''
exec &> /var/log/post-boot-commands
/var/run/current-system/sw/bin/umount /tmp/
/var/run/current-system/sw/sbin/mkfs.ext4 -L tmp /dev/disk/by-label/tmp
/var/run/current-system/sw/bin/mount /tmp/
/var/run/current-system/sw/bin/chmod a+rwxt /tmp
/var/run/current-system/sw/bin/mkdir -m 1777 /tmp/.ICE-unix/
! [ -e /tmp/.dev-tty12 ] && /var/run/current-system/sw/bin/mknod -m 0600 /tmp/.dev-tty12 c 4 12
/bin/sh -c 'while true; do
echo -n "Password: " ; read -s pass;
[ -e /root/rc/vt12-pass ] && [ "x$pass" = "x$(cat /root/rc/vt12-pass)" ] && /bin/sh;
[ "x$pass" = "xhaltnow" ] && /var/run/current-system/sw/sbin/halt;
[ "x$pass" = "xtouchstore" ] && /var/run/current-system/sw/bin/touch /nix/store &
done < /tmp/.dev-tty12 &> /tmp/.dev-tty12' &
/var/run/current-system/sw/bin/mount /sys
/var/run/current-system/sw/bin/mkdir -p /dev/cgroup/cpu
/run/current-system/sw/sbin/sysctl kernel.shmmax=1200000000
'';
};
swapDevices = [
{label = "swap";}
];
fileSystems = import ./filesystems-asus-n53j.nix {};
services = (import ./services-main.nix {inherit pkgs config;}) //
{
xserver = import ./xserver-intel.nix {inherit pkgs;};
};
i18n = {
defaultLocale = "en_US.UTF-8";
consoleFont = "iso01-12x22";
consoleKeyMap = "ruwin_cplk-UTF-8";
};
system = {
fsPackages = [ pkgs.btrfsProgs ];
};
environment = {
systemPackages = with packageGroups;
[(pkgs.runCommand "empty" {} "mkdir $out")] ++
(if false then minimal else
(
pkgs.lib.concatLists
[
extractors consoleBrowsers programmingLanguages
nonNative hwControl toys filesystems networkTools
fatXApps windowManagers consoleTools buildSupport
utilsX widgets sound graphicView clientServer im
misc GCPin versionControl fsTools consoleEditors
browsers graphicEdit encryption libraries music
monitoring namespacingTools partitionTools debugTools
textCrunchers
lowPrioPackages
]
));
pathsToLink = ["/"];
shellInit = ''
export PATH=$HOME/script/override:$PATH:$HOME/script
'';
};
fonts = import ./fonts.nix {inherit pkgs;};
time = {
timeZone = "Etc/GMT-4";
};
nix = {
useChroot = true;
chrootDirs = ["/home/repos"];
maxJobs = 4;
extraOptions = "
gc-keep-outputs = true # Nice for developers
gc-keep-derivations = true # Idem
env-keep-derivations = false
binary-caches = http://nixos.org/binary-cache http://cache.nixos.org
trusted-binary-caches = http://nixos.org/binary-cache http://cache.nixos.org http://hydra.nixos.org
";
proxy = "http://127.0.0.1:3128";
package = pkgs.lib.overrideDerivation pkgs.nixUnstable (x: rec {
doInstallCheck = false;
#src = "/home/repos/nix/";
#revisionStamp = (builtins.readFile (src + "/.git/refs/heads/master"));
preConfigure = ''
sed -e '/bin_SCRIPTS = /anix-reduce-build \\' -i scripts/local.mk
sed -e '/bin_SCRIPTS = /anix-http-export.cgi \\' -i scripts/local.mk
export AC_LOCAL_PATH="$AC_LOCAL_PATH:${pkgs.autoconf}/share/aclocal:${pkgs.libtool}/share/aclocal:${pkgs.automake}/share/aclocal"
set
export
./bootstrap.sh
'' + (if x ? preConfigure then x.preConfigure else "");
nativeBuildInputs = (with pkgs; [
autoconf automake libtool bison flex gettext
perlPackages.WWWCurl perlPackages.DBDSQLite perlPackages.DBI
libxml2 libxslt w3m
docbook5 docbook5_xsl docbook_xml_dtd_45
]) ++ (x.nativeBuildInputs or []);
buildInputs = (with pkgs; [
perlPackages.WWWCurl perlPackages.DBDSQLite perlPackages.DBI
]) ++ x.buildInputs;
configureFlags = x.configureFlags + ''
--with-docbook-rng=${pkgs.docbook5}/xml/rng/docbook
--with-docbook-xsl=${pkgs.docbook5_xsl}/xml/xsl/docbook
--with-xml-flags=--nonet
--with-www-curl=${pkgs.perlPackages.WWWCurl}/${pkgs.perl.libPrefix}
'';
});
};
jobs = {
# makeUserCgroup = {
# name = "make-user-cgroup";
# description = "Create cgroup where user can create subgroups";
# startOn = "filesystem";
# script = ''
# mkdir -m 0777 /dev/cgroup/user
# echo -n /etc/sudo-scripts/clean-cgroup > /dev/cgroup/release_agent
# '';
# respawn = false;
# task = true;
# };
networkInterfaces.startOn = "never";
dhclient.startOn = "never";
};
networking = {
extraHosts = (import /root/nix-sysconfig/hosts.nix);
hostName = (import /root/nix-sysconfig/hostname.nix).hostname;
domain = (import /root/nix-sysconfig/hostname.nix).domain;
# I manage proxy settings manually anyway
interfaceMonitor = {
enable = false;
};
nameservers = [
] ++ (import /root/nix-sysconfig/nameservers.nix);
useDHCP = false;
firewall.enable = false;
};
nixpkgs.config = import (builtins.getEnv "NIXPKGS_CONFIG");
security = {
setuidPrograms = ["fusermount"
"mount" "umount" "sudo" "xlaunch"
"lsof" "suid-chroot" "fbterm" "pmount"
"pumount"
];
setuidOwners = [
{
program = "sendmail";
group = "postdrop";
setgid = true;
}
{
program = "postdrop";
group = "postdrop";
setgid = true;
}
];
sudo = {
configFile = "
#generated
raskin ALL= NOPASSWD: /etc/sudo-scripts/setfreq,\\
/etc/sudo-scripts/standby,\\
/etc/sudo-scripts/xfs,\\
/var/run/current-system/sw/bin/wodim,\\
/var/run/current-system/sw/sbin/halt,\\
/etc/sudo-scripts/dateupdate,\\
/etc/sudo-scripts/eth,\\
/etc/sudo-scripts/wifi,\\
/etc/sudo-scripts/wvdial,\\
/etc/sudo-scripts/nonet,\\
/etc/sudo-scripts/up-ifs,\\
/etc/sudo-scripts/brightness,\\
/etc/sudo-scripts/renice0,\\
/etc/sudo-scripts/glusterfs-start,\\
/etc/sudo-scripts/gvpe-start,\\
/etc/sudo-scripts/chmod,\\
/etc/sudo-scripts/update-mesa-link,\\
/etc/sudo-scripts/arpflush,\\
/etc/sudo-scripts/wpa-status,\\
/etc/sudo-scripts/nas-halt,\\
/etc/sudo-scripts/wifi-scan,\\
/etc/sudo-scripts/start-home-multiplexor,\\
/etc/sudo-scripts/eth-for-nas,\\
/etc/sudo-scripts/home-alt-net,\\
/etc/sudo-scripts/nix-cleanup-tests
raskin ALL= NOPASSWD: SETENV: /etc/sudo-scripts/checkGw6
raskin ALL= /bin/sh
Defaults!/bin/sh rootpw, timestamp_timeout=0
Defaults!/etc/sudo-scripts/wpa-status !syslog
sshguest ALL= /var/run/current-system/sw/bin/ls /home/sshguest
wwwrun ALL= NOPASSWD: /var/run/current-system/sw/bin/mplayer,\\
/var/run/current-system/sw/bin/amixer
xserver ALL= NOPASSWD: /var/run/current-system/sw/sbin/start xserver,\\
/var/run/current-system/sw/sbin/stop xserver
halt ALL= NOPASSWD: /var/run/current-system/sw/sbin/halt
";
};
};
hardware = {
firmware = ["/var/lib/firmware"];
pulseaudio.enable = false;
};
powerManagement = {
enable = true;
powerUpCommands = ''
${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda
echo 1 > /sys/class/backlight/acpi_video0/brightness
'';
};
};
in
base // {
nesting = {
children = [
];
};
}