feat: add spotify with spotx patch applied

This commit is contained in:
Dmitriy Kholkin 2025-06-07 21:34:48 +03:00
parent d698c9b7d7
commit d4c1fd085b
Signed by: AtaraxiaDev
GPG Key ID: FD266B810DF48DF2
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,34 @@
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) getExe mkEnableOption mkIf;
cfg = config.ataraxia.programs.spotify;
in
{
options.ataraxia.programs.spotify = {
enable = mkEnableOption "Enable spotify program";
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
spotifywm
];
defaultApplications.spotify = {
cmd = getExe pkgs.spotifywm;
desktop = "spotify";
};
startupApplications = [
config.defaultApplications.spotify.cmd
];
persist.state.directories = [
".config/spotify"
];
};
}

View File

@ -83,6 +83,7 @@ in
ataraxia.programs.kitty.enable = mkDefault true; ataraxia.programs.kitty.enable = mkDefault true;
ataraxia.programs.mpv.enable = mkDefault true; ataraxia.programs.mpv.enable = mkDefault true;
ataraxia.programs.rofi.enable = mkDefault true; ataraxia.programs.rofi.enable = mkDefault true;
ataraxia.programs.spotify.enable = mkDefault true;
ataraxia.programs.telegram.enable = mkDefault true; ataraxia.programs.telegram.enable = mkDefault true;
ataraxia.programs.thunderbird.enable = mkDefault true; ataraxia.programs.thunderbird.enable = mkDefault true;
ataraxia.programs.vscode.enable = mkDefault true; ataraxia.programs.vscode.enable = mkDefault true;

View File

@ -34,6 +34,37 @@ in
sing-box = unstable.sing-box; sing-box = unstable.sing-box;
wine = prev.wineWow64Packages.stagingFull; wine = prev.wineWow64Packages.stagingFull;
# Patch spotify with spotx
spotify = prev.spotify.overrideAttrs (
oa:
let
spotx = prev.fetchurl {
url = "https://raw.githubusercontent.com/SpotX-Official/SpotX-Bash/b1de24ec4c23c45da373dcb64a44e372253a0c16/spotx.sh";
hash = "sha256-/p6cJKzaZzjcLJISFudstQjs+lPXnXx4f0vxKbF9Sqw=";
};
in
{
nativeBuildInputs =
oa.nativeBuildInputs
++ (with prev; [
perl
unzip
util-linux
zip
]);
postUnpack =
oa.postUnpack or ""
+ ''
patchShebangs --build ${spotx}
'';
postInstall =
oa.postInstall or ""
+ ''
bash ${spotx} -f -h -P "$out/share/spotify"
'';
}
);
# Move modprobed config to subdir. Easier to use with impermanence # Move modprobed config to subdir. Easier to use with impermanence
modprobed-db = prev.modprobed-db.overrideAttrs (oa: { modprobed-db = prev.modprobed-db.overrideAttrs (oa: {
nativeBuildInputs = [ prev.makeWrapper ] ++ oa.nativeBuildInputs or [ ]; nativeBuildInputs = [ prev.makeWrapper ] ++ oa.nativeBuildInputs or [ ];