mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 19:55:41 +03:00
nixos/oci-containers: option to set the service name of a oci-container
Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
parent
d836dc6ebf
commit
d01038921c
1 changed files with 9 additions and 4 deletions
|
@ -14,7 +14,7 @@ let
|
|||
defaultBackend = options.virtualisation.oci-containers.backend.default;
|
||||
|
||||
containerOptions =
|
||||
{ ... }:
|
||||
{ name, ... }:
|
||||
{
|
||||
|
||||
options = {
|
||||
|
@ -59,6 +59,13 @@ let
|
|||
example = literalExpression "pkgs.dockerTools.streamLayeredImage {...};";
|
||||
};
|
||||
|
||||
serviceName = mkOption {
|
||||
type = types.str;
|
||||
default = "${cfg.backend}-${name}";
|
||||
defaultText = "<backend>-<name>";
|
||||
description = "Systemd service name that manages the container";
|
||||
};
|
||||
|
||||
login = {
|
||||
|
||||
username = mkOption {
|
||||
|
@ -525,9 +532,7 @@ in
|
|||
config = lib.mkIf (cfg.containers != { }) (
|
||||
lib.mkMerge [
|
||||
{
|
||||
systemd.services = mapAttrs' (
|
||||
n: v: nameValuePair "${cfg.backend}-${n}" (mkService n v)
|
||||
) cfg.containers;
|
||||
systemd.services = mapAttrs' (n: v: nameValuePair v.serviceName (mkService n v)) cfg.containers;
|
||||
|
||||
assertions =
|
||||
let
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue