-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfiguration.nix
127 lines (102 loc) · 2.38 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
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
{ config, pkgs, lib, ... }:
let
user = "alien";
password = "alien";
hostname = "roboblast";
in {
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
options = [ "noatime" ];
};
};
time.timeZone = "Europe/Berlin";
boot.loader.timeout = 1;
networking = {
hostName = hostname;
wireless.enable = false;
firewall = {
enable = true;
allowedTCPPorts = [ 80 443 4444 ];
};
};
systemd.user.services.leds = {
description = "roboclub lighting";
serviceConfig = {
WorkingDirectory = "%h/leds";
ExecStart = "%h/leds/robolab";
};
wantedBy = ["default.target"];
};
environment.systemPackages = with pkgs; [
# gui
chromium
# cli
neovim
file
pciutils
# pi dtbo
dtc
];
services.openssh.enable = true;
programs.fish.enable = true;
users = {
mutableUsers = false;
users."${user}" = {
isNormalUser = true;
initialPassword = password;
extraGroups = [ "wheel" "spi" "gpio" ];
shell = pkgs.fish;
};
};
# Enable GPU acceleration
hardware.raspberry-pi."4" = {
fkms-3d.enable = true;
audio.enable = true;
apply-overlays-dtmerge.enable = true;
};
# enable SPI
hardware.deviceTree = {
enable = true;
overlays = [
{
name = "spi";
dtboFile = ./spi0-0cs.dtbo;
}
];
};
boot.extraModprobeConfig = ''
options spidev bufsiz=8192
'';
users.groups.spi = {};
users.groups.gpio = {};
services.udev.extraRules = ''
SUBSYSTEM=="spidev", KERNEL=="spidev0.0", GROUP="spi", MODE="0660"
SUBSYSTEM=="gpio*", GROUP="gpio", MODE="0660"
SUBSYSTEM=="bcm2835-gpiomem", GROUP="gpio", MODE="0660"
'';
hardware.pulseaudio.enable = true;
services.xserver = {
enable = true;
displayManager = {
lightdm.enable = true;
autoLogin = {
enable = true;
user = "alien";
};
};
# desktopManager.xfce.enable = true;
desktopManager.gnome.enable = true;
# rotate 180 deg for Elo Touchmonitor
inputClassSections = [
''
Identifier "Elo Touchmonitor"
MatchProduct "Elo TouchSystems 2700 IntelliTouch(r) USB Touchmonitor Interface"
Option "TransformationMatrix" "-1 0 1 0 -1 1 0 0 1"
''
];
};
nixpkgs.config.allowUnfree = true;
system.stateVersion = "23.05";
}