blob: 66461a01b353c0c32d11af441d9a85267f947a7e [file] [log] [blame]
Skyler Greyb78a7e42022-09-01 23:55:59 +01001{
2 pkgs,
3 config,
4 home,
5 username,
6 ...
7}: {
Skyler Grey7c0ee4c2022-09-09 08:16:32 +01008 home = {
9 services.spotifyd = {
10 enable = true;
11 settings = {
12 global = {
13 username_cmd = "${pkgs.coreutils}/bin/cat ${config.sops.secrets.spotifyUsername.path}";
14 password_cmd = "${pkgs.coreutils}/bin/cat ${config.sops.secrets.spotifyPassword.path}";
15 use_mpris = true;
16 device_name = "background@${config.networking.hostName}";
17 cache_path = "${home.home.homeDirectory}/.cache/spotifyd";
18 max_cache_size = 1000000000;
19 volume_normalisation = true;
20 normalisation_pregain = -10;
21 autoplay = true;
22 zeroconf_port = 1234;
23 device_type = "computer";
24 };
Skyler Greyb78a7e42022-09-01 23:55:59 +010025 };
26 };
Skyler Grey7c0ee4c2022-09-09 08:16:32 +010027 home.packages = [pkgs.spotify-tui];
Skyler Greyb78a7e42022-09-01 23:55:59 +010028 };
29 config = {
30 sops.secrets.spotifyUsername = {
31 mode = "0400";
32 owner = config.users.users.${username}.name;
33 group = config.users.users.nobody.group;
34 };
35 sops.secrets.spotifyPassword = {
36 mode = "0400";
37 owner = config.users.users.${username}.name;
38 group = config.users.users.nobody.group;
39 };
Skyler Grey7b13dd22022-09-10 00:40:06 +010040 sops.secrets.sptConfig = {
41 mode = "0700";
42 owner = config.users.users.${username}.name;
43 group = config.users.users.nobody.group;
44 path = "${home.home.homeDirectory}/.config/spotify-tui/client.yml";
45 sopsFile = ../secrets/spotify-tui.yml.bin;
46 format = "binary";
47 };
48 environment.persistence."/nix/persist".users.${username}.directories = [
49 ".cache/spotifyd"
50 ".config/spotify-tui"
51 ];
Skyler Greyb78a7e42022-09-01 23:55:59 +010052 };
53}