summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2025-06-06 00:53:57 +0200
committerMel <mel@rnrd.eu>2025-06-06 00:53:57 +0200
commit5948bab4ec817e5887fed9fa375da81207560794 (patch)
treef170ce380421cbffe0f1e2e30d82131c16b257e8
parent1b6875c312bf5a0a2444b8c086a7d12d087511eb (diff)
downloadminerals-5948bab4ec817e5887fed9fa375da81207560794.tar.zst
minerals-5948bab4ec817e5887fed9fa375da81207560794.zip
Patch yubikey-touch-detector for better message and icon
Signed-off-by: Mel <mel@rnrd.eu>
-rw-r--r--flake.nix1
-rw-r--r--modules/hardware-keys.nix20
-rw-r--r--overlay.nix7
-rw-r--r--pkgs/default.nix2
-rw-r--r--pkgs/yubikey-touch-detector/default.nix14
-rw-r--r--pkgs/yubikey-touch-detector/touch.svg18
-rw-r--r--pkgs/yubikey-touch-detector/yubikey-touch-detector.patch16
7 files changed, 72 insertions, 6 deletions
diff --git a/flake.nix b/flake.nix
index 9266056..488b814 100644
--- a/flake.nix
+++ b/flake.nix
@@ -57,6 +57,7 @@
agenix.overlays.default
nix-vscode-extensions.overlays.default
nixpkgs-esp-dev.overlays.default
+ (import ./overlay.nix)
];
packageSets =
diff --git a/modules/hardware-keys.nix b/modules/hardware-keys.nix
index e6ae089..f101964 100644
--- a/modules/hardware-keys.nix
+++ b/modules/hardware-keys.nix
@@ -15,15 +15,23 @@
# see `modules/home/yubikeys.nix` for the YubiKey
# universal second factor (u2f) configuration file.
security = {
- pam.services = {
- login.u2fAuth = true;
- sudo.u2fAuth = true;
+ pam = {
+ services = {
+ login.u2fAuth = true;
+ sudo.u2fAuth = true;
+ };
+
+ mount.enable = true;
};
};
environment.systemPackages = with pkgs; [
- yubikey-manager yubikey-manager-qt
- yubikey-personalization yubikey-personalization-gui
- age-plugin-yubikey pam_u2f
+ yubikey-manager
+ yubikey-manager-qt
+ yubikey-personalization
+ yubikey-personalization-gui
+ yubikey-touch-detector # install icon
+ age-plugin-yubikey
+ pam_u2f
];
}
diff --git a/overlay.nix b/overlay.nix
new file mode 100644
index 0000000..1eccde6
--- /dev/null
+++ b/overlay.nix
@@ -0,0 +1,7 @@
+final: prev:
+
+{
+ yubikey-touch-detector = import ./pkgs/yubikey-touch-detector {
+ inherit (prev) yubikey-touch-detector;
+ };
+}
diff --git a/pkgs/default.nix b/pkgs/default.nix
index 642ebc9..ddaf684 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -16,4 +16,6 @@
youcompleteme = pkgs.callPackage ./youcompleteme.nix { };
wine = pkgs.callPackage ./wine.nix { };
+
+ yubikey-touch-detector = pkgs.callPackage ./yubikey-touch-detector { };
}
diff --git a/pkgs/yubikey-touch-detector/default.nix b/pkgs/yubikey-touch-detector/default.nix
new file mode 100644
index 0000000..a1642ec
--- /dev/null
+++ b/pkgs/yubikey-touch-detector/default.nix
@@ -0,0 +1,14 @@
+{ yubikey-touch-detector, ... }:
+
+yubikey-touch-detector.overrideAttrs (attrs: {
+ patches = [ ./yubikey-touch-detector.patch ];
+
+ postInstall =
+ (attrs.postInstall or "")
+ + ''
+ rm $out/share/icons/hicolor/128x128/apps/yubikey-touch-detector.png
+
+ install -Dm444 -T ${./touch.svg} \
+ $out/share/icons/hicolor/scalable/apps/yubikey-touch-symbolic.svg
+ '';
+})
diff --git a/pkgs/yubikey-touch-detector/touch.svg b/pkgs/yubikey-touch-detector/touch.svg
new file mode 100644
index 0000000..739730d
--- /dev/null
+++ b/pkgs/yubikey-touch-detector/touch.svg
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ fill="#284c61"
+ width="24"
+ height="24"
+ viewBox="0 0 24 24"
+ version="1.1"
+ id="svg1"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <defs
+ id="defs1" />
+ <path
+ d="M 8.2857129,9.417143 V 5.1428571 c 0,-1.5771428 1.2800001,-2.8571428 2.8571431,-2.8571428 1.577143,0 2.857143,1.28 2.857143,2.8571428 V 9.417143 C 15.382856,8.491429 16.285713,6.9257143 16.285713,5.1428571 16.285713,2.2971429 13.98857,0 11.142856,0 8.2971414,0 5.9999986,2.2971429 5.9999986,5.1428571 c 0,1.7828572 0.9028571,3.3485719 2.2857143,4.2742859 z M 19.531427,14.708571 14.342856,12.125714 C 14.14857,12.045714 13.942856,12 13.725713,12 H 12.857141 V 5.1428571 c 0,-0.9485714 -0.765714,-1.7142857 -1.714285,-1.7142857 -0.948572,0 -1.714286,0.7657143 -1.714286,1.7142857 V 17.417143 l -3.92,-0.822857 C 5.4171414,16.582857 5.3371414,16.56 5.2342843,16.56 c -0.3542857,0 -0.6742857,0.148571 -0.9028572,0.377143 L 3.42857,17.851429 9.074284,23.497143 C 9.382856,23.805714 9.817141,24 10.285713,24 h 7.76 c 0.857143,0 1.52,-0.628571 1.645714,-1.462857 l 0.857143,-6.022857 c 0.01143,-0.08 0.02286,-0.16 0.02286,-0.228572 0,-0.708571 -0.434286,-1.325714 -1.04,-1.577143 z"
+ clip-path="url(#b)"
+ id="path1"
+ style="fill:#222222;fill-opacity:1;stroke-width:1.14286" />
+</svg>
diff --git a/pkgs/yubikey-touch-detector/yubikey-touch-detector.patch b/pkgs/yubikey-touch-detector/yubikey-touch-detector.patch
new file mode 100644
index 0000000..084874a
--- /dev/null
+++ b/pkgs/yubikey-touch-detector/yubikey-touch-detector.patch
@@ -0,0 +1,16 @@
+--- a/notifier/libnotify.go
++++ b/notifier/libnotify.go
+@@ -32,9 +32,10 @@ func SetupLibnotifyNotifier(notifiers *sync.Map) {
+ }
+
+ notification := notify.Notification{
+- AppName: "yubikey-touch-detector",
+- AppIcon: "yubikey-touch-detector",
+- Summary: "YubiKey is waiting for a touch",
++ AppName: "YubiKey",
++ AppIcon: "yubikey-touch-symbolic",
++ Summary: "Waiting for touch",
++ Body: "Confirm presence by touching your YubiKey.",
+ }
+
+ reset := func(msg *notify.NotificationClosedSignal) {