about summary refs log tree commit diff
path: root/modules/workstation/hardware
diff options
context:
space:
mode:
Diffstat (limited to 'modules/workstation/hardware')
-rw-r--r--modules/workstation/hardware/bluetooth/default.nix5
-rw-r--r--modules/workstation/hardware/default.nix11
-rw-r--r--modules/workstation/hardware/keyboard/default.nix15
-rw-r--r--modules/workstation/hardware/libinput/default.nix13
-rw-r--r--modules/workstation/hardware/pixelbook/default.nix17
-rw-r--r--modules/workstation/hardware/yubikey/default.nix14
-rw-r--r--modules/workstation/hardware/yubikey/u2f_keys1
7 files changed, 76 insertions, 0 deletions
diff --git a/modules/workstation/hardware/bluetooth/default.nix b/modules/workstation/hardware/bluetooth/default.nix
new file mode 100644
index 000000000000..fb6a06a03e5f
--- /dev/null
+++ b/modules/workstation/hardware/bluetooth/default.nix
@@ -0,0 +1,5 @@
+{ ... }:
+
+{
+  hardware.bluetooth.enable = true;
+}
diff --git a/modules/workstation/hardware/default.nix b/modules/workstation/hardware/default.nix
new file mode 100644
index 000000000000..64e06aecf363
--- /dev/null
+++ b/modules/workstation/hardware/default.nix
@@ -0,0 +1,11 @@
+{ pkgs, ... }:
+
+{
+  imports = [ ./keyboard ./libinput ./yubikey ];
+
+  environment.systemPackages = with pkgs; [ brightnessctl ddrescue usbutils ];
+
+  hardware.sane.enable = true;
+
+  sound.enable = true;
+}
diff --git a/modules/workstation/hardware/keyboard/default.nix b/modules/workstation/hardware/keyboard/default.nix
new file mode 100644
index 000000000000..3bd9dc4280db
--- /dev/null
+++ b/modules/workstation/hardware/keyboard/default.nix
@@ -0,0 +1,15 @@
+{ pkgs, config, ... }:
+
+let
+  xcfg = config.services.xserver;
+
+in
+{
+  console.useXkbConfig = true;
+  services.xserver.xkb.variant = "dvorak";
+  services.xserver.xkb.options = "caps:escape,compose:menu,compose:prsc";
+
+  environment.variables.XKB_DEFAULT_LAYOUT = xcfg.xkb.layout;
+  environment.variables.XKB_DEFAULT_VARIANT = xcfg.xkb.variant;
+  environment.variables.XKB_DEFAULT_OPTIONS = xcfg.xkb.options;
+}
diff --git a/modules/workstation/hardware/libinput/default.nix b/modules/workstation/hardware/libinput/default.nix
new file mode 100644
index 000000000000..c3a56e22feb7
--- /dev/null
+++ b/modules/workstation/hardware/libinput/default.nix
@@ -0,0 +1,13 @@
+{ ... }:
+
+{
+  environment.etc."libinput/local-overrides.quirks".text = ''
+    [Google Chromebook Eve]
+    MatchUdevType=touchpad
+    MatchName=ACPI0C50:00 18D1:5028
+    MatchDMIModalias=dmi:*svnGoogle:pnEve*
+    ModelChromebook=1
+    AttrPressureRange=6:4
+    AttrThumbPressureThreshold=45
+  '';
+}
diff --git a/modules/workstation/hardware/pixelbook/default.nix b/modules/workstation/hardware/pixelbook/default.nix
new file mode 100644
index 000000000000..b708abc85a3d
--- /dev/null
+++ b/modules/workstation/hardware/pixelbook/default.nix
@@ -0,0 +1,17 @@
+{ ... }:
+
+{
+  imports = [ ../../../nixos-hardware/google/pixelbook ];
+
+  boot.postBootCommands = ''
+    # Remap Google Assistant to left super.
+    /run/current-system/sw/bin/setkeycodes e058 125
+
+    # Remap menu to compose.
+    /run/current-system/sw/bin/setkeycodes 5d 127
+  '';
+
+  services.logind.extraConfig = ''
+    HandlePowerKey=suspend
+  '';
+}
diff --git a/modules/workstation/hardware/yubikey/default.nix b/modules/workstation/hardware/yubikey/default.nix
new file mode 100644
index 000000000000..0f2d63e742b9
--- /dev/null
+++ b/modules/workstation/hardware/yubikey/default.nix
@@ -0,0 +1,14 @@
+{ pkgs, ... }:
+
+{
+  services.udev.packages = with pkgs; [ yubikey-personalization ];
+
+  security.pam.services.sudo.u2fAuth = true;
+  security.sudo.extraConfig = ''
+    Defaults timestamp_timeout=0
+  '';
+
+  security.pam.u2f.appId = "pam://qyliss.net";
+  security.pam.u2f.cue = true;
+  security.pam.u2f.authFile = pkgs.copyPathToStore ./u2f_keys;
+}
diff --git a/modules/workstation/hardware/yubikey/u2f_keys b/modules/workstation/hardware/yubikey/u2f_keys
new file mode 100644
index 000000000000..1bb4f2f4c3a4
--- /dev/null
+++ b/modules/workstation/hardware/yubikey/u2f_keys
@@ -0,0 +1 @@
+qyliss:xEFvYinTZARyMSapx3wLN6U0w5oy7he66DM9Ww1EIUwr1eEsdEVX6JTayiol+XyGkThCMCRPJcEvTqR8cgXd8A==,0gl+uRidS5Dhx1S54aniQhJE+anN6hhTelZ8DncvpM2Z6MLfc/QUotFFE0cCBEA6KbQOIK9+WtgabFGOqBmljw==,es256,+presence