{ config, lib, pkgs, ... }: { imports = [ ]; options.me = { launch_keyboard.enable = lib.mkOption { type = lib.types.bool; default = false; example = true; description = "Whether we want to install launch_keyboard."; }; }; config = lib.mkIf config.me.launch_keyboard.enable ( lib.mkMerge [ (lib.mkIf config.me.graphical { environment.systemPackages = with pkgs; [ system76-keyboard-configurator dfu-programmer # For flashing keyboard https://support.system76.com/articles/launch_2-firmware-update/ avrdude # For flashing keyboard https://support.system76.com/articles/launch_2-firmware-update/ lxqt.lxqt-policykit # Need a polkit agent to launch the keyboard configurator ]; systemd = { user.services.lxqt-policykit-agent = { description = "lxqt-policykit-agent"; wantedBy = [ "graphical-session.target" ]; wants = [ "graphical-session.target" ]; after = [ "graphical-session.target" ]; serviceConfig = { Type = "simple"; ExecStart = "${pkgs.lxqt.lxqt-policykit}/bin/lxqt-policykit-agent"; Restart = "on-failure"; RestartSec = 1; TimeoutStopSec = 10; }; }; }; }) ] ); }