diff options
| author | Mike Vink <mike1994vink@gmail.com> | 2023-10-17 22:46:17 +0200 |
|---|---|---|
| committer | Mike Vink <mike1994vink@gmail.com> | 2023-10-17 22:46:17 +0200 |
| commit | d163ff42b08a5cdf898f1085f8a1e35a4b6b48f1 (patch) | |
| tree | 54709119070ff80ea018add9bd92d4cc19965fbe | |
| parent | 4c15a33354fd5f51269f3abd9f9e7331b153f7ef (diff) | |
add spotify
| -rw-r--r-- | flake.nix | 4 | ||||
| -rw-r--r-- | machines/lemptop.nix | 5 | ||||
| -rw-r--r-- | profiles/core/secrets.nix | 2 | ||||
| -rw-r--r-- | profiles/station/music.nix | 81 | ||||
| -rw-r--r-- | secrets/mopidy.yaml | 21 |
5 files changed, 107 insertions, 6 deletions
@@ -18,7 +18,8 @@ sops-nix, deploy-rs, ... - }: let + }: + let system = "x86_64-linux"; pkgs = import nixpkgs {inherit system;}; lib = (nixpkgs.lib.extend (_: _: home-manager.lib)).extend (import ./lib self); @@ -42,6 +43,7 @@ ])];}) ]; }; + in with lib; { inherit lib; nixosConfigurations = with lib; diff --git a/machines/lemptop.nix b/machines/lemptop.nix index 24cf703..1d56804 100644 --- a/machines/lemptop.nix +++ b/machines/lemptop.nix @@ -35,13 +35,16 @@ ''; virtualisation.docker.enable = true; - sound.enable = true; + + sound.enable = false; + hardware.pulseaudio.enable = false; security.rtkit.enable = true; services.pipewire = { enable = true; alsa.enable = true; alsa.support32Bit = true; pulse.enable = true; + wireplumber.enable = true; }; hardware.bluetooth.enable = true; services.blueman.enable = true; diff --git a/profiles/core/secrets.nix b/profiles/core/secrets.nix index 6b52376..fc11563 100644 --- a/profiles/core/secrets.nix +++ b/profiles/core/secrets.nix @@ -1,7 +1,7 @@ {machine,inputs,config,lib,pkgs,...}: with lib; { imports = [ inputs.sops-nix.nixosModules.sops - (mkAliasOptionModule [ "secrets" ] [ "home-manager" "users" ivi.username ]) # TODO: get my username(s) from machine config + (mkAliasOptionModule [ "secrets" ] [ "sops" "secrets" ]) # TODO: get my username(s) from machine config ]; sops = { age.sshKeyPaths = []; diff --git a/profiles/station/music.nix b/profiles/station/music.nix index 085534e..36ff02e 100644 --- a/profiles/station/music.nix +++ b/profiles/station/music.nix @@ -1,14 +1,89 @@ -{ pkgs, ... }: { - services.mopidy = { +{ config, pkgs, lib, ... }: { + secrets.mopidy.owner = lib.ivi.username; + hm.services.mopidy = { enable = true; - extensionPackages = with pkgs; [mopidy-spotify]; + extensionPackages = with pkgs; [mopidy-spotify mopidy-mpd]; + settings = { + mpd = { + enabled = true; + hostname = "127.0.0.1"; + port = 6600; + max_connections = 20; + connection_timeout = 60; + };}; extraConfigFiles = [ + config.secrets.mopidy.path ]; }; hm.programs.ncmpcpp = { enable = true; bindings = [ { key = "+"; command = "show_clock"; } + { key = "+"; command = "show_clock"; } + { key = "="; command = "volume_up"; } + { key = "j"; command = "scroll_down"; } + { key = "k"; command = "scroll_up"; } + { key = "ctrl-u"; command = "page_up"; } + { key = "ctrl-d"; command = "page_down"; } + { key = "u"; command = "page_up"; } + { key = "d"; command = "page_down"; } + { key = "h"; command = "previous_column"; } + { key = "l"; command = "next_column"; } + { key = "."; command = "show_lyrics"; } + { key = "n"; command = "next_found_item"; } + { key = "N"; command = "previous_found_item"; } + { key = "J"; command = "move_sort_order_down"; } + { key = "K"; command = "move_sort_order_up"; } + { key = "h"; command = "jump_to_parent_directory"; } + { key = "l"; command = "enter_directory"; } + { key = "l"; command = "run_action"; } + { key = "l"; command = "play_item"; } + { key = "m"; command = "show_media_library"; } + { key = "m"; command = "toggle_media_library_columns_mode"; } + { key = "t"; command = "show_tag_editor"; } + { key = "v"; command = "show_visualizer"; } + { key = "G"; command = "move_end"; } + { key = "g"; command = "move_home"; } + { key = "U"; command = "update_database"; } + { key = "s"; command = "reset_search_engine"; } + { key = "s"; command = "show_search_engine"; } + { key = "f"; command = "show_browser"; } + { key = "f"; command = "change_browse_mode"; } + { key = "x"; command = "delete_playlist_items"; } + { key = "P"; command = "show_playlist"; } ]; + settings = { + ncmpcpp_directory = "~/.config/ncmpcpp"; + lyrics_directory = "~/.local/share/lyrics"; + message_delay_time = "1"; + # visualizer_type = "spectrum"; + song_list_format = "{$4%a - }{%t}|{$8%f$9}$R{$3(%l)$9}"; + song_status_format = ''$b{{$8"%t"}} $3by {$4%a{ $3in $7%b{ (%y)}} $3}|{$8%f}''; + song_library_format = "{%n - }{%t}|{%f}"; + alternative_header_first_line_format = "$b$1$aqqu$/a$9 {%t}|{%f} $1$atqq$/a$9$/b"; + alternative_header_second_line_format = "{{$4$b%a$/b$9}{ - $7%b$9}{ ($4%y$9)}}|{%D}"; + current_item_prefix = "$(cyan)$r$b"; + current_item_suffix = "$/r$(end)$/b"; + current_item_inactive_column_prefix = "$(magenta)$r"; + current_item_inactive_column_suffix = "$/r$(end)"; + playlist_display_mode = "columns"; + browser_display_mode = "columns"; + progressbar_look = "->"; + media_library_primary_tag = "album_artist"; + media_library_albums_split_by_date = "no"; + startup_screen = "media_library"; + display_volume_level = "no"; + ignore_leading_the = "yes"; + external_editor = "nvim"; + use_console_editor = "yes"; + empty_tag_color = "magenta"; + main_window_color = "white"; + progressbar_color = "black:b"; + progressbar_elapsed_color = "blue:b"; + statusbar_color = "red"; + statusbar_time_color = "cyan:b"; + execute_on_song_change="pkill -RTMIN+11 dwmblocks"; + execute_on_player_state_change="pkill -RTMIN+11 dwmblocks"; + }; }; } diff --git a/secrets/mopidy.yaml b/secrets/mopidy.yaml new file mode 100644 index 0000000..2f38ee3 --- /dev/null +++ b/secrets/mopidy.yaml @@ -0,0 +1,21 @@ +lemptop: ENC[AES256_GCM,data:oQL/CmXYLQTsMglwf28TyCHqpVOXgmu2tGt8gKBNUMDhR4z8jd1tNq2I86KmwTfSobowkntTyHtLjYrRKM1jEM/1xL9AilXYEDWpunU/ODpWWkIr6iEtCu0/uXLC/1TX8CqdUargYFFoN6KMBZNGH55x95DiiLL47Vp8uEgWuTly8xQE3u9vzH143R5wcfAnGfzsBsea1TJYSZMT9Ey2EeXgnaSIAD2sZx8VCWoqbbagERWy,iv:UHPA7mhHRIhBXgdvcJEzL/BCWerJB5gxWZlWhIhMuro=,tag:+HiHYOL+VWk5443Qc5f6sQ==,type:str] +sops: + kms: [] + gcp_kms: [] + azure_kv: [] + hc_vault: [] + age: + - recipient: age10q9wse8dh0749ffj576q775q496pycucxlla9rjdq5rd7f4csyhqqrmkk0 + enc: | + -----BEGIN AGE ENCRYPTED FILE----- + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA5N2t5RTF1Wm56U2xvNkoy + YXo0SmdtUWhndEE3WDFrWFBTVll2cVFKZFdFCk91QUZvOUI2L0tlTjF2cXorK0k1 + RGtObVMrV2tsZHVTMG4vdnRsQ0dxMlkKLS0tIHcxcXBLdW5UWmNVV2VFTVJGQzJO + SjN6SklFSmViTVRoTEZYK1Q1aS9jbFUKdvLte8aMlVpjgAwvGS4HRIV8l8qO80tl + LWGng7B0gCfd21VVdokb1ZFmls8ElEQQAqK7Obf76IF7eNs1+0xdNA== + -----END AGE ENCRYPTED FILE----- + lastmodified: "2023-10-17T19:27:11Z" + mac: ENC[AES256_GCM,data:fFWP4z/Q0pY56xFYMeKQlWdIpS0nlWqO+u233BXLrXL57l5Z1zO+3vKNre0CeDmNMMIdnE0LcY87+dpXFKvVC/EaKhsy75MixOqnmRtB6JHeBXYOeEBOn8e5Ur3pfTfxvcjQF6HFOD6n4VU1d4zG1r8zWkkCaah+fuQAg5j7r/0=,iv:NgQmn0DJ5liAIiA4ZL6BLWwL37RhJnrQPLiPByq13xk=,tag:P9zlmdq9nXD/kIVeDnZGpw==,type:str] + pgp: [] + unencrypted_suffix: _unencrypted + version: 3.8.0 |
