From d857988d21be667385c3841f0ce7df7c9ec153fb Mon Sep 17 00:00:00 2001 From: Chuck Z Date: Fri, 31 Mar 2023 13:19:53 -0600 Subject: [PATCH] anki-bin: add commandLineArgs to package arguments anki-bin is built with buildFHSUserEnv on Linux, which makes using overrides to pass in command line arguments impossible. This commit adds the commandLineArgs argument to the package inputs and appends the string to the runscript, allowing pkgs.override to add flags to pass to anki when the derivation is built. This is useful when anki's desired directory isn't the default, allowing users to specify the directory in their overlays instead of adding a flag everytime they call the program. --- pkgs/games/anki/bin.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/games/anki/bin.nix b/pkgs/games/anki/bin.nix index c2a988d16876..d824475f8fd8 100644 --- a/pkgs/games/anki/bin.nix +++ b/pkgs/games/anki/bin.nix @@ -1,4 +1,4 @@ -{ fetchurl, stdenv, lib, buildFHSUserEnv, appimageTools, writeShellScript, anki, undmg, zstd }: +{ fetchurl, stdenv, lib, buildFHSUserEnv, appimageTools, writeShellScript, anki, undmg, zstd, commandLineArgs ? "" }: let pname = "anki-bin"; @@ -57,7 +57,7 @@ let targetPkgs = pkgs: (with pkgs; [ xorg.libxkbfile krb5 ]); runScript = writeShellScript "anki-wrapper.sh" '' - exec ${unpacked}/bin/anki + exec ${unpacked}/bin/anki ${ lib.strings.escapeShellArg commandLineArgs } ''; extraInstallCommands = ''