Compare commits

..

3 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
11 changed files with 31 additions and 249 deletions

24
flake.lock generated
View File

@@ -52,34 +52,10 @@
"type": "github"
}
},
"plasma-manager": {
"inputs": {
"home-manager": [
"home-manager"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1728750492,
"narHash": "sha256-9IHlIsH4gLqQjS2lFbEnsl/ItdqzBBLWLsyXS0k0jf8=",
"owner": "nix-community",
"repo": "plasma-manager",
"rev": "c6d4b6f3e0138c08f37d66fcfbcbe37dab08f108",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "plasma-manager",
"type": "github"
}
},
"root": {
"inputs": {
"home-manager": "home-manager",
"nixpkgs": "nixpkgs",
"plasma-manager": "plasma-manager",
"sops-nix": "sops-nix"
}
},

View File

@@ -13,12 +13,6 @@
url = "github:nix-community/home-manager";
inputs.nixpkgs.follows = "nixpkgs";
};
plasma-manager = {
url = "github:nix-community/plasma-manager";
inputs.nixpkgs.follows = "nixpkgs";
inputs.home-manager.follows = "home-manager";
};
};
outputs = { self, nixpkgs, ... } @ inputs: let
@@ -29,7 +23,6 @@
{
home-manager.useGlobalPkgs = true;
home-manager.useUserPackages = true;
home-manager.sharedModules = [ inputs.plasma-manager.homeManagerModules.plasma-manager ];
}
];
in {

View File

@@ -104,9 +104,8 @@
imports = [
./modules/emacs
./modules/i3+sway
./modules/lutris
./modules/plasma-manager
./modules/i3+sway
];
programs.bash.enable = true;

View File

@@ -129,13 +129,6 @@ in {
"type:keyboard" = {
xkb_options = "caps:escape";
};
"type:touchpad" = {
tap = "enabled";
tap_button_map = "lrm";
drag = "enabled";
natural_scroll = "disabled";
dwt = "enabled";
};
};
};
in {

View File

@@ -1,150 +0,0 @@
{ config, lib, pkgs, ... }:
# The following can be generated with the command:
# nix run github:nix-community/plasma-manager
#
# Plasma-manager options documentation
# https://nix-community.github.io/plasma-manager/options.xhtml
#
# Polonium usage
# https://github.com/zeroxoneafour/polonium/blob/master/docs/usage.md
#
# TODO: Extract this configuration into something that's a bit easier to manage
# TODO: Update shortcuts for better window/tiling/desktop management akin to i3wm
# TODO(ambitious): Add Kmail support to plasma-manager
{
programs.plasma = {
enable = true;
overrideConfig = true;
kwin = {
scripts.polonium.enable = true;
};
hotkeys.commands."launch-konsole" = {
name = "Launch Konsole";
key = "Meta+Enter";
command = "konsole";
};
shortcuts = {
kmix = {
"decrease_microphone_volume" = "Microphone Volume Down";
"decrease_volume" = "Volume Down";
"decrease_volume_small" = "Shift+Volume Down";
"increase_microphone_volume" = "Microphone Volume Up";
"increase_volume" = "Volume Up";
"increase_volume_small" = "Shift+Volume Up";
"mic_mute" = ["Microphone Mute" "Meta+Volume Mute,Microphone Mute" "Meta+Volume Mute,Mute Microphone"];
"mute" = "Volume Mute";
};
mediacontrol = {
"mediavolumedown" = "none,,Media volume down";
"mediavolumeup" = "none,,Media volume up";
"nextmedia" = "Media Next";
"pausemedia" = "Media Pause";
"playmedia" = "none,,Play media playback";
"playpausemedia" = "Media Play";
"previousmedia" = "Media Previous";
"stopmedia" = "Media Stop";
};
ksmserver = {
"Lock Session" = ["Meta+Ctrl+Q" "Screensaver,Meta+L" "Screensaver,Lock Session"];
};
kwin = {
"Window Close" = "Meta+Shift+Q";
"Kill Window" = "Meta+Ctrl+Esc";
"Window Operations Menu" = "Alt+F3";
"Window Resize" = "Meta+R,,Resize Window";
"Overview" = "Meta+W";
"Grid View" = "Meta+G";
"Edit Tiles" = "Meta+T";
"Activate Window Demanding Attention" = "Meta+Ctrl+A";
"PoloniumCycleEngine" = "Meta+|,none,Polonium: Cycle Engine";
"PoloniumFocusAbove" = "Meta+K,none,Polonium: Focus Above";
"PoloniumFocusBelow" = "Meta+J,none,Polonium: Focus Below";
"PoloniumFocusLeft" = "Meta+H,none,Polonium: Focus Left";
"PoloniumFocusRight" = "Meta+L,none,Polonium: Focus Right";
"PoloniumInsertAbove" = "Meta+Shift+K,none,Polonium: Insert Above";
"PoloniumInsertBelow" = "Meta+Shift+J,none,Polonium: Insert Below";
"PoloniumInsertLeft" = "Meta+Shift+H,none,Polonium: Insert Left";
"PoloniumInsertRight" = "Meta+Shift+L,none,Polonium: Insert Right";
"PoloniumOpenSettings" = "Meta+\\\\,none,Polonium: Open Settings Dialog";
"PoloniumResizeAbove" = "Meta+Ctrl+K,none,Polonium: Resize Above";
"PoloniumResizeBelow" = "Meta+Ctrl+J,none,Polonium: Resize Below";
"PoloniumResizeLeft" = "Meta+Ctrl+H,none,Polonium: Resize Left";
"PoloniumResizeRight" = "Meta+Ctrl+L,none,Polonium: Resize Right";
"PoloniumRetileWindow" = "Meta+Shift+Space,none,Polonium: Retile Window";
"PoloniumSwitchBTree" = [ ];
"PoloniumSwitchHalf" = [ ];
"PoloniumSwitchKwin" = [ ];
"PoloniumSwitchMonocle" = [ ];
"PoloniumSwitchThreeColumn" = [ ];
"Show Desktop" = "Meta+D";
"Switch to Desktop 1" = "Meta+1,,Switch to Desktop 1";
"Switch to Desktop 2" = "Meta+2,,Switch to Desktop 2";
"Switch to Desktop 3" = "Meta+3,,Switch to Desktop 3";
"Switch to Desktop 4" = "Meta+4,,Switch to Desktop 4";
"Switch to Desktop 5" = "Meta+5,,Switch to Desktop 5";
"Switch to Desktop 6" = "none,,Switch to Desktop 6";
"Switch to Desktop 7" = "none,,Switch to Desktop 7";
"Switch to Desktop 8" = "none,,Switch to Desktop 8";
"Switch to Desktop 9" = "none,,Switch to Desktop 9";
"Window to Desktop 1" = "Meta+!,,Window to Desktop 1";
"Window to Desktop 2" = "Meta+@,,Window to Desktop 2";
"Window to Desktop 3" = "Meta+#,,Window to Desktop 3";
"Window to Desktop 4" = "Meta+$,,Window to Desktop 4";
"Window to Desktop 5" = "Meta+%,,Window to Desktop 5";
"Window to Desktop 6" = "none,,Window to Desktop 6";
"Window to Desktop 7" = "none,,Window to Desktop 7";
"Window to Desktop 8" = "none,,Window to Desktop 8";
"Window to Desktop 9" = "none,,Window to Desktop 9";
"Walk Through Windows" = "Alt+Tab";
"Walk Through Windows (Reverse)" = "Alt+Shift+Tab";
"Walk Through Windows of Current Application" = "Alt+`";
"Walk Through Windows of Current Application (Reverse)" = "Alt+~";
"Window Fullscreen" = "Meta+Shift+F,,Make Window Fullscreen";
"Window Quick Tile Bottom" = "Meta+Down";
"Window Quick Tile Left" = "Meta+Left";
"Window Quick Tile Right" = "Meta+Right";
"Window Quick Tile Top" = "Meta+Up";
"view_actual_size" = "Meta+0";
"view_zoom_in" = ["Meta++" "Meta+=,Meta++" "Meta+=,Zoom In"];
"view_zoom_out" = "Meta+-";
};
"org_kde_powerdevil"."Decrease Keyboard Brightness" = "Keyboard Brightness Down";
"org_kde_powerdevil"."Decrease Screen Brightness" = "Monitor Brightness Down";
"org_kde_powerdevil"."Decrease Screen Brightness Small" = "Shift+Monitor Brightness Down";
"org_kde_powerdevil"."Hibernate" = "Hibernate";
"org_kde_powerdevil"."Increase Keyboard Brightness" = "Keyboard Brightness Up";
"org_kde_powerdevil"."Increase Screen Brightness" = "Monitor Brightness Up";
"org_kde_powerdevil"."Increase Screen Brightness Small" = "Shift+Monitor Brightness Up";
"org_kde_powerdevil"."PowerDown" = "Power Down";
"org_kde_powerdevil"."PowerOff" = "Power Off";
"org_kde_powerdevil"."Sleep" = "Sleep";
"org_kde_powerdevil"."Toggle Keyboard Backlight" = "Keyboard Light On/Off";
"org_kde_powerdevil"."Turn Off Screen" = [ ];
"org_kde_powerdevil"."powerProfile" = ["Battery" "Meta+B,Battery" "Meta+B,Switch Power Profile"];
"plasmashell"."activate application launcher" = ["Meta" "Alt+F1,Meta" "Alt+F1,Activate Application Launcher"];
};
configFile = {
kwinrc.Desktops.Number = {
value = 9;
immutable = true;
};
};
};
}

View File

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

View File

@@ -15,7 +15,6 @@
desktop.enable = true;
nfs-mounts.enable = true;
printing.enable = true;
spotifyd.enable = true;
users = {
enable = true;
extraGroups = [ "video" ];

View File

@@ -15,10 +15,6 @@
"nvidia_uvm"
"nvidia_drm"
];
boot.kernelParams = [
"nvidia_drm.fbdev=1"
"nvidia_drm.modeset=1"
];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
@@ -52,14 +48,6 @@
swapDevices = [ ];
services.beesd.filesystems = {
root = {
spec = "LABEL=nixos";
hashTableSizeMB = 4096;
verbosity = "crit";
};
};
powerManagement.cpuFreqGovernor = lib.mkDefault "powersave";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

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

View File

@@ -7,8 +7,6 @@ let
basePackages = with pkgs; [
brightnessctl
mangohud # Should probably get refactored with steam/gamescope out to a gaming role
polonium # auto tiling kwin addon
];
x11BasePackages = with pkgs; [
@@ -73,38 +71,10 @@ in
programs.kdeconnect.enable = true;
programs.java.enable = true;
programs.gamemode = {
enable = true;
};
programs.gamescope = {
enable = true;
#capSysNice = true;
args = [
#"--adaptive-sync"
#"--nested-refresh 165"
#"--backend wayland"
"--hdr-enabled"
"--hdr-itm-enable"
"--hdr-debug-force-output"
"--mangoapp"
"--rt"
"--steam"
#"--xwayland-count 2"
];
env = {
#PROTON_DISABLE_NVAPI = "1";
MANGOHUD = "1";
#MANGOHUD_CONFIG = "cpu_temp gpu_temp ram vram";
};
};
programs.steam = {
enable = true;
remotePlay.openFirewall = true;
localNetworkGameTransfers.openFirewall = true;
gamescopeSession = {
enable = true;
};
#package = pkgs.steam.override {
#withJava = true;
#withPrimus = true;

View File

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