feat(spotifyd): Enable spotifyd module to play music in background

This commit is contained in:
ulic-youthlic 2025-07-13 06:04:55 +08:00
parent d9aecce780
commit 3fba87b4b1
Signed by: youthlic
GPG key ID: 63E86C3C14A0D721
8 changed files with 101 additions and 0 deletions

View file

@ -186,6 +186,26 @@
}, },
"version": "v3.9.0" "version": "v3.9.0"
}, },
"spotifyd": {
"cargoLocks": null,
"date": "2025-09-04",
"extract": null,
"name": "spotifyd",
"passthru": null,
"pinned": false,
"src": {
"deepClone": false,
"fetchSubmodules": false,
"leaveDotGit": false,
"name": null,
"rev": "f1acee9c6160db92dcd4214e96654cbbaed0e38a",
"sha256": "sha256-dcc+sklPJvV34U1A/eTD1kfIey4o5/kPq4yd72ey7LE=",
"sparseCheckout": [],
"type": "git",
"url": "https://github.com/ulic-youthlic/spotifyd.git"
},
"version": "f1acee9c6160db92dcd4214e96654cbbaed0e38a"
},
"spotx": { "spotx": {
"cargoLocks": null, "cargoLocks": null,
"date": "2025-07-26", "date": "2025-07-26",

View file

@ -117,6 +117,20 @@
sha256 = "sha256-matIAwJeC9F0WJJZ8Qq6hJjATrLqoHOpAGRyD0eqoa8="; sha256 = "sha256-matIAwJeC9F0WJJZ8Qq6hJjATrLqoHOpAGRyD0eqoa8=";
}; };
}; };
spotifyd = {
pname = "spotifyd";
version = "f1acee9c6160db92dcd4214e96654cbbaed0e38a";
src = fetchgit {
url = "https://github.com/ulic-youthlic/spotifyd.git";
rev = "f1acee9c6160db92dcd4214e96654cbbaed0e38a";
fetchSubmodules = false;
deepClone = false;
leaveDotGit = false;
sparseCheckout = [ ];
sha256 = "sha256-dcc+sklPJvV34U1A/eTD1kfIey4o5/kPq4yd72ey7LE=";
};
date = "2025-09-04";
};
spotx = { spotx = {
pname = "spotx"; pname = "spotx";
version = "8b9a9924cf2f7268337a9bad5e84b0083268f40d"; version = "8b9a9924cf2f7268337a9bad5e84b0083268f40d";

View file

@ -35,6 +35,7 @@
kvm.enable = true; kvm.enable = true;
atuin.enable = true; atuin.enable = true;
ion.enable = true; ion.enable = true;
spotifyd.enable = true;
awscli = { awscli = {
enable = true; enable = true;
url = "http://localhost:8491"; url = "http://localhost:8491";

View file

@ -0,0 +1,25 @@
{ config, lib, ... }:
let
cfg = config.youthlic.programs.spotifyd;
in
{
options = {
youthlic.programs.spotifyd = {
enable = lib.mkEnableOption "spotifyd";
};
};
config = lib.mkIf cfg.enable {
services.spotifyd = {
enable = true;
settings = {
global = {
device_type = "computer";
use_mpris = true;
backend = "pulseaudio";
bitrate = 320;
autoplay = false;
};
};
};
};
}

View file

@ -62,3 +62,8 @@ url.name = "yustar_$ver.zip"
[nvim_vim-startuptime] [nvim_vim-startuptime]
fetch.github = "dstein64/vim-startuptime" fetch.github = "dstein64/vim-startuptime"
src.git = "https://github.com/dstein64/vim-startuptime.git" src.git = "https://github.com/dstein64/vim-startuptime.git"
[spotifyd]
fetch.git = "https://github.com/ulic-youthlic/spotifyd.git"
src.git = "https://github.com/ulic-youthlic/spotifyd.git"
src.branch = "push-mrxqoqwxqsqt"

View file

@ -14,6 +14,7 @@ in
./helix.nix ./helix.nix
./cliphist.nix ./cliphist.nix
./zulip.nix ./zulip.nix
./spotifyd.nix
# Nur # Nur
./nur.nix ./nur.nix

View file

@ -0,0 +1,8 @@
{ outputs, ... }:
_final: prev:
let
inherit (prev.stdenv.hostPlatform) system;
in
{
spotifyd = outputs.packages."${system}".spotifyd;
}

27
pkgs/spotifyd.nix Normal file
View file

@ -0,0 +1,27 @@
{
srcs,
spotifyd,
rustPlatform,
...
}:
let
inherit (srcs.spotifyd) src date version;
in
spotifyd.overrideAttrs (
final: prev: {
inherit src;
version =
if prev.version != "0.4.1" then
throw ''
Please remove <pkgs/spotifyd.nix>
''
else
"0-unstable-${date}-git${version}";
cargoDeps = rustPlatform.fetchCargoVendor {
inherit (final)
src
;
hash = "sha256-WwShp1ebk89cBqRXqKDgbwGZraCDjQAOxoL4uEIq2aw=";
};
}
)