-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: properly escape Nix strings everywhere (#35)
- Loading branch information
Showing
28 changed files
with
258 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: "dovecot" | ||
services: | ||
dovecot: | ||
container_name: dovecot | ||
image: dovecot | ||
labels: | ||
ofelia.enabled: "true" | ||
ofelia.job-exec.dovecot_imapsync_runner.schedule: "@every 1m" | ||
ofelia.job-exec.dovecot_imapsync_runner.no-overlap: "true" | ||
ofelia.job-exec.dovecot_imapsync_runner.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu nobody /usr/local/bin/imapsync_runner.pl || exit 0\"" | ||
ofelia.job-exec.dovecot_trim_logs.schedule: "@every 1m" | ||
ofelia.job-exec.dovecot_trim_logs.command: "/bin/bash -c \"[[ $${MASTER} == y ]] && /usr/local/bin/gosu vmail /usr/local/bin/trim_logs.sh || exit 0\"" | ||
networks: | ||
- abc | ||
volumes: | ||
- def:/path/to/path | ||
|
||
networks: | ||
abc: | ||
labels: | ||
my-label: "\"some quoted string\"" | ||
|
||
volumes: | ||
def: | ||
labels: | ||
other-label: "\"another quota string\"" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
{ pkgs, lib, ... }: | ||
|
||
{ | ||
# Runtime | ||
virtualisation.docker = { | ||
enable = true; | ||
autoPrune.enable = true; | ||
}; | ||
virtualisation.oci-containers.backend = "docker"; | ||
|
||
# Containers | ||
virtualisation.oci-containers.containers."dovecot" = { | ||
image = "dovecot"; | ||
volumes = [ | ||
"dovecot_def:/path/to/path:rw" | ||
]; | ||
labels = { | ||
"ofelia.enabled" = "true"; | ||
"ofelia.job-exec.dovecot_imapsync_runner.command" = "/bin/bash -c \"[[ \${MASTER} == y ]] && /usr/local/bin/gosu nobody /usr/local/bin/imapsync_runner.pl || exit 0\""; | ||
"ofelia.job-exec.dovecot_imapsync_runner.no-overlap" = "true"; | ||
"ofelia.job-exec.dovecot_imapsync_runner.schedule" = "@every 1m"; | ||
"ofelia.job-exec.dovecot_trim_logs.command" = "/bin/bash -c \"[[ \${MASTER} == y ]] && /usr/local/bin/gosu vmail /usr/local/bin/trim_logs.sh || exit 0\""; | ||
"ofelia.job-exec.dovecot_trim_logs.schedule" = "@every 1m"; | ||
}; | ||
log-driver = "journald"; | ||
autoStart = false; | ||
extraOptions = [ | ||
"--network-alias=dovecot" | ||
"--network=dovecot_abc" | ||
]; | ||
}; | ||
systemd.services."docker-dovecot" = { | ||
serviceConfig = { | ||
Restart = lib.mkOverride 90 "no"; | ||
}; | ||
after = [ | ||
"docker-network-dovecot_abc.service" | ||
"docker-volume-dovecot_def.service" | ||
]; | ||
requires = [ | ||
"docker-network-dovecot_abc.service" | ||
"docker-volume-dovecot_def.service" | ||
]; | ||
}; | ||
|
||
# Networks | ||
systemd.services."docker-network-dovecot_abc" = { | ||
path = [ pkgs.docker ]; | ||
serviceConfig = { | ||
Type = "oneshot"; | ||
RemainAfterExit = true; | ||
ExecStop = "docker network rm -f dovecot_abc"; | ||
}; | ||
script = '' | ||
docker network inspect dovecot_abc || docker network create dovecot_abc --label=my-label="some quoted string" | ||
''; | ||
partOf = [ "docker-compose-dovecot-root.target" ]; | ||
wantedBy = [ "docker-compose-dovecot-root.target" ]; | ||
}; | ||
|
||
# Volumes | ||
systemd.services."docker-volume-dovecot_def" = { | ||
path = [ pkgs.docker ]; | ||
serviceConfig = { | ||
Type = "oneshot"; | ||
RemainAfterExit = true; | ||
}; | ||
script = '' | ||
docker volume inspect dovecot_def || docker volume create dovecot_def --label=other-label="another quota string" | ||
''; | ||
partOf = [ "docker-compose-dovecot-root.target" ]; | ||
wantedBy = [ "docker-compose-dovecot-root.target" ]; | ||
}; | ||
|
||
# Root service | ||
# When started, this will automatically create all resources and start | ||
# the containers. When stopped, this will teardown all resources. | ||
systemd.targets."docker-compose-dovecot-root" = { | ||
unitConfig = { | ||
Description = "Root target generated by compose2nix."; | ||
}; | ||
}; | ||
} |
Oops, something went wrong.