- Added `black` to the development environment in flake.nix for code formatting. - Updated shell hook to include instructions for using `black`. - Refactored `main.py` to improve code organization and readability, including reordering imports and simplifying list comprehensions. - Enhanced album processing functions for better clarity and efficiency. - Improved error handling and output formatting for better user experience.
42 lines
1.0 KiB
Nix
42 lines
1.0 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 }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = import nixpkgs { inherit system; };
|
|
pythonEnv = pkgs.python3.withPackages (ps: with ps; [
|
|
requests
|
|
python-dotenv
|
|
]);
|
|
in
|
|
{
|
|
devShells.default = pkgs.mkShell {
|
|
buildInputs = [
|
|
pythonEnv
|
|
pkgs.black
|
|
];
|
|
shellHook = ''
|
|
echo "Python environment ready!"
|
|
echo "Run: python main.py"
|
|
echo "Format code with: black main.py"
|
|
'';
|
|
};
|
|
|
|
packages.default = pkgs.writeShellApplication {
|
|
name = "lidarr-musicbrainz";
|
|
runtimeInputs = [ pythonEnv ];
|
|
text = ''
|
|
python ${./main.py} "$@"
|
|
'';
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|