Commit Graph

29 Commits

Author SHA1 Message Date
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Diogo Correia
81f21e3936
nixos/oci-containers: ignore nonexistent container when stopping
Fixes #292551
2024-03-01 10:41:00 +00:00
budimanjojo
fd3fa9f2d3
nixos/oci-containers: check if image exists locally before failing
Signed-off-by: budimanjojo <budimanjojo@gmail.com>
2024-02-19 10:38:26 +07:00
Peder Bergebakken Sundt
c43fd32e03
Merge pull request #248315 from apeschar/oci-containers-backend-stop
nixos/oci-containers: stop container using backend
2024-02-10 17:12:56 +01:00
Jade Lovelace
6c5ab28fce nixos: fix a bunch of services missing dep on network-online.target
This was done by generating a truly hilarious configuration:

rg 'services\.[^.]+\.enable\t' opts-tags | cut -f1 > allonconfig.nix

The following were not tested due to other evaluation errors. They
should probably be manually audited.
services.amule
services.castopod
services.ceph
services.chatgpt-retrieval-plugin
services.clamsmtp
services.clight
services.dante
services.dex
services.discourse
services.dwm-status
services.engelsystem
services.foundationdb
services.frigate
services.frp
services.grocy
services.guacamole-client
services.hedgedoc
services.home-assistant
services.honk
services.imaginary
services.jitsi-meet
services.kerberos_server
services.limesurvey
services.mastodon
services.mediawiki
services.mobilizon
services.moodle
services.mosquitto
services.nextcloud
services.nullmailer
services.patroni
services.pfix-srsd
services.pgpkeyserver-lite
services.postfixadmin
services.roundcube
services.schleuder
services.self-deploy
services.slskd
services.spacecookie
services.statsd
services.step-ca
services.sympa
services.tsmBackup
services.vdirsyncer
services.vikunja
services.yandex-disk
services.zabbixWeb
2024-01-19 00:11:34 -08:00
Florian Brandes
2ed7a5ab59 nixos/virtualization: fix shellcheck login
fixes https://www.shellcheck.net/wiki/SC2002

Signed-off-by: Florian Brandes <florian.brandes@posteo.de>
2023-11-07 13:40:42 +01:00
adisbladis
a1592fb410
Merge pull request #258299 from Arcayr/virtualisation-hostname
nixos/virtualisation: add hostname option to oci-containers.
2023-11-06 10:44:26 +13:00
Franz Pletz
265ca81834
Merge pull request #241908 from picnoir/nin/oci-container-pre-start-list 2023-10-31 15:53:35 +01:00
Albert Peschar
6ed6953e22 nixos/oci-containers: stop container using backend
Make systemd actually call `podman stop` when stopping a container unit.

Fixes #249332
2023-10-26 12:52:59 +00:00
HaeNoe
2f021def6e nixos/oci-containers: add labels option 2023-10-09 10:43:29 +02:00
Elliot Speck (Arcayr)
3782b3b5d9 nixos/virtualisation: add hostname option to oci-containers. 2023-10-01 05:17:44 +11:00
Félix Baylac Jacqué
b7fd022677 nixos/oci-containers: make systemd service pre-start extensible
We were setting the systemd pre-start script through the
systemd.services.<name>.preStart NixOS option. This option uses a
string containing the pre-start script as input.

In some scenarios, you want to extend this script to perform some
additional actions before launching a container.

At the moment, your only option is to mkForce the pre-start string and
rewrite a preStart script from scratch. Potentially vendoring the
Nixpkgs pre-start script in your custom pre-start script. (you can
also create a new service unit in charge of running the custom
pre-start and create a dependency link between the units, but that's
also sub-optimal).

The systemd.services.<name>.serviceConfig.ExecStartPre NixOS option
gives us a better way to extend a pre-start script. Instead of being a
simple script, this option can be a list of scripts. The NixOS module
system then merges the multiple list declarations instead of
overriding them. Meaning that if we use this ExecStartPre option, we
can trivially extend the exec-start script: just add the custom script
in the systemd service override and you're done.

ExecStartPre behaves a tiny bit differently from preStart. Instead of
expecting a string containing a script, it expects a path pointing to
a script. We take advantage of this API change to check the pre-start
script with shellCheck via the pkgs.writeShellApplication function.
2023-07-06 13:35:31 +02:00
Nick Cao
cd5c34bb18
Merge pull request #188795 from Sohalt/oci-containers-wait-for-network
nixos/oci-containers: wait for network before starting container
2023-01-20 09:11:19 +08:00
Karel Kočí
76e1e908c1
nixos/modules/virtualisation: fix oci-containers with docker
The empty attribute set is invalidly provided as service config and
results in evaluation error.
2022-10-17 16:11:56 +02:00
Florian Klink
80e4946f38
Merge pull request #177406 from davidkna/podman-gen
nixos/virtualisation.oci-containers: follow podman-generated systemd units more closely
2022-10-15 22:10:55 +02:00
sohalt
995853d13c nixos/oci-containers: wait for network before starting container
Without `ìmageFile` set, the service needs to download the image from
the registry. If the network is not up in time, the service tries to
restart rapidly until it fails.
2022-09-07 17:28:00 +02:00
pennae
3fdde45825 nixos/oci-containers: convert option docs to MD
no changes to the manpages, no rendering changes to the html manual
2022-07-19 16:23:57 +02:00
David Knaack
9f7e40205e nixos/virtualisation.oci-containers: follow podman-generated systemd units more closely 2022-06-12 15:24:34 +02:00
adisbladis
46241e156c nixos/virtualisation.oci-containers: Use podman as the default backend
This has a number of benefits such as that applying service limits will
actually work since there isn't a layer of indirection (the Docker daemon)
between the systemd service and the container runtime.
2022-05-03 14:50:43 +12:00
Ian Kerins
4c6772e2a1 nixos/oci-containers: improve description of imageFile
As a novice to using this module, I found the existing description to be
quite misleading. It does not at all disable pulling from the registry,
it just loads some image archive that may or may not be related to the
container you're specifying. I had thought there was extra magic behind
this option, but it's just a `docker load`. You need foreknowledge of
the contents of the archive so that whatever it contained is actually
used to run the container.

I've reworded the description to hopefully make this behavior clearer.
2022-03-12 11:14:22 +01:00
Tristan
7f6a2d5663 oci-containers: fix imageFile example 2021-12-04 10:23:58 +01:00
Naïm Favier
2ddc335e6f
nixos/doc: clean up defaults and examples 2021-10-04 12:47:20 +02:00
Tobias Happ
bbd5cdac29 nixos/oci-containers: enable login for registry 2021-07-08 16:30:17 +10:00
Ramses
14d2192623 nixos/oci-containers: restore ability to easily view the container output in the logs
Fixes #102768.
Allows the usage of `journalctl -u` to easily view the logs for a container managed by this module.
2021-07-06 07:36:33 +10:00
Philipp Mildenberger
f5922de1d7 nixos/oci-containers: add support for environment files 2021-04-15 10:57:56 +02:00
Simon Žlender
ede24160fc nixos/oci-containers: Remove dep on system.path 2021-01-29 18:29:07 +01:00
Simon Žlender
683f0b8938 nixos/oci-containers: Use docker.package 2021-01-28 21:27:50 +01:00
Brian McKenna
1c73baa8c8
oci-containers: fix containers attribute in docs 2020-12-26 16:06:30 +11:00
adisbladis
2f7747526c
nixos/docker-containers: Rename to virtualisation.oci-containers.containers.
And allow the runtime to be configurable via the
`virtualisation.oci-containers.backend` option.

Valid choices are "podman" and "docker".
2020-05-04 13:47:25 +01:00