about summary refs log tree commit diff
path: root/modules/nixos-hardware/toshiba/swanky/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos-hardware/toshiba/swanky/default.nix')
-rw-r--r--modules/nixos-hardware/toshiba/swanky/default.nix27
1 files changed, 27 insertions, 0 deletions
diff --git a/modules/nixos-hardware/toshiba/swanky/default.nix b/modules/nixos-hardware/toshiba/swanky/default.nix
new file mode 100644
index 000000000000..8361df66e53f
--- /dev/null
+++ b/modules/nixos-hardware/toshiba/swanky/default.nix
@@ -0,0 +1,27 @@
+{ lib, pkgs, ... }:
+
+let
+  ucm = pkgs.fetchzip {
+    url = "https://github.com/plbossart/UCM/archive/2050ca78a4d1a853d1ba050b591f42e6f97adfc0.tar.gz";
+    sha256 = "1rs4mpz3b965nmz0yhy6j4ga3fdz320qnpkd7d61nvpv9c3i6zwj";
+  };
+in
+
+{
+  imports = [
+    ../../common/cpu/intel
+    ../../common/pc/laptop
+  ];
+
+  # Required for screen brightness control:
+  boot.kernelParams = [ "acpi_backlight=vendor" ];
+
+  # Sound requires a custom UCM config:
+  system.replaceRuntimeDependencies = [{
+    original = pkgs.alsaLib;
+
+    replacement = pkgs.alsaLib.overrideAttrs (super: {
+      postFixup = "cp -r ${ucm}/chtmax98090 $out/share/alsa/ucm";
+    });
+  }];
+}