diff options
author | Maciej Krüger <mkg20001@gmail.com> | 2023-10-13 12:31:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-13 12:31:38 +0200 |
commit | 784bf5dd5e78d565f8cdccfb4950a32ef13c8e7d (patch) | |
tree | f668083d11e12fb05da5290642636987bfa204e3 /nixos | |
parent | a97d85ff06c5d91b594cace882fdf1b241086345 (diff) | |
parent | dbeeeb8e0651837137e50f0c4a323831e295effd (diff) | |
download | nixlib-784bf5dd5e78d565f8cdccfb4950a32ef13c8e7d.tar nixlib-784bf5dd5e78d565f8cdccfb4950a32ef13c8e7d.tar.gz nixlib-784bf5dd5e78d565f8cdccfb4950a32ef13c8e7d.tar.bz2 nixlib-784bf5dd5e78d565f8cdccfb4950a32ef13c8e7d.tar.lz nixlib-784bf5dd5e78d565f8cdccfb4950a32ef13c8e7d.tar.xz nixlib-784bf5dd5e78d565f8cdccfb4950a32ef13c8e7d.tar.zst nixlib-784bf5dd5e78d565f8cdccfb4950a32ef13c8e7d.zip |
Merge pull request #260589 from adamcstephens/lxd/udev-trigger
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/virtualisation/lxc-container.nix | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/nixos/modules/virtualisation/lxc-container.nix b/nixos/modules/virtualisation/lxc-container.nix index 9402d3bf37d0..c40c7bee1886 100644 --- a/nixos/modules/virtualisation/lxc-container.nix +++ b/nixos/modules/virtualisation/lxc-container.nix @@ -9,15 +9,16 @@ in { options = { virtualisation.lxc = { - privilegedContainer = lib.mkOption { - type = lib.types.bool; - default = false; - description = lib.mdDoc '' - Whether this LXC container will be running as a privileged container or not. If set to `true` then - additional configuration will be applied to the `systemd` instance running within the container as - recommended by [distrobuilder](https://linuxcontainers.org/distrobuilder/introduction/). - ''; - }; + nestedContainer = lib.mkEnableOption (lib.mdDoc '' + Whether this container is configured as a nested container. On LXD containers this is recommended + for all containers and is enabled with `security.nesting = true`. + ''); + + privilegedContainer = lib.mkEnableOption (lib.mdDoc '' + Whether this LXC container will be running as a privileged container or not. If set to `true` then + additional configuration will be applied to the `systemd` instance running within the container as + recommended by [distrobuilder](https://linuxcontainers.org/distrobuilder/introduction/). + ''); }; }; @@ -68,6 +69,8 @@ in { ln -fs "$1/init" /sbin/init ''; + systemd.additionalUpstreamSystemUnits = lib.mkIf cfg.nestedContainer ["systemd-udev-trigger.service"]; + # Add the overrides from lxd distrobuilder # https://github.com/lxc/distrobuilder/blob/05978d0d5a72718154f1525c7d043e090ba7c3e0/distrobuilder/main.go#L630 systemd.packages = [ |