From 3db3dc176c069e3d0ce6059f5035b2250cb20f4d Mon Sep 17 00:00:00 2001 From: Mohammad Rafiq Date: Wed, 9 Jul 2025 01:44:06 +0800 Subject: [PATCH] feat(homes/rafiq): enable spotifyd and pass hostName to home --- nix/configurations.nix | 5 +++-- nix/homes/rafiq/desktop/default.nix | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/nix/configurations.nix b/nix/configurations.nix index ab03cf9..a8040c1 100644 --- a/nix/configurations.nix +++ b/nix/configurations.nix @@ -10,9 +10,10 @@ let inherit (lib.attrsets) mapAttrs; inherit (cfg.lib.modules) forAllUsers'; cfg = config.flake; - globalCfg = { + globalCfg = name: { useGlobalPkgs = true; useUserPackages = true; + extraSpecialArgs.hostName = name; sharedModules = [ cfg.modules.homeManager.default ]; users = forAllUsers' (name: _: cfg.modules.homeManager.${name}); }; @@ -27,7 +28,7 @@ let modules = [ cfg.modules.nixos.default inputs.home-manager.nixosModules.home-manager - { home-manager = globalCfg; } + { home-manager = globalCfg name; } (value.extraCfg or { }) ] ++ optional value.graphical cfg.modules.nixos.graphical; } diff --git a/nix/homes/rafiq/desktop/default.nix b/nix/homes/rafiq/desktop/default.nix index feda50d..e9a9747 100644 --- a/nix/homes/rafiq/desktop/default.nix +++ b/nix/homes/rafiq/desktop/default.nix @@ -12,9 +12,17 @@ enable = true; gamescopeSession.enable = true; }; + # spotifyd + networking.firewall.allowedTCPPorts = [ 5353 ]; + networking.firewall.allowedUDPPorts = [ 5353 ]; }; flake.modules.homeManager.rafiq = - { pkgs, config, ... }: + { + pkgs, + config, + hostName, + ... + }: let inherit (lib.modules) mkMerge mkIf; inherit (builtins) map listToAttrs; @@ -179,8 +187,16 @@ }; services = { + spotifyd.enable = true; + spotifyd.settings.global = { + device_name = "${hostName}"; + device_type = "computer"; + zeroconf_port = 5353; + }; + mako.enable = true; mako.settings.default-timeout = 10000; + }; wayland.windowManager.hyprland = { enable = true;