-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrpi.nix
67 lines (58 loc) · 1.48 KB
/
rpi.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
{
config,
pkgs,
lib,
...
}: {
imports = [
./common.nix
];
config = {
machine = "rpi";
nixpkgs.config.allowUnsupportedSystem = true;
nixpkgs.overlays = [
(self: super: {
python37 = super.python37.override {
packageOverrides = pself: psuper: {
discordpy = psuper.discordpy.overrideAttrs (attrs: {
patchPhase = ''
substituteInPlace "requirements.txt" \
--replace "aiohttp>=3.6.0,<3.7.0" "aiohttp>=3.6.0,<3.8.0" \
'';
});
};
};
})
];
boot.loader.grub.enable = false;
boot.loader.generic-extlinux-compatible.enable = true;
boot.kernelPackages = pkgs.linuxPackages_4_19;
boot.kernelParams = ["cma=32M"];
fileSystems = {
"/" = {
device = "/dev/disk/by-label/NIXOS_SD";
fsType = "ext4";
};
};
swapDevices = [
{
device = "/swapfile";
size = 1024;
}
];
networking.networkmanager.enable = true;
networking.hostName = "rpi-nixos";
hardware.enableRedistributableFirmware = true;
systemd.user.services.bookbot = {
enable = true;
wantedBy = ["multi-user.target"];
description = "BookBot service";
path = [(pkgs.python37.withPackages (p: [p.discordpy p.gspread p.oauth2client]))];
script = "/home/alex/BookBot/discordbot.py";
serviceConfig = {
RestartSec = 3;
Restart = "always";
};
};
};
}