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