about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-10-03 22:06:43 +0200
committerPatryk Niedźwiedziński <pniedzwiedzinski19@gmail.com>2020-10-03 22:06:43 +0200
commit342155ced8fc78b608f23454cb631decb0b7be9b (patch)
tree2cc4ffc422d645e17cf456cdcc780287df311b3f /modules
parent5d3c8e21d2d79a6ed3e324b833002a9bb0317b34 (diff)
downloaddots-342155ced8fc78b608f23454cb631decb0b7be9b.tar.gz
dots-342155ced8fc78b608f23454cb631decb0b7be9b.zip
Update config
Diffstat (limited to 'modules')
-rw-r--r--modules/dockd.nix74
1 files changed, 74 insertions, 0 deletions
diff --git a/modules/dockd.nix b/modules/dockd.nix
new file mode 100644
index 0000000..83cb576
--- /dev/null
+++ b/modules/dockd.nix
@@ -0,0 +1,74 @@
+{ config, lib, pkgs, ... }:
+
+let
+  cfg = config.programs.dockd;
+in
+
+{
+  options = {
+    programs.dockd = {
+      enable = lib.mkOption {
+        type = lib.types.bool;
+        default = false;
+        description = ''
+          ThinkPad dock manager daemon.
+        '';
+      };
+    };
+  };
+
+  config = lib.mkIf (cfg.enable) {
+    environment.etc = {
+      "dockd/docked.conf".text = ''
+        [Screen]
+        height=1920
+        width=3000
+        mm_height=506
+        mm_width=791
+
+        [CRTC]
+        crtc=63
+        x=0
+        y=241
+        rotation=1
+        mode=1920x1080
+        outputs_len=1
+        outputs_0=HDMI-3
+
+        [CRTC]
+        crtc=64
+        x=1920
+        y=0
+        rotation=2
+        mode=1920x1080
+        outputs_len=1
+        outputs_0=DP-2
+      '';
+
+      "dockd/undocked.conf".text = ''
+        [Screen]
+        height=768
+        width=1366
+        mm_height=202
+        mm_width=359
+
+        [CRTC]
+        crtc=63
+        x=0
+        y=0
+        rotation=1
+        mode=1366x768
+        outputs_len=1
+        outputs_0=LVDS-1
+
+        [CRTC]
+        crtc=64
+        x=1920
+        y=0
+        rotation=2
+        mode=None
+        outputs_len=0
+      '';
+    };
+  };
+}