diff --git a/flake.lock b/flake.lock index 77eeddf..bba6b62 100644 --- a/flake.lock +++ b/flake.lock @@ -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": { diff --git a/flake.nix b/flake.nix index a79f38b..34fd2cc 100644 --- a/flake.nix +++ b/flake.nix @@ -51,7 +51,6 @@ modules = [ ./machines/hephaestus/configuration.nix ./machines/hephaestus/hardware.nix - ./modules/g810-led.nix ] ++ defaultModules; }; hermes = nixpkgs.lib.nixosSystem { diff --git a/machines/hephaestus/configuration.nix b/machines/hephaestus/configuration.nix index 1e69901..2336610 100644 --- a/machines/hephaestus/configuration.nix +++ b/machines/hephaestus/configuration.nix @@ -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" ]; - }; - } diff --git a/machines/hephaestus/hardware.nix b/machines/hephaestus/hardware.nix index 33bacc7..6cbeda6 100644 --- a/machines/hephaestus/hardware.nix +++ b/machines/hephaestus/hardware.nix @@ -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. - ''; - } diff --git a/main/packages.nix b/main/packages.nix index 6c0c7e5..f7c3842 100644 --- a/main/packages.nix +++ b/main/packages.nix @@ -180,8 +180,6 @@ rfd srv vpngate - g810-led - ]; in common; diff --git a/modules/g810-led.nix b/modules/g810-led.nix deleted file mode 100644 index d4a5e61..0000000 --- a/modules/g810-led.nix +++ /dev/null @@ -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 ]; - -} - diff --git a/overlays/default.nix b/overlays/default.nix index c5f2896..ba4e7c3 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -1,6 +1,5 @@ final: prev: { - g810-led = prev.callPackage ./g810-led { }; lpass = prev.callPackage ./lastpass { }; rfd = prev.callPackage ./rfd { }; srv = prev.callPackage ./srv { }; diff --git a/overlays/g810-led/default.nix b/overlays/g810-led/default.nix deleted file mode 100644 index 5cdcc0b..0000000 --- a/overlays/g810-led/default.nix +++ /dev/null @@ -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 ]; - }; -} -