File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 21
21
defaultText = lib . literalExpression "pkgs.bash" ;
22
22
} ;
23
23
binary = lib . mkOption {
24
- type = types . str ;
25
- description = "Override the binary name if it doesn't match package name" ;
26
- default = config . package . pname ;
27
- defaultText = lib . literalExpression "config.package.pname" ;
24
+ type = types . nullOr types . str ;
25
+ description = "Override the binary name from the default `package.meta.mainProgram`" ;
26
+ default = null ;
28
27
} ;
29
28
description = lib . mkOption {
30
29
type = types . str ;
37
36
} ;
38
37
} ;
39
38
40
- config . scriptPackage =
39
+ config . scriptPackage = let
40
+ binary =
41
+ if config . binary != null
42
+ then "${ pkgs . lib . getBin config . package } /bin/${ config . binary } "
43
+ else pkgs . lib . getExe config . package ;
44
+ in
41
45
lib . hiPrioSet (
42
46
pkgs . writeScriptBin name ''
43
- #!${ pkgs . lib . getBin config . package } /bin/ ${ config . binary }
47
+ #!${ binary }
44
48
${ config . exec }
45
49
''
46
50
) ;
You can’t perform that action at this time.
0 commit comments