From c5d2efcf1ddb2dbf69dd648eac2152a981bf9624 Mon Sep 17 00:00:00 2001 From: Boom-Hacker Date: Sun, 2 Nov 2025 20:37:02 +0800 Subject: [PATCH 1/7] Init support for acer chromebook cp713-1wn(with full audio support from https://github.com/ninelore/flake and https://github.com/WeirdTreeThing/chromebook-linux-audio --- .../cp713-1wn/alsa-ucm-conf-cros.nix | 25 +++++++++++++++++++ acer/chromebook/cp713-1wn/default.nix | 18 +++++++++++++ flake.nix | 1 + 3 files changed, 44 insertions(+) create mode 100644 acer/chromebook/cp713-1wn/alsa-ucm-conf-cros.nix create mode 100644 acer/chromebook/cp713-1wn/default.nix diff --git a/acer/chromebook/cp713-1wn/alsa-ucm-conf-cros.nix b/acer/chromebook/cp713-1wn/alsa-ucm-conf-cros.nix new file mode 100644 index 00000000..9041a4a3 --- /dev/null +++ b/acer/chromebook/cp713-1wn/alsa-ucm-conf-cros.nix @@ -0,0 +1,25 @@ +{ lib +, alsa-ucm-conf +, fetchFromGitHub +}: + +alsa-ucm-conf.overrideAttrs (oldAttrs: { + wttsrc = fetchFromGitHub { + owner = "WeirdTreeThing"; + repo = "alsa-ucm-conf-cros"; + rev = "1908a457c7f2bf8b63264fe3b1e0522ea632ac5a"; + hash = "sha256-h4qphJgXlEGMjpV4+llTaJeM3hoglmmgkXY8rOp+MAI="; + }; + + postInstall = '' + cp -rf $wttsrc/ucm2 $out/share/alsa/ + ''; + + meta = oldAttrs.meta // { + platforms = [ + "aarch64-linux" + "x86_64-linux" + ]; + }; +}) + diff --git a/acer/chromebook/cp713-1wn/default.nix b/acer/chromebook/cp713-1wn/default.nix new file mode 100644 index 00000000..559d0c94 --- /dev/null +++ b/acer/chromebook/cp713-1wn/default.nix @@ -0,0 +1,18 @@ +{ lib, pkgs, ... }: + +let + alsa-ucm-conf-cros = pkgs.callPackage ./alsa-ucm-conf-cros.nix { }; +in { + imports = [ + ../../../common/cpu/intel/kaby-lake + ../../../common/pc/laptop + ../../../common/hidpi.nix + ]; + boot.extraModprobeConfig = '' + options snd-intel-dspcfg dsp_driver=4 + options snd-soc-avs ignore_fw_version=1 + options snd-soc-avs obsolete_card_names=1 + ''; + environment.sessionVariables.ALSA_CONFIG_UCM2 = lib.mkDefault "${alsa-ucm-conf-cros}/share/alsa/ucm2"; +} + diff --git a/flake.nix b/flake.nix index ce7425b9..b659233e 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,7 @@ in { acer-aspire-4810t = import ./acer/aspire/4810t; + acer-chromebook-cp713-1wn = import ./acer/chromebook/cp713-1wn; airis-n990 = import ./airis/n990; aoostar-r1-n100 = import ./aoostar/r1/n100; apple-imac-14-2 = import ./apple/imac/14-2; From a8ee47c46f413ced8ff85a50211b49b56ea05e63 Mon Sep 17 00:00:00 2001 From: Boom-Hacker Date: Sun, 2 Nov 2025 21:02:17 +0800 Subject: [PATCH 2/7] fixed wireplumber --- acer/chromebook/cp713-1wn/default.nix | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/acer/chromebook/cp713-1wn/default.nix b/acer/chromebook/cp713-1wn/default.nix index 559d0c94..a63c020f 100644 --- a/acer/chromebook/cp713-1wn/default.nix +++ b/acer/chromebook/cp713-1wn/default.nix @@ -14,5 +14,22 @@ in { options snd-soc-avs obsolete_card_names=1 ''; environment.sessionVariables.ALSA_CONFIG_UCM2 = lib.mkDefault "${alsa-ucm-conf-cros}/share/alsa/ucm2"; + + services.pipewire.wireplumber.extraConfig."51-increase-headroom" = { + "monitor.alsa.rules" = [ + { + matches = [ + { + "node.name" = "~alsa_output.*"; + } + ]; + actions = { + "update-props" = { + "api.alsa.headroom" = 4096; + }; + }; + } + ]; +}; } From a7d3be34dc8b214d21b540839960ea5d0a1b983f Mon Sep 17 00:00:00 2001 From: Boom-Hacker Date: Sun, 2 Nov 2025 21:18:40 +0800 Subject: [PATCH 3/7] catch up with ninelore --- acer/chromebook/cp713-1wn/default.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/acer/chromebook/cp713-1wn/default.nix b/acer/chromebook/cp713-1wn/default.nix index a63c020f..c504f297 100644 --- a/acer/chromebook/cp713-1wn/default.nix +++ b/acer/chromebook/cp713-1wn/default.nix @@ -8,11 +8,23 @@ in { ../../../common/pc/laptop ../../../common/hidpi.nix ]; + boot.extraModprobeConfig = '' options snd-intel-dspcfg dsp_driver=4 options snd-soc-avs ignore_fw_version=1 options snd-soc-avs obsolete_card_names=1 ''; + + boot.initrd.systemd.tpm2.enable = lib.mkDefault false; + boot.kernelParams = [ "iomem=relaxed" ]; + hardware.enableRedistributableFirmware = lib.mkDefault true; + hardware.sensor.iio.enable = lib.mkDefault true; + services = { + libinput.enable = lib.mkDefault true; + }; + + security.tpm2.enable = lib.mkDefault false; + environment.sessionVariables.ALSA_CONFIG_UCM2 = lib.mkDefault "${alsa-ucm-conf-cros}/share/alsa/ucm2"; services.pipewire.wireplumber.extraConfig."51-increase-headroom" = { From 478c9ccb0e1668ba0a5934004b4c09cfa1fd95b4 Mon Sep 17 00:00:00 2001 From: Boom-Hacker Date: Sun, 2 Nov 2025 23:28:46 +0800 Subject: [PATCH 4/7] added keyd --- acer/chromebook/cp713-1wn/default.nix | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/acer/chromebook/cp713-1wn/default.nix b/acer/chromebook/cp713-1wn/default.nix index c504f297..8bebae38 100644 --- a/acer/chromebook/cp713-1wn/default.nix +++ b/acer/chromebook/cp713-1wn/default.nix @@ -21,7 +21,56 @@ in { hardware.sensor.iio.enable = lib.mkDefault true; services = { libinput.enable = lib.mkDefault true; + keyd.enable = lib.mkDefault true; }; + + services.keyd = { + keyboards = { + # The name is just the name of the configuration file, it does not really matter + default = { + ids = [ "*" ]; # what goes into the [id] section, here we select all keyboards + # Everything but the ID section: + settings = { + # The main layer, if you choose to declare it in Nix + main = { + f1 = "A-left"; + f2 = "A-right"; + f3 = "refresh"; + f4 = "A-f10"; + f5 = "A-tab"; + f6 = "brightnessdown"; + f7 = "brightnessup"; + f8 = "mute"; + f9 = "volumedown"; + f10 = "volumeup"; + f13 = "coffee"; + }; + control = { + f5 = "sysrq"; + }; + alt = { + leftmeta = "capslock"; + left = "home"; + right = "end"; + up = "pageup"; + down = "pagedown"; + }; + }; + extraConfig = '' + # put here any extra-config, e.g. you can copy/paste here directly a configuration, just remove the ids part + ''; + }; + }; +}; + + # Optional, but makes sure that when you type the make palm rejection work with keyd + # https://github.com/rvaiya/keyd/issues/723 + environment.etc."libinput/local-overrides.quirks".text = '' + [Serial Keyboards] + MatchUdevType=keyboard + MatchName=keyd virtual keyboard + AttrKeyboardIntegration=internal + ''; security.tpm2.enable = lib.mkDefault false; From 05b280fcd6a4cd6995bd708c73c4c122e63484d7 Mon Sep 17 00:00:00 2001 From: Boom-Hacker Date: Sun, 2 Nov 2025 23:42:01 +0800 Subject: [PATCH 5/7] fixed delete key --- acer/chromebook/cp713-1wn/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/acer/chromebook/cp713-1wn/default.nix b/acer/chromebook/cp713-1wn/default.nix index 8bebae38..41f2a078 100644 --- a/acer/chromebook/cp713-1wn/default.nix +++ b/acer/chromebook/cp713-1wn/default.nix @@ -54,6 +54,7 @@ in { right = "end"; up = "pageup"; down = "pagedown"; + backspace = "delete"; }; }; extraConfig = '' From 9cd06b13d0c4f08879731df5ea4568548bd9b9ad Mon Sep 17 00:00:00 2001 From: Boom-Hacker Date: Sun, 2 Nov 2025 23:42:55 +0800 Subject: [PATCH 6/7] fixed bind --- acer/chromebook/cp713-1wn/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acer/chromebook/cp713-1wn/default.nix b/acer/chromebook/cp713-1wn/default.nix index 41f2a078..3aa11f8b 100644 --- a/acer/chromebook/cp713-1wn/default.nix +++ b/acer/chromebook/cp713-1wn/default.nix @@ -28,7 +28,7 @@ in { keyboards = { # The name is just the name of the configuration file, it does not really matter default = { - ids = [ "*" ]; # what goes into the [id] section, here we select all keyboards + ids = [ "k:n:AT Translated Set 2 keyboard" ]; # what goes into the [id] section, here we select all keyboards # Everything but the ID section: settings = { # The main layer, if you choose to declare it in Nix From 6c870034bfa7d6dfc6d2185c2faad3c7a9ca05bd Mon Sep 17 00:00:00 2001 From: Boom-Hacker Date: Sun, 2 Nov 2025 23:45:01 +0800 Subject: [PATCH 7/7] Revert "fixed bind" This reverts commit 9cd06b13d0c4f08879731df5ea4568548bd9b9ad. --- acer/chromebook/cp713-1wn/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/acer/chromebook/cp713-1wn/default.nix b/acer/chromebook/cp713-1wn/default.nix index 3aa11f8b..41f2a078 100644 --- a/acer/chromebook/cp713-1wn/default.nix +++ b/acer/chromebook/cp713-1wn/default.nix @@ -28,7 +28,7 @@ in { keyboards = { # The name is just the name of the configuration file, it does not really matter default = { - ids = [ "k:n:AT Translated Set 2 keyboard" ]; # what goes into the [id] section, here we select all keyboards + ids = [ "*" ]; # what goes into the [id] section, here we select all keyboards # Everything but the ID section: settings = { # The main layer, if you choose to declare it in Nix