Skyler Grey | b78a7e4 | 2022-09-01 23:55:59 +0100 | [diff] [blame] | 1 | { |
| 2 | pkgs, |
| 3 | config, |
| 4 | home, |
| 5 | username, |
| 6 | ... |
| 7 | }: { |
Skyler Grey | 7c0ee4c | 2022-09-09 08:16:32 +0100 | [diff] [blame] | 8 | 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 Grey | b78a7e4 | 2022-09-01 23:55:59 +0100 | [diff] [blame] | 25 | }; |
| 26 | }; |
Skyler Grey | 7c0ee4c | 2022-09-09 08:16:32 +0100 | [diff] [blame] | 27 | home.packages = [pkgs.spotify-tui]; |
Skyler Grey | b78a7e4 | 2022-09-01 23:55:59 +0100 | [diff] [blame] | 28 | }; |
| 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 Grey | 7b13dd2 | 2022-09-10 00:40:06 +0100 | [diff] [blame] | 40 | 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 Grey | b78a7e4 | 2022-09-01 23:55:59 +0100 | [diff] [blame] | 52 | }; |
| 53 | } |