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
|
{ config, pkgs, lib, ... }:
{
vuizvui.user.devhell.profiles.base.enable = true;
vuizvui.system.kernel.bfq.enable = true;
boot = {
loader = {
timeout = 2;
systemd-boot = {
enable = true;
};
efi.canTouchEfiVariables = true;
};
initrd = {
availableKernelModules = [ "xhci_hcd" "ahci" "usb_storage" "sd_mod" "rtsx_pci_sdmmc" ];
kernelModules = [ "fuse" ];
};
kernelModules = [ "kvm-intel" ];
extraModulePackages = [ ];
};
hardware = {
opengl = {
enable = true;
extraPackages = [ pkgs.libvdpau-va-gl pkgs.vaapiVdpau pkgs.vaapiIntel ];
};
};
fileSystems."/" = {
device = "/dev/disk/by-uuid/3099f245-51cf-4ca8-b89c-269dbc0ad730";
fsType = "btrfs";
options = [
"space_cache"
"compress=zstd"
"noatime"
"autodefrag"
];
};
fileSystems."/boot" = {
device = "/dev/disk/by-uuid/9344-E6FE";
fsType = "vfat";
};
swapDevices = [
{ device = "/dev/disk/by-uuid/ff725995-b9a1-453f-9e6d-ba9bd6579db6"; }
];
# FIXME Check if this is still necessary in the future
systemd.services.systemd-networkd-wait-online.enable = false;
# XXX Ensure that these are added in addition to the DHCP proviced DNS servers
systemd.network.networks."99-main".dns = [ "1.1.1.1" "8.8.8.8" ];
networking = {
hostName = "titan";
wireless.enable = true;
useNetworkd = true;
};
powerManagement = {
powertop.enable = true;
cpuFreqGovernor = "powersave";
};
virtualisation.docker.enable = true;
nix = {
maxJobs = lib.mkDefault 4;
extraOptions = ''
auto-optimise-store = true
'';
};
i18n = {
consoleFont = "lat9w-16";
consoleKeyMap = "uk";
defaultLocale = "en_GB.UTF-8";
};
#### Machine-specific service configuration ####
vuizvui.user.devhell.profiles.services.enable = true;
services = {
tftpd.enable = false;
gnome3.gnome-keyring.enable = true;
printing = {
enable = true;
drivers = [ pkgs.foo2zjs pkgs.cups-brother-hl1110 ];
};
};
services.acpid = {
enable = true;
lidEventCommands = ''
LID="/proc/acpi/button/lid/LID/state"
state=`cat $LID | ${pkgs.gawk}/bin/awk '{print $2}'`
case "$state" in
*open*) ;;
*close*) systemctl suspend ;;
*) logger -t lid-handler "Failed to detect lid state ($state)" ;;
esac
'';
};
services.compton = {
enable = true;
backend = "glx";
vSync = "drm";
extraOptions = ''
inactive-dim = 0.2;
'';
};
services.xserver = {
enable = true;
layout = "gb";
videoDrivers = [ "modesetting" ];
libinput = {
enable = true;
disableWhileTyping = true;
middleEmulation = true;
};
# synaptics = {
# enable = true;
# twoFingerScroll = true;
# palmDetect = true;
# };
# XXX: Factor out and make DRY, because a lot of the stuff here is
# duplicated in the other machine configurations.
displayManager.sessionCommands = ''
${pkgs.xbindkeys}/bin/xbindkeys &
${pkgs.nitrogen}/bin/nitrogen --restore &
#${pkgs.networkmanagerapplet}/bin/nm-applet &
#${pkgs.connmanui}/bin/connman-ui-gtk &
${pkgs.xscreensaver}/bin/xscreensaver -no-splash &
#${pkgs.pasystray}/bin/pasystray &
#${pkgs.compton}/bin/compton -f -c &
${pkgs.rofi}/bin/rofi &
${pkgs.xorg.xrdb}/bin/xrdb "${pkgs.writeText "xrdb.conf" ''
Xft.dpi: 96
Xft.antialias: true
Xft.hinting: full
Xft.hintstyle: hintslight
Xft.rgba: rgb
Xft.lcdfilter: lcddefault
Xft.autohint: 1
Xcursor.theme: Vanilla-DMZ-AA
Xcursor.size: 22
*.charClass:33:48,35:48,37:48,43:48,45-47:48,61:48,63:48,64:48,95:48,126:48,35:48,58:48
*background: #121212
*foreground: #babdb6
${lib.concatMapStrings (xterm: ''
${xterm}.termName: xterm-256color
${xterm}*bellIsUrgent: true
${xterm}*utf8: 1
${xterm}*locale: true
${xterm}*utf8Title: true
${xterm}*utf8Fonts: 1
${xterm}*utf8Latin1: true
${xterm}*dynamicColors: true
${xterm}*eightBitInput: true
${xterm}*faceName: xft:DejaVu Sans Mono for Powerline:pixelsize=9:antialias=true:hinting=true
${xterm}*faceNameDoublesize: xft:Unifont:pixelsize=12:antialias=true:hinting=true
${xterm}*cursorColor: #545f65
'') [ "UXTerm" "XTerm" ]}
''}"
'';
};
#### Machine-specific packages configuration ####
vuizvui.user.devhell.profiles.packages.enable = true;
nixpkgs.config.mpv.vaapiSupport = true;
environment.systemPackages = with pkgs; [
aircrackng
cdrtools
docker
dvdplusrwtools
glxinfo
horst
ipmitool
iw
kismet
libva
libvdpau-va-gl
minicom
pamixer
pmtools
pmutils
reaverwps
signal-desktop
snort
vaapiVdpau
vdpauinfo
wavemon
xbindkeys
xorg.xbacklight
];
}
|