-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
98 lines (93 loc) · 2.79 KB
/
flake.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
{
description = "NixOS Raspberry Pi configuration flake";
inputs = {
nixpkgs = {
url = "github:NixOS/nixpkgs/nixos-unstable";
};
nixos-hardware.url = "github:NixOS/nixos-hardware/master";
flake-utils.url = "github:numtide/flake-utils";
deploy-rs.url = "github:serokell/deploy-rs";
hydrophonitor-gps.url = "github:nordic-dev-net/hydrophonitor-gps";
depth-recorder.url = "github:nordic-dev-net/depth-recorder";
};
outputs = {
self,
nixpkgs,
nixos-hardware,
flake-utils,
deploy-rs,
hydrophonitor-gps,
depth-recorder,
...
}: let
forEachSystem = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"];
forEachPkgs = f: forEachSystem (sys: f (nixpkgs.legacyPackages.${sys}));
system = "aarch64-linux";
pkgs = import nixpkgs {
inherit system;
config = {allowUnfree = true;};
overlays = [
(final: super: {
makeModulesClosure = x:
super.makeModulesClosure (x // {allowMissing = true;});
})
];
};
in {
systems = {
raspberry-pi-4 = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = {inherit pkgs;};
modules = [
./targets/raspberry-pi-4
./modules/audio-recorder
./modules/logging
./modules/real-time-clock/i2c-rtc.nix
./modules/shutdown-button/service.nix
nixos-hardware.nixosModules.raspberry-pi-4
hydrophonitor-gps.nixosModules.hydrophonitor-gps
depth-recorder.nixosModules.depth-recorder
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
];
};
raspberry-pi-3 = nixpkgs.lib.nixosSystem {
system = "aarch64-linux";
specialArgs = {inherit pkgs;};
modules = [
./targets/raspberry-pi-3
./modules/audio-recorder
./modules/real-time-clock/i2c-rtc.nix
hydrophonitor-gps.nixosModules.hydrophonitor-gps
"${nixpkgs}/nixos/modules/installer/sd-card/sd-image-aarch64.nix"
];
};
};
deploy.nodes = {
raspberry-pi-4 = {
hostname = "192.168.1.76";
profiles.system = {
sshUser = "kaskelotti";
sshOpts = ["-t"];
magicRollback = false;
path =
deploy-rs.lib.aarch64-linux.activate.nixos
self.systems.raspberry-pi-4;
user = "root";
};
};
raspberry-pi-3 = {
hostname = "192.168.1.117";
profiles.system = {
sshUser = "kaskelotti";
sshOpts = ["-t"];
magicRollback = false;
path =
deploy-rs.lib.aarch64-linux.activate.nixos
self.systems.raspberry-pi-3;
user = "root";
};
};
};
formatter = forEachPkgs (pkgs: pkgs.alejandra);
};
}