nix: use unwrapped program by default in module

This commit is contained in:
Oystein Kristoffer Tveit 2024-10-20 22:51:05 +02:00
parent cfb6bbd7a7
commit 9934b11766
Signed by: oysteikt
GPG Key ID: 9F2F7D8250F35146
2 changed files with 6 additions and 2 deletions

View File

@ -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 ]}'
'';

View File

@ -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;