-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
50 lines (39 loc) · 1.26 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
{
description = "Meshtastic (native) for NixOS";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
};
outputs = { self, nixpkgs }@inputs: let
allSystems = nixpkgs.lib.systems.flakeExposed;
forSystems = systems: f: nixpkgs.lib.genAttrs systems (system: f system);
in {
devShells = forSystems allSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
default = pkgs.mkShell {
name = "nixos-meshtastic";
nativeBuildInputs = with pkgs; [
nil # lsp language server for nix
nixpkgs-fmt
nix-output-monitor
];
};
});
nixosModules = {
default = import ./modules/meshtastic.nix;
# Tries to automagically configure SPI and I2C on Raspberry Pi
# with `config.txt`
# requires nvmd/nixos-raspberrypi
raspberry-pi = import ./modules/raspberry-pi.nix;
};
packages = forSystems allSystems (system: let
pkgs = nixpkgs.legacyPackages.${system};
in {
meshtasticd = pkgs.callPackage ./pkgs/meshtasticd.nix {
inherit (self.packages.${system}) libyaml-cpp ulfius;
};
libyaml-cpp = pkgs.callPackage ./pkgs/libyaml-cpp.nix {};
ulfius = pkgs.callPackage ./pkgs/ulfius.nix {};
});
};
}