- Introduced a new NixOS module for the lidarr-mb-gap service, allowing users to configure and manage the report generation process through NixOS. - Added a comprehensive deployment guide in `nixos/DEPLOYMENT.md`, detailing setup instructions, configuration options, and troubleshooting tips for deploying the service on NixOS and serving reports via Caddy. - Updated `flake.nix` to export the new NixOS module. - Enhanced the report generation scripts to support customizable output paths for generated reports.
68 lines
1.9 KiB
Nix
68 lines
1.9 KiB
Nix
{
|
|
description = "Lidarr to MusicBrainz Missing Albums Finder";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
let
|
|
# NixOS module output (not system-specific)
|
|
# The module accepts a package option, which can be set from the flake's packages
|
|
nixosModules = {
|
|
lidarr-mb-gap = import ./nixos/lidarr-mb-gap.nix;
|
|
};
|
|
in
|
|
{
|
|
# Export NixOS modules
|
|
nixosModules = nixosModules;
|
|
} // flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
lib = pkgs.lib;
|
|
lidarr-mb-gap = pkgs.python3Packages.buildPythonApplication {
|
|
pname = "lidarr-mb-gap";
|
|
version = "1.0.0";
|
|
src = lib.cleanSource ./src;
|
|
format = "pyproject";
|
|
nativeBuildInputs = with pkgs.python3Packages; [
|
|
setuptools
|
|
];
|
|
propagatedBuildInputs = with pkgs.python3Packages; [
|
|
requests
|
|
python-dotenv
|
|
];
|
|
};
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = [
|
|
(pkgs.python3.withPackages (ps: with ps; [
|
|
requests
|
|
python-dotenv
|
|
]))
|
|
pkgs.black
|
|
];
|
|
shellHook = ''
|
|
echo "Python environment ready!"
|
|
echo "Run: python src/main.py"
|
|
echo "Format code with: black src/"
|
|
'';
|
|
};
|
|
|
|
packages.default = lidarr-mb-gap;
|
|
packages.lidarr-mb-gap = lidarr-mb-gap;
|
|
apps.default = {
|
|
type = "app";
|
|
program = "${lidarr-mb-gap}/bin/lidarr-mb-gap";
|
|
};
|
|
apps.lidarr-mb-gap = {
|
|
type = "app";
|
|
program = "${lidarr-mb-gap}/bin/lidarr-mb-gap";
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|