From c56ec41dd825f2589907b85027aaa6c5e7d45e74 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Tue, 23 Jan 2024 14:19:19 -0800 Subject: [PATCH] upgrade nixos, audio stuff --- extras/dev.nix | 2 +- extras/gaming.nix | 27 +++++++++++++++++++++++++-- flake.lock | 8 ++++---- flake.nix | 2 +- users/tao.nix | 6 +++--- 5 files changed, 34 insertions(+), 11 deletions(-) diff --git a/extras/dev.nix b/extras/dev.nix index d83810a..bdb8836 100644 --- a/extras/dev.nix +++ b/extras/dev.nix @@ -39,7 +39,7 @@ ]; nixpkgs.config.permittedInsecurePackages = [ - "electron-12.2.3" + "electron-19.1.9" ]; services.udev.extraRules = '' diff --git a/extras/gaming.nix b/extras/gaming.nix index aa051c2..0d8b631 100644 --- a/extras/gaming.nix +++ b/extras/gaming.nix @@ -22,21 +22,44 @@ nix.settings = aagl.nixConfig; programs.honkers-railway-launcher.enable = true; + users = { groups.game = { }; }; + security.pam.loginLimits = [ + { domain = "@game"; type = "-"; item = "nice"; value = -20; } + ]; + security.rtkit.enable = true; environment.etc = let json = pkgs.formats.json { }; in { - "pipewire/pipewire.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" { + "pipewire/pipewire.conf.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" { context.properties = { - default.clock.rate = 48000; # default.allowed-rates = [] + default.clock.rate = 48000; default.clock.quantum = 32; default.clock.min-quantum = 32; default.clock.max-quantum = 32; }; }; + "pipewire/pipewire-pulse.d/92-low-latency.conf".source = json.generate "92-low-latency.conf" { + context.modules = [ + { + name = "libpipewire-module-protocol-pulse"; + args = { + pulse.min.req = "32/48000"; + pulse.default.req = "32/48000"; + pulse.max.req = "32/48000"; + pulse.min.quantum = "32/48000"; + pulse.max.quantum = "32/48000"; + }; + } + ]; + stream.properties = { + node.latency = "32/48000"; + resample.quality = 1; + }; + }; # "pipewire/pipewire.d/99-input-denoising.conf" = json.generate "99-input-denoising.conf" { # context.modules = [{ # name = "libpipewire-module-filter-chain"; diff --git a/flake.lock b/flake.lock index 3468e85..87c6947 100644 --- a/flake.lock +++ b/flake.lock @@ -120,16 +120,16 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1704290814, - "narHash": "sha256-LWvKHp7kGxk/GEtlrGYV68qIvPHkU9iToomNFGagixU=", + "lastModified": 1705774713, + "narHash": "sha256-j6ADaDH9XiumUzkTPlFyCBcoWYhO83lfgiSqEJF2zcs=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "70bdadeb94ffc8806c0570eb5c2695ad29f0e421", + "rev": "1b64fc1287991a9cce717a01c1973ef86cb1af0b", "type": "github" }, "original": { "id": "nixpkgs", - "ref": "nixos-23.05", + "ref": "nixos-23.11", "type": "indirect" } }, diff --git a/flake.nix b/flake.nix index 574781f..d9cfba8 100644 --- a/flake.nix +++ b/flake.nix @@ -2,7 +2,7 @@ description = "we say NO to shitty OSes"; inputs = { - nixpkgs.url = "nixpkgs/nixos-23.05"; + nixpkgs.url = "nixpkgs/nixos-23.11"; nixpkgs-unstable.url = "nixpkgs/nixos-unstable"; nixos-hardware.url = "nixos-hardware"; nixos-raspberrypi.url = "github:ramblurr/nixos-raspberrypi"; diff --git a/users/tao.nix b/users/tao.nix index 1f2f67b..6a7da7a 100644 --- a/users/tao.nix +++ b/users/tao.nix @@ -79,15 +79,15 @@ configDir = "/home/tao/.config/syncthing"; }; - fonts.fonts = with pkgs; [ + fonts.packages = with pkgs; [ (nerdfonts.override { fonts = [ "FiraCode" ]; }) noto-fonts-cjk - noto-fonts-emoji + noto-fonts-color-emoji ]; users.users.tao = { isNormalUser = true; - extraGroups = [ "video" "wheel" "libvirtd" "dialout" "scanner" "lp" ]; + extraGroups = [ "video" "wheel" "libvirtd" "dialout" "game" ]; shell = pkgs.unstable.nushell; };