From 9791074aec2b685853ee8eb1ea3688636d9512cb Mon Sep 17 00:00:00 2001 From: Felix Tenley Date: Sun, 1 Aug 2021 14:44:23 +0200 Subject: [PATCH] feat: switch to pipewire --- hardware/base.nix | 10 ---------- home/editors/neovim/kitty.vim | 6 ++++++ home/gaming/default.nix | 7 +++++++ home/gaming/lutris.nix | 31 +++++++++++++++++++++++++++++++ home/gaming/steam.nix | 12 ++++++++++++ system/default.nix | 9 ++++++++- system/gaming.nix | 5 +++++ system/sound.nix | 32 ++++++++++++++++++++++++++++++++ 8 files changed, 101 insertions(+), 11 deletions(-) create mode 100644 home/editors/neovim/kitty.vim create mode 100644 home/gaming/default.nix create mode 100644 home/gaming/lutris.nix create mode 100644 home/gaming/steam.nix create mode 100644 system/gaming.nix create mode 100644 system/sound.nix diff --git a/hardware/base.nix b/hardware/base.nix index 2cbc623..6a81b33 100644 --- a/hardware/base.nix +++ b/hardware/base.nix @@ -16,14 +16,4 @@ hardware.bluetooth.settings = { General = { Enable = "Source,Sink,Media,Socket"; }; }; - - # Sound. - sound.enable = true; - hardware.pulseaudio = { - enable = true; - support32Bit = true; - extraModules = [ pkgs.pulseaudio-modules-bt ]; - package = pkgs.pulseaudioFull; - }; } - diff --git a/home/editors/neovim/kitty.vim b/home/editors/neovim/kitty.vim new file mode 100644 index 0000000..088453c --- /dev/null +++ b/home/editors/neovim/kitty.vim @@ -0,0 +1,6 @@ +let g:kitty_navigator_no_mappings = 1 + +nnoremap {Left-Mapping} :KittyNavigateLeft +nnoremap {Down-Mapping} :KittyNavigateDown +nnoremap {Up-Mapping} :KittyNavigateUp +nnoremap {Right-Mapping} :KittyNavigateRight diff --git a/home/gaming/default.nix b/home/gaming/default.nix new file mode 100644 index 0000000..fa1818c --- /dev/null +++ b/home/gaming/default.nix @@ -0,0 +1,7 @@ +{ config, pkgs, nixosConfig, ... }: + +{ + imports = [ ./steam.nix ./lutris.nix ]; + + programs.gamemode.enable = true; +} diff --git a/home/gaming/lutris.nix b/home/gaming/lutris.nix new file mode 100644 index 0000000..bcab676 --- /dev/null +++ b/home/gaming/lutris.nix @@ -0,0 +1,31 @@ +{ config, pkgs, nixosConfig, ... }: + +{ + home.packages = with pkgs; [ lutris ]; + + xdg.dataFile = { + wine-runner-sc.source = let version = "6.10"; + in { + executable = true; + recursive = true; + source = builtins.fetchTarball { + src = + "https://github.com/snatella/wine-runner-sc/releases/download/wine-v${version}/wine-runner-${version}-gold-fsync.tgz"; + sha256 = ""; + }; + target = "lutris/wine/wine-runner-sc"; + }; + + proton-ge = let version = "6.12-GE-1"; + in { + executable = true; + recursive = true; + source = builtins.fetchTarball { + url = + "https://github.com/GloriousEggroll/proton-ge-custom/releases/download/${version}/Proton-${version}.tar.gz"; + sha256 = "12pk1bvjrziszglbrc6f0i555b19ycmf3cc70k63d53lyz3ra9vp"; + }; + target = "Steam/compatibilitytools.d/proton-ge"; + }; + }; +} diff --git a/home/gaming/steam.nix b/home/gaming/steam.nix new file mode 100644 index 0000000..4a9b099 --- /dev/null +++ b/home/gaming/steam.nix @@ -0,0 +1,12 @@ +{ config, pkgs, nixosConfig, ... }: + +let + steam = pkgs.steam.override { + extraLibraries = pkgs: + with nixosConfig.hardware.opengl; + if pkgs.hostPlatform.is64bit then + [ package ] ++ extraPackages + else + [ package32 ] ++ extraPackages32; + }; +in { home.packages = [ steam steam.run ]; } diff --git a/system/default.nix b/system/default.nix index cc6e9ee..eb9b1c6 100644 --- a/system/default.nix +++ b/system/default.nix @@ -1,7 +1,14 @@ { config, pkgs, ... }: { - imports = [ ./hardened.nix ./i18n.nix ./nix.nix ./networking.nix ./vpn.nix ]; + imports = [ + ./hardened.nix + ./sound.nix + ./i18n.nix + ./nix.nix + ./networking.nix + ./vpn.nix + ]; environment.systemPackages = with pkgs; [ wget curl openssl neovim ]; diff --git a/system/gaming.nix b/system/gaming.nix new file mode 100644 index 0000000..7af71cc --- /dev/null +++ b/system/gaming.nix @@ -0,0 +1,5 @@ +{ config, pkgs, ... }: + +{ + programs.gamemode.enable = true; +} diff --git a/system/sound.nix b/system/sound.nix new file mode 100644 index 0000000..7d06248 --- /dev/null +++ b/system/sound.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, ... }: + +{ + hardware.pulseaudio.enable = false; + security.rtkit.enable = true; + services.pipewire = { + enable = true; + alsa.enable = true; + alsa.support32Bit = true; + pulse.enable = true; + jack.enable = true; + media-session.config.bluez-monitor.rules = [ + { + matches = [{ "device.name" = "~bluez_card.*"; }]; + actions = { + "update-props" = { + "bluez5.reconnect-profiles" = [ "hfp_hf" "hsp_hs" "a2dp_sink" ]; + "bluez5.msbc-support" = true; + "bluez5.sbc-xq-support" = true; + }; + }; + } + { + matches = [ + { "node.name" = "~bluez_input.*"; } + { "node.name" = "~bluez_output.*"; } + ]; + actions = { "node.pause-on-idle" = false; }; + } + ]; + }; +}