-
Notifications
You must be signed in to change notification settings - Fork 5
/
raskin-asus-ux32ln.nix
240 lines (210 loc) · 7.36 KB
/
raskin-asus-ux32ln.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
# ASUS UX32LN
# 00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
# 00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
# 00:03.0 Audio device: Intel Corporation Device 0a0c (rev 09)
# 00:04.0 Signal processing controller: Intel Corporation Device 0a03 (rev 09)
# 00:14.0 USB controller: Intel Corporation Lynx Point-LP USB xHCI HC (rev 04)
# 00:16.0 Communication controller: Intel Corporation Lynx Point-LP HECI #0 (rev 04)
# 00:1b.0 Audio device: Intel Corporation Lynx Point-LP HD Audio Controller (rev 04)
# 00:1c.0 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 1 (rev e4)
# 00:1c.3 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 4 (rev e4)
# 00:1c.4 PCI bridge: Intel Corporation Lynx Point-LP PCI Express Root Port 5 (rev e4)
# 00:1f.0 ISA bridge: Intel Corporation Lynx Point-LP LPC Controller (rev 04)
# 00:1f.2 SATA controller: Intel Corporation Lynx Point-LP SATA Controller 1 [AHCI mode] (rev 04)
# 00:1f.3 SMBus: Intel Corporation Lynx Point-LP SMBus Controller (rev 04)
# 00:1f.6 Signal processing controller: Intel Corporation Lynx Point-LP Thermal (rev 04)
# 02:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network Adapter (rev 01)
# 03:00.0 3D controller: NVIDIA Corporation Device 1341 (rev a2)
{config, pkgs, ...}:
let
myTexLive = import ./texlive-set.nix pkgs;
myKDE = pkgs.kde414;
kernelToUse = (import ./kernel-options.nix pkgs).baseKernel;
packageGroups = import /home/raskin/src/nix/configurations/misc/raskin/package-groups.nix {
inherit pkgs myTexLive myKDE;
baseKernel = kernelToUse;
};
base = {
require = [
./asus-ux32ln-r4031h.nix
];
boot = {
loader.gummiboot = {
enable = true;
timeout=3;
};
kernelPackages = kernelToUse.kernelPackages;
extraModulePackages = kernelToUse.extraModulePackages;
hardwareScan = false;
kernelModules = [
"usb-storage" "mousedev" "evdev" "psmouse" "msr" "tun"
"ac" "battery" "thermal" "fuse" "loop" "rtc-cmos"
"sysdig-probe" "ax88179_178a" "smsc75xx" "asix" "cdc_ether"
"usbhid" "hid-generic"
];
kernelParams=[];
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/
/var/run/current-system/sw/bin/mkdir -p /dev/cgroup/cpu
/run/current-system/sw/sbin/sysctl kernel.shmmax=1200000000
echo 10 > /sys/class/backlight/acpi_video0/brightness
echo 0 > /sys/class/leds/asus::kbd_backlight/brightness
'';
};
swapDevices = [
{label = "Swap";}
];
fileSystems = import ./filesystems-asus-ux32ln.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")]
++ (pkgs.lib.concatLists (pkgs.lib.attrValues bootstrap))
++ (pkgs.lib.concatLists (pkgs.lib.attrValues constantly_used))
;
pathsToLink = ["/"];
shellInit = ''
export PATH=$HOME/script/override:$PATH:$HOME/script
'';
};
fonts = import ./fonts.nix {inherit pkgs;};
time = {
timeZone = "Etc/GMT-3";
};
nix = {
useChroot = true;
chrootDirs = ["/home/repos"];
distributedBuilds = true;
buildMachines = with import ./nix-build-machines.nix; [
gb-bxi7-4770r-1
gb-bxi7-4770r-1-i686
];
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 {
#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}
'';
doInstallCheck = false;
});
};
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 = import ./setuid-programs.nix;
setuidOwners = [
{
program = "sendmail";
group = "postdrop";
setgid = true;
}
{
program = "postdrop";
group = "postdrop";
setgid = true;
}
];
sudo = {
configFile = (builtins.readFile ./sudoers); };
};
hardware = {
firmware = ["/var/lib/firmware"];
pulseaudio.enable = false;
bluetooth.enable = false;
bumblebee.group = "video";
};
powerManagement = {
enable = true;
powerUpCommands = ''
${pkgs.hdparm}/sbin/hdparm -B 255 /dev/sda
echo 10 > /sys/class/backlight/acpi_video0/brightness
echo 0 > /sys/class/leds/asus::kbd_backlight/brightness
'';
};
programs = {
ssh = {
extraConfig = ''
ConnectTimeout 3
'';
};
};
};
in
base // {
nesting = {
children = [
];
};
}