From 22a8cf0c28d536294d55049923575ce94bb39359 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Mon, 16 Jan 2023 15:50:30 +0100 Subject: [PATCH] nixos/lxc-container: fix compatibility with systemd-nspawn --- nixos/modules/virtualisation/lxc-container.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nixos/modules/virtualisation/lxc-container.nix b/nixos/modules/virtualisation/lxc-container.nix index 416a2f905487..96b749102241 100644 --- a/nixos/modules/virtualisation/lxc-container.nix +++ b/nixos/modules/virtualisation/lxc-container.nix @@ -150,6 +150,12 @@ in source = config.system.build.toplevel + "/init"; target = "/sbin/init"; } + # Technically this is not required for lxc, but having also make this configuration work with systemd-nspawn. + # Nixos will setup the same symlink after start. + { + source = config.system.build.toplevel + "/etc/os-release"; + target = "/etc/os-release"; + } ]; extraCommands = "mkdir -p proc sys dev";