From 1d5194c43213e0ca54e0e720dd49e6a05edb7f67 Mon Sep 17 00:00:00 2001 From: Devin Droddy Date: Thu, 19 Sep 2024 14:29:54 -0400 Subject: [PATCH] finally properly wrap program with crane --- flake.nix | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/flake.nix b/flake.nix index 336f1c0..9cce9d6 100644 --- a/flake.nix +++ b/flake.nix @@ -72,24 +72,7 @@ pkgs.libiconv ]; - nativeBuildInputs = with pkgs; [copyDesktopItems pkg-config]; - - desktopItems = [ - (pkgs.makeDesktopItem { - name = "NuhxBoard"; - desktopName = "NuhxBoard"; - comment = "Cross-platform input visualizer"; - icon = "NuhxBoard"; - exec = "nuhxboard"; - terminal = false; - keywords = ["Keyboard"]; - startupWMClass = "NuhxBoard"; - }) - ]; - - postInstall = '' - install -Dm644 ${src}/NuhxBoard.png $out/share/icons/hicolor/128x128/apps/NuhxBoard.png - ''; + nativeBuildInputs = with pkgs; [copyDesktopItems pkg-config makeWrapper]; }; craneLibLLvmTools = @@ -109,6 +92,25 @@ nuhxboard = craneLib.buildPackage (commonArgs // { inherit cargoArtifacts; + } + // { + desktopItems = [ + (pkgs.makeDesktopItem { + name = "NuhxBoard"; + desktopName = "NuhxBoard"; + comment = "Cross-platform input visualizer"; + icon = "NuhxBoard"; + exec = "nuhxboard"; + terminal = false; + keywords = ["Keyboard"]; + startupWMClass = "NuhxBoard"; + }) + ]; + + postInstall = '' + install -Dm644 ${src}/NuhxBoard.png $out/share/icons/hicolor/128x128/apps/NuhxBoard.png + wrapProgram $out/bin/nuhxboard --set PATH "${pkgs.lib.makeBinPath commonArgs.buildInputs}" + ''; }); in { checks = {