summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Puppe <dev@mpuppe.de>2022-08-04 21:48:27 +0200
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2022-08-10 15:29:39 +0000
commit48b37dd39ddce4fdc40dc332dc7928c8e0c3876d (patch)
tree99be3b568d2a1a2a59157223adca50dd9b2eaca2
parentMerge pull request #185851 from NixOS/backport-185722-to-release-22.05 (diff)
downloadnixpkgs-origin/backport-185153-to-release-22.05.tar.gz
nixos/nixos-containers: Fix ineffective warningorigin/backport-185153-to-release-22.05
A warning regarding enabling NixOS containers and virtualisation.containers at the same time with state versions < 22.05 had been added in commit 3c49151f154a3872eb278c214863d926a4f8abf6. But this warning had accidentally been defined in the wrong place, and the warning has therefore not actually been in effect. This commit fixes that. (cherry picked from commit 82c64d154b2743f34092bc1be519845c4496142d)
-rw-r--r--nixos/modules/virtualisation/nixos-containers.nix11
1 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/virtualisation/nixos-containers.nix b/nixos/modules/virtualisation/nixos-containers.nix
index 23228a109bce..d424454d7ae8 100644
--- a/nixos/modules/virtualisation/nixos-containers.nix
+++ b/nixos/modules/virtualisation/nixos-containers.nix
@@ -742,12 +742,6 @@ in
config = mkIf (config.boot.enableContainers) (let
- warnings = flatten [
- (optional (config.virtualisation.containers.enable && versionOlder config.system.stateVersion "22.05") ''
- Enabling both boot.enableContainers & virtualisation.containers on system.stateVersion < 22.05 is unsupported.
- '')
- ];
-
unit = {
description = "Container '%i'";
@@ -771,6 +765,11 @@ in
serviceConfig = serviceDirectives dummyConfig;
};
in {
+ warnings =
+ (optional (config.virtualisation.containers.enable && versionOlder config.system.stateVersion "22.05") ''
+ Enabling both boot.enableContainers & virtualisation.containers on system.stateVersion < 22.05 is unsupported.
+ '');
+
systemd.targets.multi-user.wants = [ "machines.target" ];
systemd.services = listToAttrs (filter (x: x.value != null) (