From e113bfa1c745157353249d137359080ed3ebcbf3 Mon Sep 17 00:00:00 2001 From: veneficium Date: Sun, 21 Dec 2025 14:50:37 +0100 Subject: [PATCH] package soularr --- flake.nix | 12 ++++++++++- overlays/soularr.nix | 4 ++++ packages/slskd-api.nix | 32 ++++++++++++++++++++++++++++ packages/soularr.nix | 48 ++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 overlays/soularr.nix create mode 100644 packages/slskd-api.nix create mode 100644 packages/soularr.nix diff --git a/flake.nix b/flake.nix index 0605c5a..4e1c5eb 100644 --- a/flake.nix +++ b/flake.nix @@ -58,7 +58,7 @@ helix, ... }: - { + rec { nixosConfigurations = { fedfer-main-laptop-nixos = nixpkgs.lib.nixosSystem { system = "x86_64-linux"; @@ -88,11 +88,21 @@ modules = [ arion.nixosModules.arion + { + nixpkgs.overlays = [ ((import ./overlays/soularr.nix) packages.x86_64-linux.soularr) ]; + } ./hosts/main-homelab/configuration.nix ]; }; }; + packages.x86_64-linux = rec { + slskd-api = (nixpkgs.legacyPackages.x86_64-linux.callPackage ./packages/slskd-api.nix { }); + soularr = ( + nixpkgs.legacyPackages.x86_64-linux.callPackage ./packages/soularr.nix { inherit slskd-api; } + ); + }; + formatter.x86_64-linux = (treefmt-nix.lib.evalModule nixpkgs.legacyPackages."x86_64-linux" ./treefmt.nix) .config.build.wrapper; diff --git a/overlays/soularr.nix b/overlays/soularr.nix new file mode 100644 index 0000000..2914c62 --- /dev/null +++ b/overlays/soularr.nix @@ -0,0 +1,4 @@ +{ soularr, ... }: +(final: prev: { + soularr = soularr; +}) diff --git a/packages/slskd-api.nix b/packages/slskd-api.nix new file mode 100644 index 0000000..4ab5c04 --- /dev/null +++ b/packages/slskd-api.nix @@ -0,0 +1,32 @@ +{ + lib, + python3Packages, + fetchFromGitHub, +}: + +python3Packages.buildPythonPackage rec { + pname = "slskd-api"; + version = "0.1.5"; + pyproject = true; + + src = fetchFromGitHub { + owner = "bigoulours"; + repo = "slskd-python-api"; + tag = "v${version}"; + hash = "sha256-Kyzbd8y92VFzjIp9xVbhkK9rHA/6KCCJh7kNS/MtixI="; + }; + + nativeBuildInputs = with python3Packages; [ setuptools-git-versioning ]; + + dependencies = with python3Packages; [ requests ]; + + pythonImportsCheck = [ "slskd_api" ]; + + meta = { + description = "API Wrapper to interact with slskd"; + homepage = "https://slskd-api.readthedocs.io/"; + changelog = "https://github.com/bigoulours/slskd-python-api/releases/tag/${src.tag}"; + license = lib.licenses.agpl3Only; + maintainers = with lib.maintainers; [ getchoo ]; + }; +} diff --git a/packages/soularr.nix b/packages/soularr.nix new file mode 100644 index 0000000..5a41549 --- /dev/null +++ b/packages/soularr.nix @@ -0,0 +1,48 @@ +{ + lib, + fetchFromGitHub, + installShellFiles, + python3Packages, + slskd-api, +}: + +python3Packages.buildPythonApplication { + pname = "soularr"; + version = "0-unstable-2025-02-05"; + pyproject = false; + + src = fetchFromGitHub { + owner = "mrusse"; + repo = "soularr"; + rev = "dc23f6d11fb2148c35168028b6b2fdfd0c502957"; + hash = "sha256-znEubXeQmEmE8swmgDSliTh/v/k3t55jzchWCAd9bGc="; + }; + + nativeBuildInputs = [ installShellFiles ]; + + dependencies = with python3Packages; [ + music-tag + pyarr + slskd-api + ]; + + dontConfigure = true; + dontBuild = true; + + installPhase = '' + runHook preInstall + + mv soularr{.py,} + installBin soularr + + runHook postInstall + ''; + + meta = { + description = "Python script that connects Lidarr with Soulseek"; + homepage = "https://soularr.net/"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ getchoo ]; + mainProgram = "soularr"; + }; +}