about summary refs log tree commit diff
path: root/pkgs/tools/audio
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-07-23 21:36:25 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-08-05 11:10:50 +0000
commitd695b7ef5b3fbd6d56630d58d819d54f1dcc8dfe (patch)
tree079ba5d8d14567233de02aeed06f62fb0b749200 /pkgs/tools/audio
parent393a936719234557d2cfbec0b6016c800600687d (diff)
linuxwave: use zigHook
Also, a cosmetic refactor:

- Reorder parameter listing
- Use rec-less, overlay-style overridable recursive attributes (in effect since
NixOS#119942);
- Remove nested with (according to
https://nix.dev/recipes/best-practices#with-scopes)
Diffstat (limited to 'pkgs/tools/audio')
-rw-r--r--pkgs/tools/audio/linuxwave/default.nix52
1 files changed, 13 insertions, 39 deletions
diff --git a/pkgs/tools/audio/linuxwave/default.nix b/pkgs/tools/audio/linuxwave/default.nix
index 5d01416661517..213a409098866 100644
--- a/pkgs/tools/audio/linuxwave/default.nix
+++ b/pkgs/tools/audio/linuxwave/default.nix
@@ -2,62 +2,36 @@
 , stdenv
 , fetchFromGitHub
 , installShellFiles
-, zig
+, zigHook
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "linuxwave";
   version = "0.1.5";
 
   src = fetchFromGitHub {
     owner = "orhun";
     repo = "linuxwave";
-    rev = "v${version}";
-    hash = "sha256-5c8h9bAe3Qv7PJ3PPcwMJYKPlWsmnqshe6vLIgtdDiQ=";
+    rev = "v${finalAttrs.version}";
     fetchSubmodules = true;
+    hash = "sha256-5c8h9bAe3Qv7PJ3PPcwMJYKPlWsmnqshe6vLIgtdDiQ=";
   };
 
   nativeBuildInputs = [
     installShellFiles
-    zig
+    zigHook
   ];
 
-  postConfigure = ''
-    export XDG_CACHE_HOME=$(mktemp -d)
-  '';
-
-  buildPhase = ''
-    runHook preBuild
-
-    zig build -Drelease-safe -Dcpu=baseline
-
-    runHook postBuild
-  '';
-
-  checkPhase = ''
-    runHook preCheck
-
-    zig build test
-
-    runHook postCheck
-  '';
-
-  installPhase = ''
-    runHook preInstall
-
-    zig build -Drelease-safe -Dcpu=baseline --prefix $out install
-
+  postInstall = ''
     installManPage man/linuxwave.1
-
-    runHook postInstall
   '';
 
-  meta = with lib; {
-    description = "Generate music from the entropy of Linux";
+  meta = {
     homepage = "https://github.com/orhun/linuxwave";
-    changelog = "https://github.com/orhun/linuxwave/blob/${src.rev}/CHANGELOG.md";
-    license = licenses.mit;
-    maintainers = with maintainers; [ figsoda ];
-    platforms = platforms.all;
+    description = "Generate music from the entropy of Linux";
+    changelog = "https://github.com/orhun/linuxwave/blob/${finalAttrs.src.rev}/CHANGELOG.md";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ figsoda ];
+    inherit (zigHook.meta) platforms;
   };
-}
+})