Compare commits

..

8 Commits

Author SHA1 Message Date
9b10f4abe0 (wip) spotifyd experimentation 2024-10-21 12:31:30 -07:00
a53519c339 [spotifyd] Update to lean in on pulseaudio 2024-10-05 20:37:44 -07:00
e88670ed60 [audio] Switch to pulseaudio
This is an attempt to get spotifyd running as a system user working
2024-10-05 20:37:10 -07:00
df77fd5c74 [i3+sway] Fix terminal reference 2024-10-05 19:49:17 -07:00
458bcb4cdf [roles] Remove unused trusted public key 2024-10-05 19:12:49 -07:00
40e10bab34 [roles] Remove unused config option 2024-10-05 19:12:38 -07:00
3477a3480f [boxy] Fix wayland and user setup 2024-10-05 19:10:15 -07:00
d2ae7f8e11 [roles] Also make desktop opt-in 2024-10-05 19:09:58 -07:00
7 changed files with 38 additions and 34 deletions

View File

@@ -6,13 +6,13 @@ let
cfg = config.home.i3_sway; cfg = config.home.i3_sway;
i3_cfg = config.xsession.windowManager.i3.config; i3_cfg = config.xsession.windowManager.i3.config;
shared_config = recursiveUpdate { shared_config = recursiveUpdate rec {
modifier = "Mod4"; modifier = "Mod4";
terminal = "kitty"; terminal = "kitty";
defaultWorkspace = "workspace number 1"; defaultWorkspace = "workspace number 1";
keybindings = { keybindings = {
"${shared_config.modifier}+Return" = "exec ${i3_cfg.terminal}"; "${shared_config.modifier}+Return" = "exec ${terminal}";
"${shared_config.modifier}+Shift+q" = "kill"; "${shared_config.modifier}+Shift+q" = "kill";
"${shared_config.modifier}+d" = "exec ${i3_cfg.menu}"; "${shared_config.modifier}+d" = "exec ${i3_cfg.menu}";

View File

@@ -19,6 +19,10 @@ with lib;
autologin = true; autologin = true;
wayland = true; wayland = true;
}; };
spotifyd = {
enable = true;
deviceType = "t_v";
};
users.enable = true; users.enable = true;
}; };

View File

@@ -13,16 +13,15 @@ in
config = mkIf cfg.enable config = mkIf cfg.enable
{ {
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
alsa-utils
paprefs paprefs
pavucontrol pavucontrol
pulsemixer pulsemixer
]; ];
services.pipewire = { hardware.pulseaudio.enable = true;
enable = true;
pulse.enable = true;
};
hardware.pulseaudio.package = pkgs.pulseaudioFull; hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.pulseaudio.support32Bit = true;
hardware.pulseaudio.extraConfig = " hardware.pulseaudio.extraConfig = "
load-module module-combine-sink load-module module-combine-sink
load-module module-switch-on-connect load-module module-switch-on-connect

View File

@@ -1,10 +1,7 @@
{ config, lib, pkgs, ... }: { lib, pkgs, ... }:
with lib; with lib;
let
cfg = config.roles;
in
{ {
imports = [ imports = [
./audio ./audio
@@ -19,10 +16,6 @@ in
./virtualisation ./virtualisation
]; ];
options.roles = {
enable = mkEnableOption "Enable roles";
};
config = { config = {
i18n.defaultLocale = "en_US.UTF-8"; i18n.defaultLocale = "en_US.UTF-8";
i18n.extraLocaleSettings = { i18n.extraLocaleSettings = {
@@ -65,9 +58,6 @@ in
substituters = [ substituters = [
"https://hyprland.cachix.org" "https://hyprland.cachix.org"
]; ];
trusted-public-keys = [
"hyprland.cachix.org-1:a7pgxzMz7+chwVL3/pzj6jIBMioiJM7ypFP8PwtkuGc="
];
}; };
}; };

View File

@@ -37,7 +37,7 @@ in
}; };
}; };
config = config = mkIf cfg.enable
{ {
services.xserver.xkb = { services.xserver.xkb = {
layout = "us"; layout = "us";

View File

@@ -35,7 +35,7 @@ in
}; };
services = if cfg.autologin then mkMerge [ services = if cfg.autologin then mkMerge [
mkIf cfg.wayland { (mkIf cfg.wayland {
cage = mkIf cfg.wayland { cage = mkIf cfg.wayland {
user = "kodi"; user = "kodi";
program = "${kodiPkg}/bin/kodi-standalone"; program = "${kodiPkg}/bin/kodi-standalone";
@@ -45,9 +45,9 @@ in
enable = false; enable = false;
autorun = false; autorun = false;
}; };
} })
mkIf (!cfg.wayland) { (mkIf (!cfg.wayland) {
xserver = { xserver = {
enable = true; enable = true;
desktopManager.kodi = { desktopManager.kodi = {
@@ -65,7 +65,7 @@ in
defaultSession = "kodi"; defaultSession = "kodi";
sessionData.autologinSession = "kodi"; sessionData.autologinSession = "kodi";
}; };
} })
] else {}; ] else {};
}; };
} }

View File

@@ -4,33 +4,44 @@ with lib;
let let
cfg = config.roles.spotifyd; cfg = config.roles.spotifyd;
spotifyd = pkgs.spotifyd.override { withMpris = true; withPulseAudio = true; };
spotifydConf = pkgs.writeText "spotifyd-config" ''
[global]
backend = "pulseaudio"
bitrate = 320
use_mpris = false
zeroconf_port = 5354
autoplay = false
device_type = "${cfg.deviceType}"
'';
in in
{ {
options.roles.spotifyd = { options.roles.spotifyd = {
enable = mkEnableOption "Enable the spotifyd role"; enable = mkEnableOption "Enable the spotifyd role";
deviceType = mkOption {
default = "computer";
};
}; };
config = mkIf cfg.enable config = mkIf cfg.enable
{ {
roles.audio.enable = true; roles.audio.enable = true;
services.spotifyd = { systemd.user.services.spotifyd = {
enable = true; enable = true;
settings = { wantedBy = [ "default.target" ];
global = { after = [ "network-online.target" "sound.target" ];
use_mpris = false; description = "spotifyd, a Spotify playing daemon";
backend = "alsa"; serviceConfig = {
device = "sysdefault"; ExecStart = "${spotifyd}/bin/spotifyd --no-daemon --cache-path=\${HOME}/.cache/spotifyd --config-path=${spotifydConf}";
bitrate = 320; Restart = "always";
cache_path = ""; RestartSec = 12;
zeroconf_port = 1234;
autoplay = false;
};
}; };
}; };
users.users."kodi".linger = true;
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
1234 5354
57621 57621
]; ];
networking.firewall.allowedUDPPorts = [ networking.firewall.allowedUDPPorts = [