Usermode spotifyd + spotify-tui
This commit is contained in:
parent
1fb16f8cd2
commit
504e4efad6
@ -12,6 +12,7 @@ in {
|
||||
./audio.nix
|
||||
# ./torbrowser.nix
|
||||
./pithos.nix
|
||||
./spotify.nix
|
||||
./vscodium.nix
|
||||
./discord.nix
|
||||
./steam.nix
|
||||
@ -29,8 +30,19 @@ in {
|
||||
|
||||
# Applications
|
||||
users.users.googlebot.packages = with pkgs; [
|
||||
chromium keepassxc mumble tigervnc bluez-tools vscodium element-desktop mpv
|
||||
nextcloud-client signal-desktop minecraft sauerbraten gnome.file-roller spotify
|
||||
chromium
|
||||
keepassxc
|
||||
mumble
|
||||
tigervnc
|
||||
bluez-tools
|
||||
vscodium
|
||||
element-desktop
|
||||
mpv
|
||||
nextcloud-client
|
||||
signal-desktop
|
||||
minecraft
|
||||
sauerbraten
|
||||
gnome.file-roller
|
||||
gparted
|
||||
];
|
||||
|
||||
|
84
common/pc/spotify.nix
Normal file
84
common/pc/spotify.nix
Normal file
@ -0,0 +1,84 @@
|
||||
{ lib, config, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let
|
||||
cfg = config.services.spotifyd;
|
||||
toml = pkgs.formats.toml {};
|
||||
spotifydConf = toml.generate "spotify.conf" cfg.settings;
|
||||
in
|
||||
{
|
||||
disabledModules = [
|
||||
"services/audio/spotifyd.nix"
|
||||
];
|
||||
|
||||
options = {
|
||||
services.spotifyd = {
|
||||
enable = mkEnableOption "spotifyd, a Spotify playing daemon";
|
||||
|
||||
settings = mkOption {
|
||||
default = {};
|
||||
type = toml.type;
|
||||
example = { global.bitrate = 320; };
|
||||
description = ''
|
||||
Configuration for Spotifyd. For syntax and directives, see
|
||||
<link xlink:href="https://github.com/Spotifyd/spotifyd#Configuration"/>.
|
||||
'';
|
||||
};
|
||||
|
||||
users = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [];
|
||||
description = ''
|
||||
Usernames to be added to the "spotifyd" group, so that they
|
||||
can start and interact with the userspace daemon.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
# username specific stuff because i'm lazy...
|
||||
services.spotifyd.users = [ "googlebot" ];
|
||||
users.users.googlebot.packages = with pkgs; [
|
||||
spotify
|
||||
spotify-tui
|
||||
];
|
||||
|
||||
users.groups.spotifyd = {
|
||||
members = cfg.users;
|
||||
};
|
||||
|
||||
age.secrets.spotifyd = {
|
||||
file = ../../secrets/spotifyd.age;
|
||||
group = "spotifyd";
|
||||
};
|
||||
|
||||
# spotifyd to read secrets and run as user service
|
||||
services.spotifyd = {
|
||||
settings.global = {
|
||||
username_cmd = "sed '1q;d' /run/agenix/spotifyd";
|
||||
password_cmd = "sed '2q;d' /run/agenix/spotifyd";
|
||||
bitrate = 320;
|
||||
backend = "pulseaudio";
|
||||
device_name = config.networking.hostName;
|
||||
device_type = "computer";
|
||||
# on_song_change_hook = "command_to_run_on_playback_events"
|
||||
autoplay = true;
|
||||
};
|
||||
};
|
||||
|
||||
systemd.user.services.spotifyd-daemon = {
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
after = [ "network-online.target" "sound.target" ];
|
||||
description = "spotifyd, a Spotify playing daemon";
|
||||
environment.SHELL = "/bin/sh";
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.spotifyd}/bin/spotifyd --no-daemon --config-path ${spotifydConf}";
|
||||
Restart = "always";
|
||||
CacheDirectory = "spotifyd";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
@ -54,6 +54,8 @@ in
|
||||
publicCreateSnapshots = true;
|
||||
};
|
||||
|
||||
services.spotifyd.enable = true;
|
||||
|
||||
services.zerotierone.enable = true;
|
||||
|
||||
de.enable = true;
|
||||
|
@ -14,4 +14,5 @@ in
|
||||
"email-pw.age".publicKeys = all;
|
||||
"nextcloud-pw.age".publicKeys = all;
|
||||
"iodine.age".publicKeys = all;
|
||||
"spotifyd.age".publicKeys = all;
|
||||
}
|
BIN
secrets/spotifyd.age
Normal file
BIN
secrets/spotifyd.age
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user