pipewire by default in ezpc

This commit is contained in:
notgne2 2021-09-02 10:44:32 -07:00
parent 63d2744755
commit 9fe2ae150c
No known key found for this signature in database
GPG Key ID: BB661E172B42A7F8
3 changed files with 17 additions and 30 deletions

View File

@ -8,6 +8,8 @@
config = { config = {
services.haveged.enable = true; services.haveged.enable = true;
security.rtkit.enable = true;
services.smartd.enable = true; services.smartd.enable = true;
hardware.enableAllFirmware = true; hardware.enableAllFirmware = true;

View File

@ -238,20 +238,8 @@ let
(lib.lists.range 11 (10 * (builtins.length alphabet) + 10)) (lib.lists.range 11 (10 * (builtins.length alphabet) + 10))
) // ( ) // (
let let
volumeUp = ( volumeUp = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
if cfg.haddr != null then volumeDown = "exec ${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
"exec ${pkgs.qt5.qttools.bin}/bin/qdbus --system org.bluez ${cfg.haddr} org.bluez.MediaControl1.VolumeUp || "
else
"exec "
)
+ "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ +5%";
volumeDown = (
if cfg.haddr != null then
"exec ${pkgs.qt5.qttools.bin}/bin/qdbus --system org.bluez ${cfg.haddr} org.bluez.MediaControl1.VolumeDown || "
else
"exec "
)
+ "${pkgs.pulseaudio}/bin/pactl set-sink-volume @DEFAULT_SINK@ -5%";
in in
{ {
"Print" = "exec ${scrsaveclip}"; "Print" = "exec ${scrsaveclip}";
@ -978,12 +966,6 @@ in
description = "If this PC has bluetooth support"; description = "If this PC has bluetooth support";
}; };
haddr = mkOption {
type = types.nullOr types.str;
default = null;
description = "address for ur bluetooth headphones";
};
battery = mkOption { battery = mkOption {
type = types.bool; type = types.bool;
default = false; default = false;

View File

@ -18,16 +18,19 @@ let
networking.firewall.allowedTCPPorts = [ 22 ]; networking.firewall.allowedTCPPorts = [ 22 ];
networking.firewall.allowedUDPPorts = [ 1900 ]; networking.firewall.allowedUDPPorts = [ 1900 ];
hardware.pulseaudio.enable = lib.mkDefault (!cfg.portals); hardware.pulseaudio.enable = lib.mkDefault false;
services.pipewire = { services.pipewire = {
enable = lib.mkDefault cfg.portals; enable = lib.mkDefault true;
jack.enable = lib.mkDefault cfg.portals; jack.enable = lib.mkDefault true;
alsa.enable = lib.mkDefault cfg.portals; alsa.enable = lib.mkDefault true;
alsa.support32Bit = lib.mkDefault cfg.portals; alsa.support32Bit = lib.mkDefault true;
pulse.enable = lib.mkDefault cfg.portals; pulse.enable = lib.mkDefault true;
media-session.config.bluez-monitor = { media-session.config.bluez-monitor = {
properties = { }; properties = {
"bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
"bluez5.mdbc-support" = true;
};
rules = [ rules = [
{ {
actions = { actions = {
@ -50,9 +53,9 @@ let
}; };
}; };
xdg.portal.enable = lib.mkDefault cfg.portals; xdg.portal.enable = lib.mkDefault true;
xdg.portal.gtkUsePortal = lib.mkDefault cfg.portals; xdg.portal.gtkUsePortal = lib.mkDefault true;
xdg.portal.extraPortals = lib.mkDefault (if cfg.portals then with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk ] else []); xdg.portal.extraPortals = lib.mkDefault (with pkgs; [ xdg-desktop-portal-wlr xdg-desktop-portal-gtk ]);
# let me use audio and phones # let me use audio and phones
programs.adb.enable = cfg.developer; programs.adb.enable = cfg.developer;