Skip to content

Commit

Permalink
rename templates
Browse files Browse the repository at this point in the history
  • Loading branch information
aksiksi committed Nov 5, 2023
1 parent 59ac2d3 commit d95b39f
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
build:
mkdir -p bin/ && go build -o bin/ ./cmd/nixose

.PHONY: build run
test:
go test

.PHONY: build test
2 changes: 1 addition & 1 deletion nixose.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (c NixContainerConfig) String() string {
"execTemplate": execTemplate(nixTemplates),
}
nixTemplates := template.Must(nixTemplates.Funcs(execTemplateFuncMap).ParseFS(templateFS, "templates/*.tmpl"))
if err := nixTemplates.ExecuteTemplate(&s, "main.tmpl", c); err != nil {
if err := nixTemplates.ExecuteTemplate(&s, "main.nix.tmpl", c); err != nil {
panic(err)
}
return s.String()
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions templates/main.tmpl → templates/main.nix.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@

# Containers
{{- range .Containers}}
{{execTemplate "container.tmpl" . | indent 2}}
{{execTemplate "container.nix.tmpl" . | indent 2}}
{{- end}}
{{- end}}

{{- if .Networks}}

# Networks
{{- range .Networks}}
{{execTemplate "network.tmpl" . | indent 2}}
{{execTemplate "network.nix.tmpl" . | indent 2}}
{{- end}}
{{- end}}

{{- if .Volumes}}

# Volumes
{{- range .Volumes}}
{{execTemplate "volume.tmpl" . | indent 2}}
{{execTemplate "volume.nix.tmpl" . | indent 2}}
{{- end}}
{{- end}}

Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit d95b39f

Please sign in to comment.