diff --git a/nixos/modules/misc/label.nix b/nixos/modules/misc/label.nix
index 5faac8936f8f..b4e88915d829 100644
--- a/nixos/modules/misc/label.nix
+++ b/nixos/modules/misc/label.nix
@@ -21,12 +21,32 @@ in
'';
};
+ nixos.tags = mkOption {
+ type = types.listOf types.str;
+ default = [];
+ example = [ "with-xen" ];
+ description = ''
+ Strings to prefix to the default
+ .
+
+ Useful for not loosing track of configurations built with
+ different options, e.g.:
+
+
+ {
+ system.nixos.tags = [ "with-xen" ];
+ virtualisation.xen.enable = true;
+ }
+
+ '';
+ };
+
};
config = {
# This is set here rather than up there so that changing it would
# not rebuild the manual
- system.nixos.label = mkDefault cfg.version;
+ system.nixos.label = mkDefault (concatStringsSep "-" (sort (x: y: x < y) cfg.tags) + "-" + cfg.version);
};
}