Move hardware config to modules

This commit is contained in:
Henrik Lissner 2020-01-14 06:57:36 -05:00
parent 2f716fb1aa
commit 8fc757c678
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
4 changed files with 45 additions and 19 deletions

View file

@ -5,6 +5,9 @@
imports = [
./. # import common settings
<my/modules/hardware/nvidia.nix>
<my/modules/hardware/ergodox.nix>
<my/modules/desktop/bspwm.nix>
<my/modules/chat.nix> # discord, mainly
@ -36,23 +39,10 @@
networking.networkmanager.enable = true;
time.timeZone = "America/Toronto";
## Hardware
# GPU
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
# For ergodox ez
my.packages = [ pkgs.teensy-loader-cli ];
my.alias.teensyload = "sudo teensy-loader-cli -w -v --mcu=atmega32u4";
# For my intuos4 pro. My cintiq doesn't work on Linux though :(
services.xserver.wacom.enable = true;
# TODO Move this to udev
# my.init = ''
# # lock tablet to main display
# if xinput list --id-only "Wacom Intuos Pro S Pen stylus" 2>&1 >/dev/null; then
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen stylus") DVI-I-1
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen eraser") DVI-I-1
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen cursor") DVI-I-1
# fi
# '';
# Mouse settings
services.xserver.libinput = {
enable = true;
middleEmulation = true;
scrollButton = 3;
};
}

View file

@ -0,0 +1,6 @@
{ config, lib, pkgs, ... }:
{
my.packages = [ pkgs.teensy-loader-cli ];
my.alias.teensyload = "sudo teensy-loader-cli -w -v --mcu=atmega32u4";
}

View file

@ -0,0 +1,14 @@
{ config, lib, pkgs, ... }:
{
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.enable = true;
# Respect XDG conventions, damn it!
environment.systemPackages = with pkgs; [
(pkgs.writeScriptBin "nvidia-settings" ''
#!${pkgs.stdenv.shell}
exec ${config.boot.kernelPackages.nvidia_x11}/bin/nvidia-settings --config="$XDG_CONFIG_HOME/nvidia/settings"
'')
];
}

View file

@ -0,0 +1,16 @@
{ config, lib, pkgs, ... }:
{
# For my intuos4 pro. Doesn't work for cintiqs.
services.xserver.wacom.enable = true;
# TODO Move this to udev
# my.init = ''
# # lock tablet to main display
# if xinput list --id-only "Wacom Intuos Pro S Pen stylus" 2>&1 >/dev/null; then
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen stylus") DVI-I-1
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen eraser") DVI-I-1
# xinput map-to-output $(xinput list --id-only "Wacom Intuos Pro S Pen cursor") DVI-I-1
# fi
# '';
}