From 4551e5134e7170bab00fd7dbf18bf7fb08e9faa7 Mon Sep 17 00:00:00 2001 From: "Thomas G. Lopes" Date: Wed, 25 Mar 2026 12:41:52 +0000 Subject: [PATCH] integrate gsf via flake input and hardware.gsf module --- flake.lock | 71 ++++++++++++++++++++++++++++++++++++++++- flake.nix | 1 + modules/hosts/nixos.nix | 19 ++++------- 3 files changed, 78 insertions(+), 13 deletions(-) diff --git a/flake.lock b/flake.lock index b2bd84d..1ecfb74 100644 --- a/flake.lock +++ b/flake.lock @@ -63,6 +63,43 @@ "type": "github" } }, + "flake-utils": { + "inputs": { + "systems": "systems_2" + }, + "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" + } + }, + "gsf": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1774443741, + "narHash": "sha256-93//BYjZ+5Hs8sqSHDa3TkJIsCgOZ/MayzQA+1y7VCE=", + "ref": "refs/heads/main", + "rev": "af9f3e3567db16a885f716fa0b09b6c1bbb527af", + "revCount": 7, + "type": "git", + "url": "https://gitea.unrail.xyz/thomas/gotta-scroll-fast" + }, + "original": { + "type": "git", + "url": "https://gitea.unrail.xyz/thomas/gotta-scroll-fast" + } + }, "home-manager": { "inputs": { "nixpkgs": [ @@ -131,6 +168,22 @@ } }, "nixpkgs_2": { + "locked": { + "lastModified": 1774106199, + "narHash": "sha256-US5Tda2sKmjrg2lNHQL3jRQ6p96cgfWh3J1QBliQ8Ws=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "6c9a78c09ff4d6c21d0319114873508a6ec01655", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { "locked": { "lastModified": 1773821835, "narHash": "sha256-TJ3lSQtW0E2JrznGVm8hOQGVpXjJyXY2guAxku2O9A4=", @@ -150,9 +203,10 @@ "inputs": { "agenix": "agenix", "flake-parts": "flake-parts", + "gsf": "gsf", "import-tree": "import-tree", "maccel": "maccel", - "nixpkgs": "nixpkgs_2" + "nixpkgs": "nixpkgs_3" } }, "systems": { @@ -169,6 +223,21 @@ "repo": "default", "type": "github" } + }, + "systems_2": { + "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 be5fa21..1f15574 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,7 @@ import-tree.url = "github:vic/import-tree"; agenix.url = "github:ryantm/agenix"; maccel.url = "github:Gnarus-G/maccel"; + gsf.url = "git+https://gitea.unrail.xyz/thomas/gotta-scroll-fast"; }; outputs = diff --git a/modules/hosts/nixos.nix b/modules/hosts/nixos.nix index 3fc15af..a4a9146 100644 --- a/modules/hosts/nixos.nix +++ b/modules/hosts/nixos.nix @@ -14,10 +14,13 @@ in { }: let smbSecretFile = ../../secrets/smb-credentials.age; hasSmbSecret = builtins.pathExists smbSecretFile; + + gsfDevice = "/dev/input/by-id/usb-Ploopy_Corporation_Ploopy_Adept_Trackball_E6626067D39C532A0000000000000000-if02-event-mouse"; in { imports = [ inputs.agenix.nixosModules.default inputs.maccel.nixosModules.default + inputs.gsf.nixosModules.default ../../hardware-configuration.nix ]; @@ -102,18 +105,10 @@ in { enableCli = true; }; - # Dotfile-managed maccel settings: place an executable script at - # ~/.config/maccel/apply.sh with your preferred `maccel set ...` commands. - systemd.user.services.maccel-apply-dotfiles = { - description = "apply maccel params from ~/.config/maccel/apply.sh"; - wantedBy = ["default.target"]; - after = ["default.target"]; - serviceConfig = { - Type = "oneshot"; - ExecStart = '' - ${pkgs.bash}/bin/bash -lc 'PATH=/run/current-system/sw/bin:$PATH; if [ -x "$HOME/.config/maccel/apply.sh" ]; then "$HOME/.config/maccel/apply.sh"; fi' - ''; - }; + hardware.gsf = { + enable = true; + device = gsfDevice; + inputGroupUsers = [flakeConfig.username]; }; # Programs