Commit 18e4687 committed Jun 7, 2017 Verified
1 parent d3b66f9 commit 18e4687 Copy full SHA for 18e4687
File tree 1 file changed +14
-13
lines changed
nixos/modules/system/boot
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change 41
41
] ;
42
42
43
43
instanceOptions = {
44
- options = {
45
-
44
+ options = sharedOptions // {
46
45
execConfig = mkOption {
47
46
default = { } ;
48
47
example = { Parameters = "/bin/sh" ; } ;
82
81
83
82
} ;
84
83
85
- instanceToUnit = name : def :
86
- { text = ''
87
- [Exec]
88
- ${ attrsToSection def . execConfig }
84
+ instanceToUnit = name : def :
85
+ let base = {
86
+ text = ''
87
+ [Exec]
88
+ ${ attrsToSection def . execConfig }
89
89
90
- [Files]
91
- ${ attrsToSection def . filesConfig }
90
+ [Files]
91
+ ${ attrsToSection def . filesConfig }
92
92
93
- [Network]
94
- ${ attrsToSection def . networkConfig }
95
- '' ;
96
- } ;
93
+ [Network]
94
+ ${ attrsToSection def . networkConfig }
95
+ '' ;
96
+ } // def ;
97
+ in base // { unit = makeUnit name base ; } ;
97
98
98
99
in {
99
100
109
110
110
111
config =
111
112
let
112
- units = mapAttrs' ( n : v : nameValuePair "${ n } .nspawn" ( instanceToUnit n v ) ) cfg . instances ;
113
+ units = mapAttrs' ( n : v : nameValuePair "${ n } .nspawn" ( instanceToUnit n v ) ) cfg ;
113
114
in mkIf ( cfg != { } ) {
114
115
115
116
environment . etc . "systemd/nspawn" . source = generateUnits "nspawn" units [ ] [ ] ;
You can’t perform that action at this time.
0 commit comments