File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7070 appendEnv = true ;
7171 appendEnvFiles = true ;
7272 unitDefaults = true ;
73+ networkNameAlias = true ;
7374 # Opt out either with this flag, or by setting :noMap at the end of a specific volume
7475 mapVolumes = true ;
7576 } ;
99100 } ;
100101
101102 unitDefaults =
102- qVal :
103+ qVal : qOpts :
103104 {
104105 Install . WantedBy = [ "default.target" ] ;
105106 Service = {
109110 } ;
110111 }
111112 // optionalAttrs ( isContainer qVal ) {
112- Container . PodmanArgs = "--network-alias ${ qVal . Container . ContainerName } --user 0:0" ;
113+ Container . PodmanArgs = "${ lib . optionalString qOpts . networkNameAlias " --network-alias ${ qVal . Container . ContainerName } " } --user 0:0" ;
113114 } ;
114115
115116 mkdirOp = qVal : {
158159 # Merge container & default options.
159160 quadletOptions = defaultOptions // ( qVal . __options or { } ) ;
160161
162+ /**
163+ Ideal Preprocessing ordering -
164+ unitDefaults -> appendEnv -> appendEnvFiles -> mapVolumes (special) -> mkdirOp
165+
166+ Current ordering
167+ mapVolumes (special) -> unitDefaults -> mkdirOp -> appendEnv -> appendEnvFiles
168+ */
169+
161170 # Map only volumes separately, since volumes have to be overwritten entirely,
162171 # rather than be merged.
163172 mappedVolumes =
178187 qVal ;
179188 preProcess = foldl' ( acc : elem : ( lib' . deepMerge ( elem acc ) acc ) ) mappedVolumes (
180189 [
181- ( f : optionalAttrs quadletOptions . unitDefaults ( unitDefaults f ) )
190+ # Temp fix for hp-laptop not using bridge networking.
191+ # TODO: Write a better pre-processing script later.
192+ ( f : optionalAttrs quadletOptions . unitDefaults ( unitDefaults f quadletOptions ) )
182193 ]
183194 ++ ( lib . optionals ( isContainer qVal ) [
184195 ( f : optionalAttrs quadletOptions . mkdir ( mkdirOp f ) )
Original file line number Diff line number Diff line change 55 enable = true ;
66 quadlets = {
77 "minecraft.container" = {
8+ __options . networkNameAlias = false ;
89 Container = {
910 ContainerName = "minecraft" ;
1011 Image = "docker.io/itzg/minecraft-server" ;
1819 } ;
1920
2021 "ollama.container" = {
22+ __options . networkNameAlias = false ;
2123 Container = {
2224 ContainerName = "ollama" ;
2325 GroupAdd = "keep-groups" ;
3537 } ;
3638
3739 "ddns-updater.container" = {
40+ __options . networkNameAlias = false ;
3841 Container = {
3942 ContainerName = "ddns-updater" ;
4043 Image = "docker.io/favonia/cloudflare-ddns:latest" ;
You can’t perform that action at this time.
0 commit comments