summary refs log tree commit diff
path: root/pkgs/applications/window-managers
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2023-09-24 16:58:00 -0300
committerAnderson Torres <torres.anderson.85@protonmail.com>2023-09-26 12:13:10 -0300
commitcfa3f193918413bd6d7a09161529bd2e35d27e11 (patch)
tree27b4f3a1b187439559283aba34c33e2dfaca6af6 /pkgs/applications/window-managers
parent252688892fde6cbb394b6e63e17e91b0892629f8 (diff)
downloadnixpkgs-cfa3f193918413bd6d7a09161529bd2e35d27e11.tar
nixpkgs-cfa3f193918413bd6d7a09161529bd2e35d27e11.tar.gz
nixpkgs-cfa3f193918413bd6d7a09161529bd2e35d27e11.tar.bz2
nixpkgs-cfa3f193918413bd6d7a09161529bd2e35d27e11.tar.lz
nixpkgs-cfa3f193918413bd6d7a09161529bd2e35d27e11.tar.xz
nixpkgs-cfa3f193918413bd6d7a09161529bd2e35d27e11.tar.zst
nixpkgs-cfa3f193918413bd6d7a09161529bd2e35d27e11.zip
notion: refactor
- finalAttrs
- strictDeps
- split output
- meta.mainProgram
Diffstat (limited to 'pkgs/applications/window-managers')
-rw-r--r--pkgs/applications/window-managers/notion/default.nix80
1 files changed, 61 insertions, 19 deletions
diff --git a/pkgs/applications/window-managers/notion/default.nix b/pkgs/applications/window-managers/notion/default.nix
index d4ae41134eb..9ee84b130bf 100644
--- a/pkgs/applications/window-managers/notion/default.nix
+++ b/pkgs/applications/window-managers/notion/default.nix
@@ -1,19 +1,33 @@
-{ lib, stdenv, fetchFromGitHub, pkg-config
-, lua, gettext, which, groff, xmessage, xterm
-, readline, fontconfig, libX11, libXext, libSM
-, libXinerama, libXrandr, libXft
+{ lib
+, stdenv
+, fetchFromGitHub
+, fontconfig
+, gettext
+, groff
+, libSM
+, libX11
+, libXext
+, libXft
+, libXinerama
+, libXrandr
+, lua
 , makeWrapper
+, pkg-config
+, readline
+, which
+, xmessage
+, xterm
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "notion";
   version = "4.0.2";
 
   src = fetchFromGitHub {
     owner = "raboof";
-    repo = pname;
-    rev = version;
-    sha256 = "14swd0yqci8lxn259fkd9w92bgyf4rmjwgvgyqp78wlfix6ai4mv";
+    repo = "notion";
+    rev = finalAttrs.version;
+    hash = "sha256-u5KoTI+OcnQu9m8/Lmsmzr8lEk9tulSE7RRFhj1oXJM=";
   };
 
   # error: 'PATH_MAX' undeclared
@@ -21,24 +35,52 @@ stdenv.mkDerivation rec {
     sed 1i'#include <linux/limits.h>' -i mod_notionflux/notionflux/notionflux.c
   '';
 
-  nativeBuildInputs = [ pkg-config makeWrapper groff ];
-  buildInputs = [ lua gettext which readline fontconfig libX11 libXext libSM
-                  libXinerama libXrandr libXft ];
+  nativeBuildInputs = [
+    gettext
+    groff
+    lua
+    makeWrapper
+    pkg-config
+    which
+  ];
 
-  buildFlags = [ "LUA_DIR=${lua}" "X11_PREFIX=/no-such-path" ];
+  buildInputs = [
+    fontconfig
+    libSM
+    libX11
+    libXext
+    libXft
+    libXinerama
+    libXrandr
+    lua
+    readline
+  ];
 
-  makeFlags = [ "NOTION_RELEASE=${version}" "PREFIX=\${out}" ];
+  outputs = [ "out" "man" ];
+
+  strictDeps = true;
+
+  buildFlags = [
+    "LUA_DIR=${lua}"
+    "X11_PREFIX=/no-such-path"
+  ];
+
+  makeFlags = [
+    "NOTION_RELEASE=${finalAttrs.version}"
+    "PREFIX=${placeholder "out"}"
+  ];
 
   postInstall = ''
     wrapProgram $out/bin/notion \
-      --prefix PATH ":" "${xmessage}/bin:${xterm}/bin" \
+      --prefix PATH ":" "${lib.makeBinPath [ xmessage xterm ]}" \
   '';
 
-  meta = with lib; {
+  meta = {
     description = "Tiling tabbed window manager";
     homepage = "https://notionwm.net";
-    license   = licenses.lgpl21;
-    maintainers = with maintainers; [ jfb AndersonTorres raboof ];
-    platforms = platforms.linux;
+    license = lib.licenses.lgpl21;
+    mainProgram = "notion";
+    maintainers = with lib.maintainers; [ jfb AndersonTorres raboof ];
+    platforms = lib.platforms.linux;
   };
-}
+})