-
Notifications
You must be signed in to change notification settings - Fork 1
/
default.nix
181 lines (164 loc) · 4.39 KB
/
default.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
machineName:
{ config, pkgs, ... }:
let
thisPath = ./.;
home-manager-src = import "${thisPath}/deps/home-manager";
in {
imports =
[ # Include the results of the hardware scan.
/etc/nixos/hardware-configuration.nix
"${thisPath}/machine.${machineName}.nix"
"${home-manager-src}/nixos"
];
boot = {
loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
};
};
# acpi_call makes tlp work for newer thinkpads
kernelModules = [ "acpi_call" ];
extraModulePackages = with config.boot.kernelPackages; [ acpi_call ];
kernel.sysctl = {
"vm.swappiness" = 1;
};
initrd.kernelModules = [ "i915" ];
};
nixpkgs.config.allowUnfree = true;
nix = {
binaryCaches = [
"https://cache.nixos.org/"
"https://cachix.cachix.org"
"https://all-hies.cachix.org"
"https://nixcache.reflex-frp.org"
"https://hydra.qfpl.io"
];
binaryCachePublicKeys = [
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY="
"cachix.cachix.org-1:eWNHQldwUO7G2VkjpnjDbWwy4KQ/HNxht7H4SSoMckM="
"all-hies.cachix.org-1:JjrzAOEUsD9ZMt8fdFbzo3jNAyEWlPAwdVuHw4RD43k="
"ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI="
"qfpl.io:xME0cdnyFcOlMD1nwmn6VrkkGgDNLLpMXoMYl58bz5g="
];
trustedUsers = [ "root" "chris" ];
};
networking = {
networkmanager.enable = true;
firewall = {
enable = true;
allowedTCPPorts = [];
};
hostName = "${machineName}";
};
hardware = {
pulseaudio = {
enable = true;
package = pkgs.pulseaudioFull;
daemon.config = {
flat-volumes = "no";
};
};
bluetooth = {
enable = true;
};
brightnessctl.enable = true;
opengl = {
enable = true;
driSupport32Bit = true;
extraPackages = with pkgs; [
vaapiIntel
vaapiVdpau
libvdpau-va-gl
];
};
cpu.intel.updateMicrocode = config.hardware.enableRedistributableFirmware;
};
sound.enable = true;
time.timeZone = "Australia/Brisbane";
# Select internationalisation properties.
i18n = {
consoleFont = "Lat2-Terminus16";
consoleKeyMap = "us";
defaultLocale = "en_AU.UTF-8";
};
fonts = {
enableFontDir = true;
fonts = with pkgs; [
corefonts # Micrsoft free fonts
noto-fonts-emoji
emojione
(nerdfonts.override {withFont = "SourceCodePro";})
(nerdfonts.override {withFont = "Terminus";})
(nerdfonts.override {withFont = "FiraCode";})
(nerdfonts.override {withFont = "AnonymousPro";})
# terminus_font # for hidpi screens, large fonts
];
};
environment.systemPackages = with pkgs; [
];
programs = {
bash.enableCompletion = true;
ssh.startAgent = true;
};
virtualisation = {
virtualbox = {
host.enable = true;
host.enableExtensionPack = true;
};
docker = {
enable = true;
};
};
services = {
openssh = {
enable = true;
permitRootLogin = "no";
passwordAuthentication = false;
};
dbus.packages = [ pkgs.blueman ];
upower.enable = true;
printing.enable = true;
blueman.enable = true;
xserver = {
dpi = 120;
enable = true;
layout = "us";
displayManager.lightdm.enable = true;
xkbOptions = "ctrl:nocaps";
libinput = {
enable = true;
naturalScrolling = true;
};
};
fwupd.enable = true;
tlp = {
enable = true;
extraConfig = "
CPU_SCALING_GOVERNOR_ON_AC=performance
CPU_SCALING_GOVERNOR_ON_BAT=powersave
";
};
fstrim.enable = true;
};
powerManagement = {
enable = true;
# unset the governor so tlp can take over
cpuFreqGovernor = null;
};
# Define a user account. Don't forget to set a password with ‘passwd’.
home-manager.users.chris = import ./home-manager "${machineName}";
users.extraUsers.chris = {
createHome = true;
extraGroups = ["wheel" "video" "audio" "disk" "networkmanager"];
home = "/home/chris";
isNormalUser = true;
shell = pkgs.zsh;
uid = 1000;
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "19.09"; # Did you read the comment?
}