From d9b9d82231bd1acf6a98473185c786bd89dd021b Mon Sep 17 00:00:00 2001 From: Roman Lubij Date: Fri, 26 Dec 2025 02:35:27 +0100 Subject: [PATCH] Add Logitech support --- configuration.nix | 4 ++ flake.lock | 112 +++++++++++++++++++++++++++----- flake.nix | 37 +++++++---- flakes/czkawka-master/flake.nix | 15 +++-- flakes/solaar-master/flake.nix | 77 ++++++++++++++++++++++ modules/gnome.nix | 1 + modules/packages.nix | 5 ++ 7 files changed, 220 insertions(+), 31 deletions(-) create mode 100644 flakes/solaar-master/flake.nix diff --git a/configuration.nix b/configuration.nix index 1022a47..536f11c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -191,6 +191,10 @@ ]; }; amdgpu.opencl.enable = true; # ROCM + logitech.wireless = { + enable = true; + enableGraphical = true; + }; }; # QT stuff diff --git a/flake.lock b/flake.lock index 90d2b3e..4b0440d 100644 --- a/flake.lock +++ b/flake.lock @@ -7,24 +7,23 @@ "nixpkgs": "nixpkgs" }, "locked": { - "lastModified": 1766316793, - "narHash": "sha256-ztYm8+juiptYvtU6V4FDj/k9CFD/OIIz7O5BdJfGVSs=", - "path": "/etc/nixos/flakes/czkawka-master", + "path": "./flakes/czkawka-master", "type": "path" }, "original": { - "path": "/etc/nixos/flakes/czkawka-master", + "path": "./flakes/czkawka-master", "type": "path" - } + }, + "parent": [] }, "czkawka-src": { "flake": false, "locked": { - "lastModified": 1764796329, - "narHash": "sha256-legzp0mmNgKz9dw7rpnkAXXYjW3BFur8e+W7289bHI8=", + "lastModified": 1766584193, + "narHash": "sha256-XmdV0/lc4JvnIoSxf7PtQZlHHZo3ghgGfJ0tWbhYuAQ=", "owner": "qarmin", "repo": "czkawka", - "rev": "6296b06f3a6798f07f78cd771ed95d75639f7bbb", + "rev": "dcec058b682f803ff70b03959cc67b146837b2a3", "type": "github" }, "original": { @@ -56,6 +55,24 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "naersk": { "inputs": { "fenix": "fenix", @@ -95,11 +112,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1766070988, - "narHash": "sha256-G/WVghka6c4bAzMhTwT2vjLccg/awmHkdKSd2JrycLc=", + "lastModified": 1766651565, + "narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "c6245e83d836d0433170a16eb185cefe0572f8b8", + "rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539", "type": "github" }, "original": { @@ -111,11 +128,11 @@ }, "nixpkgs_2": { "locked": { - "lastModified": 1766254170, - "narHash": "sha256-Svhx9lHB3wvxDu9UtxilofG3PZqKvfwUzarSIvuGO5g=", + "lastModified": 1766687550, + "narHash": "sha256-FGuhrdRvxp3DZfRZfA+1mKZIpgTU9Xboq1jVphKm9Go=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "cab52b36dca5a5a368f05bd03fca0b543b5b9a3e", + "rev": "a3a2ddee4adfb361bdfe2e915c7e85c2e71cfc5f", "type": "github" }, "original": { @@ -125,11 +142,28 @@ "type": "github" } }, + "nixpkgs_3": { + "locked": { + "lastModified": 1766651565, + "narHash": "sha256-QEhk0eXgyIqTpJ/ehZKg9IKS7EtlWxF3N7DXy42zPfU=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e2499d5539c16d0d173ba53552a4ff8547f4539", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { "czkawka-master": "czkawka-master", "nix-flatpak": "nix-flatpak", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_2", + "solaar-master": "solaar-master" } }, "rust-analyzer-src": { @@ -148,6 +182,54 @@ "repo": "rust-analyzer", "type": "github" } + }, + "solaar-master": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_3", + "solaar-src": "solaar-src" + }, + "locked": { + "path": "./flakes/solaar-master", + "type": "path" + }, + "original": { + "path": "./flakes/solaar-master", + "type": "path" + }, + "parent": [] + }, + "solaar-src": { + "flake": false, + "locked": { + "lastModified": 1766581864, + "narHash": "sha256-T07YtSuo+R8Bsvl+lCQC7/gpXKwch8hTp9fJlbuAHVE=", + "owner": "pwr-Solaar", + "repo": "Solaar", + "rev": "c87730f1ebfbd7ce4956c672a1a3227dc0694042", + "type": "github" + }, + "original": { + "owner": "pwr-Solaar", + "ref": "master", + "repo": "Solaar", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 31f9d29..c708299 100644 --- a/flake.nix +++ b/flake.nix @@ -7,19 +7,32 @@ inputs.nixpkgs.follows = "nixpkgs"; }; - czkawka-master.url = "path:/etc/nixos/flakes/czkawka-master"; + czkawka-master.url = "path:./flakes/czkawka-master"; + solaar-master.url = "path:./flakes/solaar-master"; }; - outputs = { self, nixpkgs, nix-flatpak, czkawka-master, ... }: { - nixosConfigurations = { - epiquev2 = nixpkgs.lib.nixosSystem { - system = "x86_64-linux"; - specialArgs = { inherit czkawka-master; }; - modules = [ - ./configuration.nix - nix-flatpak.nixosModules.nix-flatpak - ]; + outputs = + { + self, + nixpkgs, + nix-flatpak, + czkawka-master, + solaar-master, + ... + }: + { + nixosConfigurations = { + epiquev2 = nixpkgs.lib.nixosSystem { + system = "x86_64-linux"; + specialArgs = { + inherit czkawka-master; + inherit solaar-master; + }; + modules = [ + ./configuration.nix + nix-flatpak.nixosModules.nix-flatpak + ]; + }; }; }; - }; -} \ No newline at end of file +} diff --git a/flakes/czkawka-master/flake.nix b/flakes/czkawka-master/flake.nix index c50fa9a..a92564e 100644 --- a/flakes/czkawka-master/flake.nix +++ b/flakes/czkawka-master/flake.nix @@ -17,7 +17,13 @@ }; }; - outputs = { self, nixpkgs, czkawka-src, naersk }: + outputs = + { + self, + nixpkgs, + czkawka-src, + naersk, + }: let system = "x86_64-linux"; pkgs = import nixpkgs { inherit system; }; @@ -42,7 +48,8 @@ # Optional: libadwaita if the master branch has switched to it ]; - in { + in + { packages.${system}.default = naersk-lib.buildPackage { pname = "czkawka"; version = "master"; @@ -51,7 +58,7 @@ # Add the dependencies inherit nativeBuildInputs buildInputs; - # We need to manually install the desktop files/icons because Naersk + # We need to manually install the desktop files/icons because Naersk # only installs the binaries by default. postInstall = '' install -Dm444 -t $out/share/applications data/com.github.qarmin.czkawka.desktop @@ -66,4 +73,4 @@ inherit nativeBuildInputs buildInputs; }; }; -} \ No newline at end of file +} diff --git a/flakes/solaar-master/flake.nix b/flakes/solaar-master/flake.nix new file mode 100644 index 0000000..8d11cb1 --- /dev/null +++ b/flakes/solaar-master/flake.nix @@ -0,0 +1,77 @@ +{ + description = "Solaar built from GitHub master branch"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + + # This input automatically tracks the latest commit on master + solaar-src = { + url = "github:pwr-Solaar/Solaar/master"; + flake = false; + }; + }; + + outputs = + { + self, + nixpkgs, + flake-utils, + solaar-src, + }: + flake-utils.lib.eachDefaultSystem ( + system: + let + pkgs = nixpkgs.legacyPackages.${system}; + pythonPackages = pkgs.python3Packages; + in + { + packages.default = pythonPackages.buildPythonApplication rec { + pname = "solaar"; + version = "master-${solaar-src.shortRev or "dirty"}"; + + src = solaar-src; + + # --- FIX STARTS HERE --- + # 1. Enable pyproject format + pyproject = true; + + # 2. Add build tools (setuptools/wheel) to nativeBuildInputs + nativeBuildInputs = + with pkgs; + [ + gobject-introspection + wrapGAppsHook3 + pkg-config + ] + ++ (with pythonPackages; [ + setuptools + wheel + ]); + # --- FIX ENDS HERE --- + + propagatedBuildInputs = with pythonPackages; [ + pyudev + psutil + xlib + pyyaml + evdev + dbus-python + pygobject3 + typing-extensions + + pkgs.gtk3 + pkgs.libnotify + pkgs.libayatana-appindicator + ]; + + postInstall = '' + install -Dm644 rules.d/42-logitech-unify-permissions.rules \ + $out/lib/udev/rules.d/42-logitech-unify-permissions.rules + ''; + + doCheck = false; + }; + } + ); +} diff --git a/modules/gnome.nix b/modules/gnome.nix index defd856..7d3996c 100644 --- a/modules/gnome.nix +++ b/modules/gnome.nix @@ -38,6 +38,7 @@ undecorate user-themes window-is-ready-remover + solaar-extension ]; }; } diff --git a/modules/packages.nix b/modules/packages.nix index 19df25e..67bae2c 100644 --- a/modules/packages.nix +++ b/modules/packages.nix @@ -3,6 +3,7 @@ pkgs, lib, czkawka-master, + solaar-master, ... }: @@ -104,6 +105,10 @@ rocmPackages.rocm-smi rocmPackages.rocminfo rquickshare + saber + # solaar + solaar-master.packages.${pkgs.system}.default + logitech-udev-rules scrcpy screen seafile-client