Commit aaba2fe23aa9

Vincent Demeester <vincent@sbr.pm>
2025-12-15 11:55:05
refactor(pkgs): Phase 6 cleanup - align 9 packages with nixpkgs standards
- Ensure all packages have complete metadata for discoverability - Modernize meta patterns to match nixpkgs conventions - Add runHooks to support custom build phases and overlays Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 7dc8ae3
Changed files (8)
pkgs
tools
arr
cliphist-cleanup
download-kiwix-zim
pkgs/chmouzies/ai.nix
@@ -39,9 +39,9 @@ stdenv.mkDerivation {
       runHook postInstall
     '';
 
-  meta = with lib; {
+  meta = {
     description = "Chmouel's AI-assisted git tools";
     homepage = "https://gitlab.com/chmouel/chmouzies";
-    platforms = platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
pkgs/chmouzies/kubernetes.nix
@@ -47,9 +47,9 @@ stdenv.mkDerivation {
       runHook postInstall
     '';
 
-  meta = with lib; {
+  meta = {
     description = "Chmouel's Kubernetes and OpenShift helper scripts";
     homepage = "https://gitlab.com/chmouel/chmouzies";
-    platforms = platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
pkgs/emacs/builder.nix
@@ -16,20 +16,29 @@ stdenv.mkDerivation {
   '';
   buildInputs = [ emacs ] ++ buildInputs;
   buildPhase = ''
+    runHook preBuild
+
     ${preBuild}
     ARGS=$(find ${lib.concatStrings (builtins.map (arg: arg + "/share/emacs/site-lisp ") buildInputs)} \
                  -type d -exec echo -L {} \;)
     mkdir $out
     export HOME=$out
     ${emacs}/bin/emacs -Q -nw -L . $ARGS --batch -f batch-byte-compile *.el
+
+    runHook postBuild
   '';
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/share/emacs/site-lisp
     install *.el* $out/share/emacs/site-lisp
+
+    runHook postInstall
   '';
   meta = {
     description = "Emacs projects from the Internet that just compile .el files";
     homepage = "http://www.emacswiki.org";
+    license = lib.licenses.gpl3Plus; # Emacs packages are typically GPL
     platforms = lib.platforms.all;
   };
 }
pkgs/homepage/default.nix
@@ -243,16 +243,22 @@ stdenv.mkDerivation {
   version = "1.0.0";
 
   dontUnpack = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
 
-  buildPhase = ''
     mkdir -p $out
     cat > $out/index.html << 'EOF'
     ${htmlContent}
     EOF
+
+    runHook postInstall
   '';
 
   meta = {
     description = "Simple HTML homepage listing all services from globals.nix";
+    license = lib.licenses.mit;
     platforms = lib.platforms.all;
   };
 }
pkgs/toggle-color-scheme/default.nix
@@ -1,6 +1,17 @@
-{ writeShellApplication, dconf }:
+{
+  lib,
+  writeShellApplication,
+  dconf,
+}:
 writeShellApplication {
   name = "toggle-color-scheme";
   runtimeInputs = [ dconf ];
   text = builtins.readFile ./toggle-color-scheme.sh;
+
+  meta = {
+    description = "Toggle GNOME color scheme between light and dark with niri integration";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
+    mainProgram = "toggle-color-scheme";
+  };
 }
tools/arr/default.nix
@@ -27,6 +27,8 @@ python3.pkgs.buildPythonApplication {
   dontUsePythonImportsCheck = true;
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/bin $out/lib/arr
 
     # Install the main CLI
@@ -45,6 +47,8 @@ python3.pkgs.buildPythonApplication {
     # Wrap the main script to set PYTHONPATH
     wrapProgram $out/bin/arr \
       --prefix PYTHONPATH : "$out/lib/arr"
+
+    runHook postInstall
   '';
 
   postFixup = ''
@@ -56,13 +60,15 @@ python3.pkgs.buildPythonApplication {
       --zsh <($out/bin/arr completion zsh)
   '';
 
-  meta = with lib; {
+  meta = {
     description = "Unified CLI for managing *arr services (Sonarr, Radarr, Lidarr)";
     longDescription = ''
       arr provides a consistent interface for common operations across
       the *arr media management stack, including renaming, retagging,
       path updates, and Spotify playlist syncing.
     '';
-    platforms = platforms.unix;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+    mainProgram = "arr";
   };
 }
tools/cliphist-cleanup/default.nix
@@ -1,4 +1,7 @@
-{ buildGoModule }:
+{
+  lib,
+  buildGoModule,
+}:
 
 buildGoModule {
   pname = "cliphist-cleanup";
@@ -9,6 +12,8 @@ buildGoModule {
 
   meta = {
     description = "Clean up cliphist clipboard history by pattern matching";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
     mainProgram = "cliphist-cleanup";
   };
 }
tools/download-kiwix-zim/default.nix
@@ -24,6 +24,8 @@ python3.pkgs.buildPythonApplication {
   ];
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/bin
 
     # Install the script
@@ -39,9 +41,11 @@ python3.pkgs.buildPythonApplication {
           wget
         ]
       }
+
+    runHook postInstall
   '';
 
-  meta = with lib; {
+  meta = {
     description = "Browse and download ZIM files from the Kiwix library using fzf";
     longDescription = ''
       Interactive tool to browse the Kiwix catalog and download offline
@@ -49,6 +53,8 @@ python3.pkgs.buildPythonApplication {
       resources. Features multi-select with fzf and parallel downloads
       with aria2c.
     '';
-    platforms = platforms.unix;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+    mainProgram = "download-kiwix-zim";
   };
 }