Commit f1cfca085735

Vincent Demeester <vincent@sbr.pm>
2025-12-05 14:29:50
refactor(pkgs): align 4 packages with nixpkgs best practices
- Enable package discoverability with complete metadata sections - Remove deprecated phases and builder patterns for future compatibility - Establish foundation for potential nixpkgs contribution Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent aa02df0
Changed files (4)
pkgs
govanityurl
my
systemd-email
tools
battery-monitor
pkgs/govanityurl/default.nix
@@ -1,8 +1,11 @@
-{ buildGoModule, fetchgit }:
+{
+  buildGoModule,
+  fetchgit,
+  lib,
+}:
 
 buildGoModule rec {
   pname = "govanityurl";
-  name = "${pname}-${version}";
   version = "0.1.0";
 
   src = fetchgit {
@@ -11,4 +14,13 @@ buildGoModule rec {
     sha256 = "sha256-7AdNbbIcNSPRAi8u0+2b/Lscq4MFXci0+WeND8wZkhU=";
   };
   vendorHash = "sha256-qe7SxvrmgbcUnBUbUVx/l3hLZ1BRHZyDgi8tLtULCms=";
+
+  meta = with lib; {
+    description = "Go vanity URL server for custom import paths";
+    homepage = "https://git.sr.ht/~vdemeester/vanityurl";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ vdemeester ];
+    platforms = platforms.unix;
+    mainProgram = "govanityurl";
+  };
 }
pkgs/my/vrsync/default.nix
@@ -1,14 +1,31 @@
-{ stdenv }:
+{
+  stdenv,
+  lib,
+}:
 
 stdenv.mkDerivation rec {
-  name = "vrsync";
+  pname = "vrsync";
+  version = "0.1.0";
+
   src = ./.;
 
-  phases = [ "install" ];
+  dontUnpack = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
 
-  install = ''
     mkdir -p $out/bin
     cp $src/vrsync $out/bin
     chmod +x $out/bin/vrsync
+
+    runHook postInstall
   '';
+
+  meta = with lib; {
+    description = "Vincent's rsync wrapper utility";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    mainProgram = "vrsync";
+  };
 }
pkgs/systemd-email/default.nix
@@ -1,14 +1,31 @@
-{ stdenv }:
+{
+  stdenv,
+  lib,
+}:
 
 stdenv.mkDerivation rec {
-  name = "systemd-email";
+  pname = "systemd-email";
+  version = "0.1.0";
+
   src = ./.;
 
-  phases = [ "install" ];
+  dontUnpack = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
 
-  install = ''
     mkdir -p $out/bin
     cp $src/systemd-email $out/bin
     chmod +x $out/bin/systemd-email
+
+    runHook postInstall
   '';
+
+  meta = with lib; {
+    description = "Systemd service for sending email notifications on service failures";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    mainProgram = "systemd-email";
+  };
 }
tools/battery-monitor/default.nix
@@ -1,8 +1,20 @@
-{ buildGoModule }:
+{
+  buildGoModule,
+  lib,
+}:
 
 buildGoModule rec {
-  name = "battery-monitor";
+  pname = "battery-monitor";
+  version = "0.1.0";
+
   src = ./.;
-  # vendorHash = null;
+
   vendorHash = "sha256-K9lqUdIR2EpLEQMTrlv6bGj3IpwK/yaFCqY7S7nuXg4=";
+
+  meta = with lib; {
+    description = "Battery monitoring tool for laptops";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    mainProgram = "battery-monitor";
+  };
 }