-
Notifications
You must be signed in to change notification settings - Fork 0
/
configuration.nix
72 lines (63 loc) · 1.96 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
# 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, ... }:
let modprobe = "${config.system.sbin.modprobe}/sbin/modprobe";
in
{
imports =
[ # Include the results of the hardware scan.
/etc/nixos/common.nix
/etc/nixos/hardware-configuration.nix
];
boot = {
loader = {
gummiboot.enable = true;
efi.canTouchEfiVariables = true;
};
extraModprobeConfig = ''
options snd_hda_intel index=0 model=intel-mac-auto id=PCH
options snd_hda_intel index=1 model=intel-mac-auto id=HDMI
'';
kernelParams = [
"hid_apple.fnmode=2" # f8 is f8, fn + f8 is media key
];
};
networking.hostName = "vandel-macair";
boot.extraModulePackages = [ config.boot.kernelPackages.mba6x_bl ];
systemd.services.mba6x_blWorkaround = {
description = "Remove and reload mba6x to workaround no brightness bug (https://github.com/patjak/mba6x_bl/issues/43)";
wantedBy = [ "multi-user.target" ];
script = "${modprobe} -r mba6x_bl && ${modprobe} mba6x_bl";
serviceConfig = {
Type = "oneshot";
};
};
hardware = {
facetimehd.enable = true;
};
services = {
# disable XHC1 acpi to avoid resume directly after suspend
udev.extraRules = ''SUBSYSTEM=="pci", KERNEL=="0000:00:14.0", ATTR{power/wakeup}="disabled"'';
# power savings
upower.enable = true;
tlp.enable = true;
xserver = {
vaapiDrivers = [ pkgs.vaapiIntel pkgs.vaapiVdpau ];
# keyboard settings
xkbOptions = "ctrl:nocaps"; # make capslock = ctrl
# touchpad
synaptics = {
enable = true;
accelFactor = "0.1";
minSpeed = "0.5";
maxSpeed = "1";
tapButtons = true;
additionalOptions = ''
Option "TapButton1" "1"
Option "TapButton2" "3"
'';
};
};
};
}