air-quality-monitor/flake.nix

46 lines
1.2 KiB
Nix
Raw Permalink Normal View History

2023-11-28 17:35:38 +00:00
{
description = "An air quality monitoring service with a Raspberry Pi and a SDS011 sensor.";
2023-11-28 21:26:20 +00:00
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
flake-parts.url = "github:hercules-ci/flake-parts";
};
2023-11-28 17:35:38 +00:00
outputs = {
self,
2023-11-28 21:26:20 +00:00
flake-parts,
...
} @ inputs:
flake-parts.lib.mkFlake {inherit inputs;} {
imports = [./nix/tests];
2023-11-28 17:35:38 +00:00
2023-11-28 21:26:20 +00:00
systems = ["x86_64-linux" "aarch64-linux"];
perSystem = {
self',
pkgs,
...
}: {
formatter = pkgs.alejandra;
2023-11-28 17:35:38 +00:00
2023-11-28 21:26:20 +00:00
packages = {
default = self'.packages.air-quality-monitor;
air-quality-monitor = pkgs.callPackage ./nix/packages/air-quality-monitor.nix {inherit self;};
dummy-serial = pkgs.callPackage ./nix/packages/dummy-serial.nix {};
2023-11-28 23:02:15 +00:00
};
devShells = {
default = self'.devShells.air-quality-monitor;
air-quality-monitor = pkgs.mkShell {
inputsFrom = self'.packages.air-quality-monitor.pythonPath;
2023-11-28 23:02:15 +00:00
};
2023-11-28 21:26:20 +00:00
};
};
flake = {
nixosModules = {
default = self.nixosModules.pi-air-quality-monitor;
2023-11-28 23:02:15 +00:00
pi-air-quality-monitor = import ./nix/module.nix self;
2023-11-28 21:26:20 +00:00
};
};
};
2023-11-28 17:35:38 +00:00
}