From 195802600a0c8e8b8f8876500425b6be33678f1a Mon Sep 17 00:00:00 2001 From: Adithya Nair Date: Tue, 4 Apr 2023 10:06:31 +0530 Subject: [PATCH] split media into programs and services --- home/default.nix | 2 -- home/programs/default.nix | 1 + home/{ => programs}/media.nix | 23 ----------------------- home/services/default.nix | 3 +++ home/services/media.nix | 25 +++++++++++++++++++++++++ 5 files changed, 29 insertions(+), 25 deletions(-) rename home/{ => programs}/media.nix (54%) create mode 100644 home/services/media.nix diff --git a/home/default.nix b/home/default.nix index bcdf18f..fe1882c 100644 --- a/home/default.nix +++ b/home/default.nix @@ -19,9 +19,7 @@ in nixvim.homeManagerModules.nixvim hyprland.homeManagerModules.default - ./downloader.nix ./gtk.nix - ./media.nix ./misc.nix ./persistence.nix ./scripts.nix diff --git a/home/programs/default.nix b/home/programs/default.nix index 877b607..9fb0f67 100644 --- a/home/programs/default.nix +++ b/home/programs/default.nix @@ -4,6 +4,7 @@ ./downloader.nix ./firefox.nix ./kitty.nix + ./media.nix ./nixvim.nix ./tmux.nix ./tui.nix diff --git a/home/media.nix b/home/programs/media.nix similarity index 54% rename from home/media.nix rename to home/programs/media.nix index 767e538..407c004 100644 --- a/home/media.nix +++ b/home/programs/media.nix @@ -22,27 +22,4 @@ defaultProfiles = [ "gpu-hq" ]; scripts = with pkgs.mpvScripts; [ mpris ]; }; - services = { - spotifyd = { - enable = true; - package = pkgs.spotifyd.override { - withKeyring = true; - withMpris = true; - }; - settings = { - global = { - use_keyring = true; - use_mpris = true; - username_cmd = '' - ${pkgs.libsecret}/bin/secret-tool search --all service spotifyd 2>&1 | grep 'username' | awk -F'= ' '{print $2}' - ''; - device_name = "Skipperd"; - device_type = "computer"; - backend = "pulseaudio"; - no_audio_cache = true; - dbus_type = "session"; - }; - }; - }; - }; } diff --git a/home/services/default.nix b/home/services/default.nix index dff8836..d7a8d9e 100644 --- a/home/services/default.nix +++ b/home/services/default.nix @@ -1,4 +1,7 @@ { ... }: { + imports = [ + ./media.nix + ]; services.blueman-applet.enable = true; services.gnome-keyring.enable = true; services.gpg-agent = { diff --git a/home/services/media.nix b/home/services/media.nix new file mode 100644 index 0000000..7f50139 --- /dev/null +++ b/home/services/media.nix @@ -0,0 +1,25 @@ +{ pkgs, ... }: { + services = { + spotifyd = { + enable = true; + package = pkgs.spotifyd.override { + withKeyring = true; + withMpris = true; + }; + settings = { + global = { + use_keyring = true; + use_mpris = true; + username_cmd = '' + ${pkgs.libsecret}/bin/secret-tool search --all service spotifyd 2>&1 | grep 'username' | awk -F'= ' '{print $2}' + ''; + device_name = "Skipperd"; + device_type = "computer"; + backend = "pulseaudio"; + no_audio_cache = true; + dbus_type = "session"; + }; + }; + }; + }; +}