From 9934b1176678758c74691facb82e5521e129a4be Mon Sep 17 00:00:00 2001 From: h7x4 Date: Sun, 20 Oct 2024 22:51:05 +0200 Subject: [PATCH] nix: use unwrapped program by default in module --- default.nix | 3 ++- flake.nix | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/default.nix b/default.nix index fa8603c..8a45449 100644 --- a/default.nix +++ b/default.nix @@ -4,6 +4,7 @@ , rustPlatform , makeWrapper , mpv +, wrapped ? false }: rustPlatform.buildRustPackage rec { @@ -36,7 +37,7 @@ rustPlatform.buildRustPackage rec { }; }; - postInstall = '' + postInstall = lib.optionalString wrapped '' wrapProgram $out/bin/greg-ng \ --prefix PATH : '${lib.makeBinPath [ mpv ]}' ''; diff --git a/flake.nix b/flake.nix index 09fe8dd..f419785 100644 --- a/flake.nix +++ b/flake.nix @@ -35,7 +35,7 @@ apps = forAllSystems (system: pkgs: _: { default = self.apps.${system}.greg-ng; greg-ng = let - package = self.packages.${system}.greg-ng; + package = self.packages.${system}.greg-ng-wrapped; in { type = "app"; program = lib.getExe package; @@ -63,6 +63,9 @@ packages = forAllSystems (system: pkgs: _: { default = self.packages.${system}.greg-ng; greg-ng = pkgs.callPackage ./default.nix { }; + greg-ng-wrapped = pkgs.callPackage ./default.nix { + wrapped = true; + }; }); } // { nixosModules.default = ./module.nix;