-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
137 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -143,3 +143,6 @@ dmypy.json | |
\.idea/ | ||
|
||
swaglyrics/unsupported.txt | ||
|
||
# Flake | ||
result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(import ( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in fetchTarball { | ||
url = "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; } | ||
) { | ||
src = ./.; | ||
}).defaultNix |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
description = "Swaglyrics for Spotify"; | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
utils.url = "github:numtide/flake-utils"; | ||
flake-compat = { | ||
url = "github:edolstra/flake-compat"; | ||
flake = false; | ||
}; | ||
}; | ||
|
||
outputs = { self, nixpkgs, utils, ... }: | ||
utils.lib.eachDefaultSystem (system: | ||
with import nixpkgs { inherit system; }; { | ||
defaultPackage = callPackage ./package.nix {}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ lib, python3, fetchFromGitHub, ncurses }: | ||
|
||
python3.pkgs.buildPythonApplication rec { | ||
pname = "swaglyrics"; | ||
version = "unstable-2021-06-17"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "SwagLyrics"; | ||
repo = "SwagLyrics-For-Spotify"; | ||
rev = "99fe764a9e45cac6cb9fcdf724c7d2f8cb4524fb"; | ||
sha256 = "sha256-O48T1WsUIVnNQb8gmzSkFFHTOiFOKVSAEYhF9zUqZz0="; | ||
}; | ||
|
||
propagatedBuildInputs = with python3.pkgs; [ | ||
unidecode colorama beautifulsoup4 flask requests swspotify | ||
]; | ||
|
||
preConfigure = '' | ||
substituteInPlace setup.py \ | ||
--replace 'beautifulsoup4==4.9.3' 'beautifulsoup4>=4.9.3' \ | ||
--replace 'unidecode==1.2.0' 'unidecode>=1.2.0' \ | ||
--replace 'flask==2.0.1' 'flask>=2.0.1' | ||
''; | ||
|
||
preBuild = "export HOME=$NIX_BUILD_TOP"; | ||
|
||
# disable tests which touch network | ||
disabledTests = [ | ||
"test_database_for_unsupported_song" | ||
"test_that_lyrics_works_for_unsupported_songs" | ||
"test_that_get_lyrics_works" | ||
"test_lyrics_are_shown_in_tab" | ||
"test_songchanged_can_raise_songplaying" | ||
]; | ||
|
||
checkInputs = with python3.pkgs; | ||
[ blinker swspotify pytestCheckHook flask mock flask_testing ] | ||
++ [ ncurses ]; | ||
|
||
meta = with lib; { | ||
description = "Lyrics fetcher for currently playing Spotify song"; | ||
homepage = "https://github.com/SwagLyrics/SwagLyrics-For-Spotify"; | ||
license = licenses.mit; | ||
maintainers = with maintainers; [ siraben ]; | ||
platforms = platforms.unix; | ||
}; | ||
} |