File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 111111 github = "allen-liaoo" ;
112112 githubId = 16383622 ;
113113 } ;
114+ aliaslion = {
115+ name = "aliaslion" ;
116+ github = "aliaslion" ;
117+ githubId = "122117018" ;
118+ } ;
114119}
Original file line number Diff line number Diff line change 1+ {
2+ config ,
3+ lib ,
4+ wlib ,
5+ pkgs ,
6+ ...
7+ } :
8+ {
9+ imports = [ wlib . modules . default ] ;
10+ options = {
11+ settings = lib . mkOption {
12+ type = wlib . types . structuredValueWith {
13+ nullable = false ;
14+ typeName = "TOML" ;
15+ } ;
16+ default = { } ;
17+ description = ''
18+ Configuration of iamb.
19+ See {manpage}`iamb(5)` or <https://iamb.chat/configure.html>
20+ '' ;
21+ } ;
22+
23+ generatedConfig . output = lib . mkOption {
24+ type = lib . types . str ;
25+ default = config . outputName ;
26+ description = ''
27+ The derivation output for the config generated by this wrapper module
28+ '' ;
29+ } ;
30+ generatedConfig . placeholder = lib . mkOption {
31+ type = lib . types . str ;
32+ default = "${ placeholder config . generatedConfig . output } /${ config . binName } -config" ;
33+ readOnly = true ;
34+ description = ''
35+ The placeholder accessible in the wrapper derivation build script for the config generated by this wrapper module
36+ '' ;
37+ } ;
38+ } ;
39+
40+ config . package = lib . mkDefault pkgs . iamb ;
41+ config . flags . "--config-directory" = config . generatedConfig . placeholder ;
42+
43+ config . passthru . generatedConfig = "${
44+ config . wrapper . ${ config . generatedConfig . output }
45+ } /${ config . binName } -config" ;
46+
47+ config . constructFiles . config = {
48+ relPath = "${ config . binName } -config/iamb/config.toml" ;
49+ output = config . generatedConfig . output ;
50+ content = builtins . toJSON config . settings ;
51+ builder = ''${ pkgs . remarshal } /bin/json2toml "$1" "$2"'' ;
52+ } ;
53+ config . meta . maintainers = [ wlib . maintainers . aliaslion ] ;
54+ }
You can’t perform that action at this time.
0 commit comments