mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-14 06:00:33 +03:00
Merge pull request #5939 from offlinehacker/nixos/containers/containers_in_containers
nixos/containers: make containers in containers possible
This commit is contained in:
commit
c0eff1de61
1 changed files with 9 additions and 1 deletions
|
@ -54,6 +54,14 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
boot.enableContainers = mkOption {
|
||||||
|
type = types.bool;
|
||||||
|
default = !config.boot.isContainer;
|
||||||
|
description = ''
|
||||||
|
Whether to enable support for nixos containers.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
containers = mkOption {
|
containers = mkOption {
|
||||||
type = types.attrsOf (types.submodule (
|
type = types.attrsOf (types.submodule (
|
||||||
{ config, options, name, ... }:
|
{ config, options, name, ... }:
|
||||||
|
@ -164,7 +172,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
config = mkIf (!config.boot.isContainer) {
|
config = mkIf (config.boot.enableContainers) {
|
||||||
|
|
||||||
systemd.services."container@" =
|
systemd.services."container@" =
|
||||||
{ description = "Container '%i'";
|
{ description = "Container '%i'";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue