summaryrefslogtreecommitdiffstats
path: root/makefu/1systems/x/x13
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2021-02-18 20:25:47 +0100
committertv <tv@krebsco.de>2021-02-18 20:25:47 +0100
commitf9bc618fada82326ed371b131eaed34d21626ae9 (patch)
treec48156ed3dc16594907c3744b14fcdafd2409206 /makefu/1systems/x/x13
parent9365aff352d99b7506bafbef6682de7bfb00df27 (diff)
parent8b7477926d0b7c1ac3d92d07e6934f9e593ea9ff (diff)
Merge remote-tracking branch 'prism/master'
Diffstat (limited to 'makefu/1systems/x/x13')
-rw-r--r--makefu/1systems/x/x13/default.nix52
-rw-r--r--makefu/1systems/x/x13/input.nix13
-rw-r--r--makefu/1systems/x/x13/toggle_brightness8
-rw-r--r--makefu/1systems/x/x13/zfs.nix32
4 files changed, 105 insertions, 0 deletions
diff --git a/makefu/1systems/x/x13/default.nix b/makefu/1systems/x/x13/default.nix
new file mode 100644
index 000000000..b0400232e
--- /dev/null
+++ b/makefu/1systems/x/x13/default.nix
@@ -0,0 +1,52 @@
+{ pkgs, lib, ... }:
+# new zfs deployment
+{
+ imports = [
+ ./zfs.nix
+ ./input.nix
+ <stockholm/makefu/2configs/hw/bluetooth.nix>
+ <nixos-hardware/lenovo/thinkpad/l14/amd> # close enough
+ # <stockholm/makefu/2configs/hw/tpm.nix>
+ <stockholm/makefu/2configs/hw/ssd.nix>
+ ];
+ boot.zfs.requestEncryptionCredentials = true;
+ networking.hostId = "f8b8e0a2";
+ boot.loader.systemd-boot.enable = true;
+ boot.loader.efi.canTouchEfiVariables = true;
+
+ # services.xserver.enable = lib.mkForce false;
+
+ services.xserver.videoDrivers = [
+ "amdgpu"
+ ];
+ hardware.opengl.extraPackages = [ pkgs.amdvlk ];
+ # is required for amd graphics support ( xorg wont boot otherwise )
+ boot.kernelPackages = pkgs.linuxPackages_latest;
+ environment.variables.VK_ICD_FILENAMES =
+ "/run/opengl-driver/share/vulkan/icd.d/amd_icd64.json";
+
+
+ programs.light.enable = true;
+ services.actkbd = {
+ enable = true;
+ bindings = [
+ { keys = [ 225 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -A 10"; }
+ { keys = [ 224 ]; events = [ "key" ]; command = "${pkgs.light}/bin/light -U 10"; }
+ { keys = [ 227 ]; events = [ "key" ]; command = builtins.toString (
+ pkgs.writers.writeDash "toggle_lcdshadow" ''
+ proc=/proc/acpi/ibm/lcdshadow
+ status=$(${pkgs.gawk}/bin/awk '/status:/{print $2}' "$proc")
+ if [ "$status" -eq 0 ];then
+ echo 1 > "$proc"
+ else
+ echo 0 > "$proc"
+ fi
+ '');
+ }
+ ];
+ };
+
+ users.groups.video = {};
+ users.users.makefu.extraGroups = [ "video" ];
+}
+
diff --git a/makefu/1systems/x/x13/input.nix b/makefu/1systems/x/x13/input.nix
new file mode 100644
index 000000000..68b855d8e
--- /dev/null
+++ b/makefu/1systems/x/x13/input.nix
@@ -0,0 +1,13 @@
+{
+ # current issues:
+ # 1. for pressing insert hold shift+fn+Fin
+
+ # scroll by holding middle mouse
+ services.xserver.displayManager.sessionCommands =''
+ xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation" 8 1
+ xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Button" 8 2
+ xinput set-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Axes" 6 7 4 5
+ # configure timeout of pressing and holding middle button
+ # xinput set-int-prop "ETPS/2 Elantech TrackPoint" "Evdev Wheel Emulation Timeout" 8 200
+ '';
+}
diff --git a/makefu/1systems/x/x13/toggle_brightness b/makefu/1systems/x/x13/toggle_brightness
new file mode 100644
index 000000000..dc1436cb6
--- /dev/null
+++ b/makefu/1systems/x/x13/toggle_brightness
@@ -0,0 +1,8 @@
+#!/bin/sh
+proc=/proc/acpi/ibm/lcdshadow
+status=$(awk '/status:/{print $2}' "$proc")
+if [ "$status" -eq 0 ];then
+ echo 1 > "$proc"
+else
+ echo 0 > "$proc"
+fi
diff --git a/makefu/1systems/x/x13/zfs.nix b/makefu/1systems/x/x13/zfs.nix
new file mode 100644
index 000000000..adfebbf96
--- /dev/null
+++ b/makefu/1systems/x/x13/zfs.nix
@@ -0,0 +1,32 @@
+# Do not modify this file! It was generated by ‘nixos-generate-config’
+# and may be overwritten by future invocations. Please make changes
+# to /etc/nixos/configuration.nix instead.
+{ config, lib, pkgs, modulesPath, ... }:
+
+{
+ imports =
+ [ (modulesPath + "/installer/scan/not-detected.nix")
+ ];
+
+ boot.initrd.availableKernelModules = [ "nvme" "ehci_pci" "xhci_pci" "rtsx_pci_sdmmc" ];
+ boot.initrd.kernelModules = [ ];
+ boot.kernelModules = [ "kvm-amd" ];
+ boot.extraModulePackages = [ ];
+
+ fileSystems."/" =
+ { device = "zroot/root/nixos";
+ fsType = "zfs";
+ };
+
+ fileSystems."/boot" =
+ { device = "/dev/disk/by-uuid/20BF-2755";
+ fsType = "vfat";
+ };
+
+ fileSystems."/home" =
+ { device = "zroot/root/home";
+ fsType = "zfs";
+ };
+
+ swapDevices = [ ];
+}