Compare commits

..

1 Commits

Author SHA1 Message Date
18f0a37407 wip 2024-10-05 19:00:35 -07:00
7 changed files with 34 additions and 38 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 rec { shared_config = recursiveUpdate {
modifier = "Mod4"; modifier = "Mod4";
terminal = "kitty"; terminal = "kitty";
defaultWorkspace = "workspace number 1"; defaultWorkspace = "workspace number 1";
keybindings = { keybindings = {
"${shared_config.modifier}+Return" = "exec ${terminal}"; "${shared_config.modifier}+Return" = "exec ${i3_cfg.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,10 +19,6 @@ 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,15 +13,16 @@ 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
]; ];
hardware.pulseaudio.enable = true; services.pipewire = {
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,7 +1,10 @@
{ lib, pkgs, ... }: { config, lib, pkgs, ... }:
with lib; with lib;
let
cfg = config.roles;
in
{ {
imports = [ imports = [
./audio ./audio
@@ -16,6 +19,10 @@ with lib;
./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 = {
@@ -58,6 +65,9 @@ with lib;
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 = mkIf cfg.enable config =
{ {
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,44 +4,33 @@ 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;
systemd.user.services.spotifyd = { services.spotifyd = {
enable = true; enable = true;
wantedBy = [ "default.target" ]; settings = {
after = [ "network-online.target" "sound.target" ]; global = {
description = "spotifyd, a Spotify playing daemon"; use_mpris = false;
serviceConfig = { backend = "alsa";
ExecStart = "${spotifyd}/bin/spotifyd --no-daemon --cache-path=\${HOME}/.cache/spotifyd --config-path=${spotifydConf}"; device = "sysdefault";
Restart = "always"; bitrate = 320;
RestartSec = 12; cache_path = "";
zeroconf_port = 1234;
autoplay = false;
};
}; };
}; };
users.users."kodi".linger = true;
networking.firewall.allowedTCPPorts = [ networking.firewall.allowedTCPPorts = [
5354 1234
57621 57621
]; ];
networking.firewall.allowedUDPPorts = [ networking.firewall.allowedUDPPorts = [