mirror of
https://github.com/davegallant/nix-config
synced 2025-08-06 11:23:40 +00:00
Remove g810
This commit is contained in:
6
flake.lock
generated
6
flake.lock
generated
@@ -7,11 +7,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1614458576,
|
||||
"narHash": "sha256-bCwdJgkZfeYk8LBc38xw1AaK6KfTPrM/aJ1W0am7hEw=",
|
||||
"lastModified": 1614524771,
|
||||
"narHash": "sha256-0k/1mT1qur+4+6eG0r2MoIR1nhG000tc0KpxvfO/8+c=",
|
||||
"owner": "nix-community",
|
||||
"repo": "home-manager",
|
||||
"rev": "3327cbe1f9d355fbeb5ee204908ab1013c18f685",
|
||||
"rev": "aa479b0124393e0a828f97cfa75a418b4c6c20f8",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
|
@@ -51,7 +51,6 @@
|
||||
modules = [
|
||||
./machines/hephaestus/configuration.nix
|
||||
./machines/hephaestus/hardware.nix
|
||||
./modules/g810-led.nix
|
||||
] ++ defaultModules;
|
||||
};
|
||||
hermes = nixpkgs.lib.nixosSystem {
|
||||
|
@@ -54,15 +54,5 @@
|
||||
|
||||
# Open ports in the firewall.
|
||||
networking.firewall.enable = true;
|
||||
|
||||
systemd.services.g810-led = {
|
||||
description = "Set Logitech G810 Led Profile";
|
||||
serviceConfig = {
|
||||
ExecStart = "${pkgs.g810-led}/bin/g810-led -p /etc/g610-led/profile";
|
||||
Type = "oneshot";
|
||||
};
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
|
@@ -25,11 +25,4 @@
|
||||
# high-resolution display
|
||||
hardware.video.hidpi.enable = lib.mkDefault true;
|
||||
|
||||
# Enable g810-led and set profile.
|
||||
hardware.g810-led.enable = true;
|
||||
hardware.g810-led.profile = builtins.toFile "g610-led-profile" ''
|
||||
a 000000 # Set all keys to orange-red.
|
||||
c # Commit changes.
|
||||
'';
|
||||
|
||||
}
|
||||
|
@@ -180,8 +180,6 @@
|
||||
rfd
|
||||
srv
|
||||
vpngate
|
||||
g810-led
|
||||
|
||||
];
|
||||
in common;
|
||||
|
||||
|
@@ -1,57 +0,0 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
|
||||
let cfg = config.hardware.g810-led;
|
||||
in {
|
||||
options.hardware.g810-led = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to apply a g810-led profile when a compatible keyboard
|
||||
is connected.
|
||||
'';
|
||||
};
|
||||
|
||||
profile = mkOption {
|
||||
type = types.path;
|
||||
description = ''
|
||||
The profile file to be applied, samples can be found at:
|
||||
https://github.com/MatMoul/g810-led/tree/master/sample_profiles
|
||||
'';
|
||||
};
|
||||
|
||||
enableFlashingWorkaround = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = ''
|
||||
Whether to turn off all LEDs on shutdown and reboot.
|
||||
Enable this if your keyboard flashes 3 times on boot.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
||||
services.udev.packages =
|
||||
[ (pkgs.g810-led.override { profile = cfg.profile; }) ];
|
||||
|
||||
# Workaround mentioned here:
|
||||
# https://github.com/MatMoul/g810-led/blob/14e331ad2ab7c5ffb546e0c14dd6164b517ff9ca/PROFILES.md
|
||||
systemd.services.g810-led-workaround = mkIf cfg.enableFlashingWorkaround {
|
||||
description = "Turn off all leds";
|
||||
script = "${pkgs.g810-led}/bin/g610-led -a 000000";
|
||||
|
||||
serviceConfig.Type = "oneshot";
|
||||
unitConfig.DefaultDependencies = false;
|
||||
|
||||
wantedBy = [ "shutdown.target" ];
|
||||
before = [ "shutdown.target" "reboot.target" "halt.target" ];
|
||||
};
|
||||
};
|
||||
|
||||
meta.maintainers = [ maintainers.davegallant ];
|
||||
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
final: prev: {
|
||||
|
||||
g810-led = prev.callPackage ./g810-led { };
|
||||
lpass = prev.callPackage ./lastpass { };
|
||||
rfd = prev.callPackage ./rfd { };
|
||||
srv = prev.callPackage ./srv { };
|
||||
|
@@ -1,47 +0,0 @@
|
||||
{ stdenv, lib, fetchFromGitHub, hidapi, profile ? "/etc/g810-led/profile" }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "g810-led";
|
||||
version = "0.4.2";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "MatMoul";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
hash = "sha256-FFaOGRLk9wCQ+Xkf/KacXF3rOrvg8xSyeDEwe+K5s/o=";
|
||||
};
|
||||
|
||||
buildInputs = [ hidapi ];
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
install -D bin/g810-led $out/bin/g810-led
|
||||
ln -s \./g810-led $out/bin/g213-led
|
||||
ln -s \./g810-led $out/bin/g410-led
|
||||
ln -s \./g810-led $out/bin/g413-led
|
||||
ln -s \./g810-led $out/bin/g512-led
|
||||
ln -s \./g810-led $out/bin/g513-led
|
||||
ln -s \./g810-led $out/bin/g610-led
|
||||
ln -s \./g810-led $out/bin/g815-led
|
||||
ln -s \./g810-led $out/bin/g910-led
|
||||
ln -s \./g810-led $out/bin/gpro-led
|
||||
|
||||
substituteInPlace udev/g810-led.rules \
|
||||
--replace "/usr" $out \
|
||||
--replace "/etc/g810-led/profile" "${profile}"
|
||||
install -D udev/g810-led.rules $out/etc/udev/rules.d/90-g810-led.rules
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description =
|
||||
"Linux LED controller for Logitech G213, G410, G413, G512, G513, G610, G810, G815, G910 and GPRO Keyboards";
|
||||
inherit (src.meta) homepage;
|
||||
license = licenses.gpl3;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ davegallant ];
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user