Skip to content

Commit

Permalink
Merge pull request NixOS#255116 from adamcstephens/lxd/udev-container
Browse files Browse the repository at this point in the history
systemd: allow udev-trigger to run on lxd containers with nesting
  • Loading branch information
marsam authored Sep 28, 2023
2 parents a9f6c4e + 8565cd8 commit 25b9f4d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/systemd.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ let
"systemd-udevd-kernel.socket"
"systemd-udevd.service"
"systemd-udev-settle.service"
] ++ (optional (!config.boot.isContainer) "systemd-udev-trigger.service") ++ [
] ++ (optional (!config.boot.isContainer || config.virtualisation.lxc.nestedContainer) "systemd-udev-trigger.service") ++ [
# hwdb.bin is managed by NixOS
# "systemd-hwdb-update.service"

Expand Down
19 changes: 10 additions & 9 deletions nixos/modules/virtualisation/lxc-container.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
'');
};
};

Expand Down

0 comments on commit 25b9f4d

Please sign in to comment.