-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdevices.nix
102 lines (102 loc) · 3.13 KB
/
devices.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
args@{ ... }:
let
inherit (args) inputs lib;
deviceConfig =
{
generic-x86_64 = { ... }: {
nixpkgs.hostPlatform = "x86_64-linux";
};
generic-aarch64 = { ... }: {
nixpkgs.hostPlatform = "aarch64-linux";
};
raspberry-pi-3 = { modulesPath, ... }: {
disabledModules = [
"${modulesPath}/installer/sd-card/sd-image-aarch64.nix"
];
imports = [
inputs.raspberry-pi-nix.nixosModules.raspberry-pi
];
raspberry-pi-nix.libcamera-overlay.enable = false;
raspberry-pi-nix.board = "bcm2711";
hardware.raspberry-pi.config = {
all = {
base-dt-params = {
audio = {
enable = true;
};
};
};
};
boot.kernelModules = [ "vc4" "bcm2835_dma" "i2c_bcm2835" ];
nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
})
];
nixpkgs.hostPlatform = "aarch64-linux";
};
raspberry-pi-4 = { modulesPath, ... }: {
disabledModules = [
"${modulesPath}/installer/sd-card/sd-image-aarch64.nix"
];
imports = [
inputs.raspberry-pi-nix.nixosModules.raspberry-pi
];
raspberry-pi-nix.libcamera-overlay.enable = false;
raspberry-pi-nix.board = "bcm2711";
boot.kernelParams = [ "snd_bcm2835.enable_headphones=1" "snd_bcm2835.enable_hdmi=1" "brcmfmac.roamoff=1" "brcmfmac.feature_disable=0x282000" ];
hardware.raspberry-pi.config = {
all = {
dt-overlays = {
vc4-fkms-v3d = { enable = true; params = { }; };
};
};
};
nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
})
];
nixpkgs.hostPlatform = "aarch64-linux";
};
raspberry-pi-5 = { pkgs, modulesPath, ... }: {
disabledModules = [
"${modulesPath}/installer/sd-card/sd-image-aarch64.nix"
];
imports = [
inputs.raspberry-pi-nix.nixosModules.raspberry-pi
];
raspberry-pi-nix.libcamera-overlay.enable = false;
raspberry-pi-nix.board = "bcm2712";
nixpkgs.overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // { allowMissing = true; });
})
];
nixpkgs.hostPlatform = "aarch64-linux";
hardware.raspberry-pi.config = {
all = {
dt-overlays = {
vc4-kms-v3d-pi5 = { enable = true; params = { }; };
};
};
};
hardware.graphics = {
enable = true;
extraPackages = [ pkgs.mesa.drivers ];
};
services.xserver.extraConfig = ''
Section "OutputClass"
Identifier "vc4"
MatchDriver "vc4"
Driver "modesetting"
Option "PrimaryGPU" "true"
EndSection
'';
};
};
in
deviceConfig