diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index fe415cb671c9..b0d7adf35896 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -7657,6 +7657,12 @@ github = "eclairevoyant"; name = "éclairevoyant"; }; + eConnah = { + email = "git@econnah.uk"; + github = "eConnah"; + githubId = 63052937; + name = "Connor Alecks"; + }; edanaher = { email = "nixos@edanaher.net"; github = "edanaher"; diff --git a/pkgs/by-name/la/lazyspotify/go-librespot.nix b/pkgs/by-name/la/lazyspotify/go-librespot.nix new file mode 100644 index 000000000000..d4cca117ceff --- /dev/null +++ b/pkgs/by-name/la/lazyspotify/go-librespot.nix @@ -0,0 +1,59 @@ +{ + alsa-lib, + buildGoModule, + fetchFromGitHub, + flac, + lib, + libogg, + libvorbis, + pkg-config, + stdenv, +}: + +buildGoModule (finalAttrs: { + pname = "lazyspotify-librespot"; + version = "0.7.1.1"; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "dubeyKartikay"; + repo = "go-librespot"; + tag = "v${finalAttrs.version}"; + hash = "sha256-Hq9Qk8f8oKzpBwsbLNAvPO7qam3bh4L4RPUQC67/NZY="; + }; + + vendorHash = "sha256-5J5i2Wc0zHCdvJ3aUkftXeMKS5X8jWimup0Ir4HLuS8="; + + subPackages = [ "cmd/daemon" ]; + + nativeBuildInputs = [ pkg-config ]; + + buildInputs = [ + flac + libogg + libvorbis + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + alsa-lib + ]; + + ldflags = [ + "-s" + "-w" + "-X github.com/devgianlu/go-librespot.version=v${finalAttrs.version}" + ]; + + # rename the generic daemon binary for identification + postInstall = '' + install -Dm755 $out/bin/daemon $out/bin/lazyspotify-librespot + rm $out/bin/daemon + ''; + + meta = { + description = "Librespot daemon tailored for lazyspotify"; + mainProgram = "lazyspotify-librespot"; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ eConnah ]; + }; +}) diff --git a/pkgs/by-name/la/lazyspotify/package.nix b/pkgs/by-name/la/lazyspotify/package.nix new file mode 100644 index 000000000000..99c7d0c7d45f --- /dev/null +++ b/pkgs/by-name/la/lazyspotify/package.nix @@ -0,0 +1,47 @@ +{ + buildGoModule, + callPackage, + fetchFromGitHub, + lib, + versionCheckHook, + go-librespot ? callPackage ./go-librespot.nix { }, +}: +buildGoModule (finalAttrs: { + pname = "lazyspotify"; + version = "0.5.1"; + + __structuredAttrs = true; + + src = fetchFromGitHub { + owner = "dubeyKartikay"; + repo = "lazyspotify"; + tag = "v${finalAttrs.version}"; + hash = "sha256-ZL/UPqQ6ClK0JN9LbPtr8nqcdBLdoOYti94BPRXn/Pk="; + }; + + vendorHash = "sha256-Axdt3/3ZOZY9Z5VUI6Wh77oIREOO26ODMyEgtscTmn8="; + + subPackages = [ "cmd/lazyspotify" ]; + + ldflags = [ + "-s" + "-w" + "-X github.com/dubeyKartikay/lazyspotify/buildinfo.Version=${finalAttrs.version}" + "-X github.com/dubeyKartikay/lazyspotify/buildinfo.PackagedDaemonPath=${lib.getExe go-librespot}" + ]; + + nativeInstallCheckInputs = [ versionCheckHook ]; + doInstallCheck = true; + + meta = { + description = "Terminal Spotify client for macOS and Linux"; + homepage = "https://dubeykartikay.github.io/lazyspotify/"; + changelog = "https://github.com/dubeyKartikay/lazyspotify/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.mit; + mainProgram = "lazyspotify"; + platforms = lib.platforms.linux ++ lib.platforms.darwin; + maintainers = with lib.maintainers; [ + eConnah + ]; + }; +})