feat(homes/rafiq): enable spotifyd and pass hostName to home

This commit is contained in:
Mohammad Rafiq 2025-07-09 01:44:06 +08:00
parent 4507f4b113
commit 3db3dc176c
No known key found for this signature in database
2 changed files with 20 additions and 3 deletions

View file

@ -10,9 +10,10 @@ let
inherit (lib.attrsets) mapAttrs; inherit (lib.attrsets) mapAttrs;
inherit (cfg.lib.modules) forAllUsers'; inherit (cfg.lib.modules) forAllUsers';
cfg = config.flake; cfg = config.flake;
globalCfg = { globalCfg = name: {
useGlobalPkgs = true; useGlobalPkgs = true;
useUserPackages = true; useUserPackages = true;
extraSpecialArgs.hostName = name;
sharedModules = [ cfg.modules.homeManager.default ]; sharedModules = [ cfg.modules.homeManager.default ];
users = forAllUsers' (name: _: cfg.modules.homeManager.${name}); users = forAllUsers' (name: _: cfg.modules.homeManager.${name});
}; };
@ -27,7 +28,7 @@ let
modules = [ modules = [
cfg.modules.nixos.default cfg.modules.nixos.default
inputs.home-manager.nixosModules.home-manager inputs.home-manager.nixosModules.home-manager
{ home-manager = globalCfg; } { home-manager = globalCfg name; }
(value.extraCfg or { }) (value.extraCfg or { })
] ++ optional value.graphical cfg.modules.nixos.graphical; ] ++ optional value.graphical cfg.modules.nixos.graphical;
} }

View file

@ -12,9 +12,17 @@
enable = true; enable = true;
gamescopeSession.enable = true; gamescopeSession.enable = true;
}; };
# spotifyd
networking.firewall.allowedTCPPorts = [ 5353 ];
networking.firewall.allowedUDPPorts = [ 5353 ];
}; };
flake.modules.homeManager.rafiq = flake.modules.homeManager.rafiq =
{ pkgs, config, ... }: {
pkgs,
config,
hostName,
...
}:
let let
inherit (lib.modules) mkMerge mkIf; inherit (lib.modules) mkMerge mkIf;
inherit (builtins) map listToAttrs; inherit (builtins) map listToAttrs;
@ -179,8 +187,16 @@
}; };
services = { services = {
spotifyd.enable = true;
spotifyd.settings.global = {
device_name = "${hostName}";
device_type = "computer";
zeroconf_port = 5353;
};
mako.enable = true; mako.enable = true;
mako.settings.default-timeout = 10000; mako.settings.default-timeout = 10000;
}; };
wayland.windowManager.hyprland = { wayland.windowManager.hyprland = {
enable = true; enable = true;