air-quality-monitor/flake.nix

45 lines
1.1 KiB
Nix
Raw 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 = {
2023-11-28 23:02:15 +00:00
default = self'.packages.pi-air-quality-monitor;
2023-11-28 21:26:20 +00:00
pi-air-quality-monitor = pkgs.callPackage ./nix/default.nix {};
2023-11-28 23:02:15 +00:00
};
devShells = {
2023-11-28 21:26:20 +00:00
default = self'.packages.pi-air-quality-monitor;
2023-11-28 23:02:15 +00:00
pi-air-quality-monitor = pkgs.mkShell {
inputsFrom = self'.packages.pi-air-quality-monitor.pythonPath;
};
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
}