Commit 245d2ce7 authored by Guy Chronister's avatar Guy Chronister
Browse files

yubikey-touch-detector: clean up source and meta attributes

- Use `tag = version;` instead of `rev = version;` in `fetchFromGitHub`
  for clarity and correctness.
- Inline pname in install paths (`share/doc/yubikey-touch-detector`,
  `share/licenses/yubikey-touch-detector`) instead of string interpolation.
- Drop `with lib;` in `meta`, qualify attributes explicitly:
  - `maintainers = with lib.maintainers; [...]`
  - `license = lib.licenses.isc;`
  - `platforms = lib.platforms.linux;`

Improves scope hygiene, reproducibility, and consistency with
current Nixpkgs conventions.
parent 87bc6308
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -16,7 +16,7 @@ buildGoModule rec {
  src = fetchFromGitHub {
    owner = "maximbaz";
    repo = "yubikey-touch-detector";
    rev = version;
    tag = version;
    hash = "sha256-aHR/y8rAKS+dMvRdB3oAmOiI7hTA6qlF4Z05OjwYOO4=";
  };
  vendorHash = "sha256-oHEcpu3QvcVC/YCtGtP7nNT9++BSU8BPT5pf8NdLrOo=";
@@ -33,9 +33,9 @@ buildGoModule rec {
  ];

  postInstall = ''
    install -Dm444 -t $out/share/doc/${pname} *.{md,example}
    install -Dm444 -t $out/share/doc/yubikey-touch-detector *.{md,example}

    install -Dm444 -t $out/share/licenses/${pname} LICENSE
    install -Dm444 -t $out/share/licenses/yubikey-touch-detector LICENSE

    install -Dm444 -t $out/share/icons/hicolor/128x128/apps yubikey-touch-detector.png

@@ -48,12 +48,12 @@ buildGoModule rec {
    installManPage yubikey-touch-detector.1
  '';

  meta = with lib; {
  meta = {
    description = "Tool to detect when your YubiKey is waiting for a touch";
    homepage = "https://github.com/maximbaz/yubikey-touch-detector";
    maintainers = with maintainers; [ sumnerevans ];
    license = licenses.isc;
    platforms = platforms.linux;
    maintainers = with lib.maintainers; [ sumnerevans ];
    license = lib.licenses.isc;
    platforms = lib.platforms.linux;
    mainProgram = "yubikey-touch-detector";
  };
}