buildFHSEnvBubblewrap: allow being passed 'pname'

`buildFHSEnvBubblewrap { pname = ...; }` currently results in eval error
because args.name doesn't exist then. Fix it by only using args.name if
it exists.
This commit is contained in:
Bjørn Forsman 2023-09-24 19:37:44 +02:00
parent e12483116b
commit 70b5588b4e

View file

@ -31,7 +31,7 @@ assert (pname != null || version != null) -> (name == null && pname != null); #
with builtins; with builtins;
let let
pname = if args.name != null then args.name else args.pname; pname = if args ? name && args.name != null then args.name else args.pname;
versionStr = lib.optionalString (version != null) ("-" + version); versionStr = lib.optionalString (version != null) ("-" + version);
name = pname + versionStr; name = pname + versionStr;