nixos-config/profiles/hardware.nix

86 lines
2.5 KiB
Nix
Raw Normal View History

{ pkgs, config, lib, inputs, ... }:
2020-02-17 17:00:59 +04:00
2021-01-21 22:13:53 +04:00
with rec { inherit (config) device deviceSpecific; };
2020-02-17 17:00:59 +04:00
with deviceSpecific; {
hardware.enableRedistributableFirmware = true; # For some unfree drivers
hardware.opengl.enable = true;
hardware.opengl.driSupport = true;
hardware.opengl.driSupport32Bit = true; # For steam
hardware.opengl.package = pkgs.mesa_drivers;
2020-02-17 17:00:59 +04:00
hardware.bluetooth.enable = true;
2020-11-22 11:41:13 +04:00
hardware.bluetooth.package = pkgs.bluezFull;
2020-02-17 17:00:59 +04:00
2021-06-08 20:35:21 +04:00
persist.state.directories = [ "/var/lib/bluetooth" ];
2021-06-07 19:22:59 +04:00
systemd.services.systemd-udev-settle.enable = false;
2021-07-27 19:12:19 +04:00
services.upower = { enable = true; };
2020-12-24 16:19:24 +04:00
2020-02-17 17:00:59 +04:00
services.logind.lidSwitchExternalPower = "ignore";
services.logind.extraConfig = "HandlePowerKey=suspend";
2021-01-21 22:13:53 +04:00
2021-04-04 01:04:51 +04:00
# sound.enable = true;
2021-04-01 14:55:14 +04:00
hardware.pulseaudio.enable = false;
services.pipewire = {
enable = true;
alsa.enable = true;
pulse.enable = true;
2021-07-27 19:12:19 +04:00
config.pipewire-pulse = {
"context.modules" = [
{
"args" = { };
"flags" = [ "ifexists" "nofail" ];
"name" = "libpipewire-module-rtkit";
}
{ "name" = "libpipewire-module-protocol-native"; }
{ "name" = "libpipewire-module-client-node"; }
{ "name" = "libpipewire-module-adapter"; }
{ "name" = "libpipewire-module-metadata"; }
{
"args" = {
2021-07-30 14:15:18 +04:00
"server.address" = [ "unix:native" "tcp:4713" ];
2021-07-27 19:12:19 +04:00
"vm.overrides" = { "pulse.min.quantum" = "1024/48000"; };
};
"name" = "libpipewire-module-protocol-pulse";
}
];
"context.properties" = { };
"context.spa-libs" = {
"audio.convert.*" = "audioconvert/libspa-audioconvert";
"support.*" = "support/libspa-support";
};
"stream.properties" = { };
};
2021-05-10 04:04:18 +04:00
media-session.config.bluez-monitor = {
2021-06-29 15:23:57 +04:00
properties = {
"bluez5.codecs" = [ "sbc" "aac" "ldac" "aptx" "aptx_hd" ];
2021-06-30 14:08:54 +04:00
"bluez5.mdbc-support" = true;
2021-06-29 15:23:57 +04:00
};
2021-05-10 04:04:18 +04:00
rules = [
{
actions = {
update-props = {
2021-06-29 15:23:57 +04:00
"bluez5.auto-connect" = [ "hsp_hs" "hfp_hf" "a2dp_sink" ];
2021-05-10 04:04:18 +04:00
"bluez5.hw-volume" =
2021-06-29 15:23:57 +04:00
[ "hsp_ag" "hfp_ag" "a2dp_source" "a2dp_sink" ];
2021-05-10 04:04:18 +04:00
};
};
matches = [{ "device.name" = "~bluez_card.*"; }];
}
{
actions = { update-props = { "node.pause-on-idle" = false; }; };
matches = [
{ "node.name" = "~bluez_input.*"; }
{ "node.name" = "~bluez_output.*"; }
];
}
];
};
2020-02-17 17:00:59 +04:00
};
}