From 0fd8ce96ac7c708919da422d032dbf0f23c8c03a Mon Sep 17 00:00:00 2001 From: Jan Malakhovski Date: Sat, 1 Apr 2017 00:00:00 +0000 Subject: [PATCH] nixos: introduce system.nixos.tags --- nixos/modules/misc/label.nix | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) 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); }; }