nixos: introduce system.nixos.tags

This commit is contained in:
Jan Malakhovski 2017-04-01 00:00:00 +00:00
parent 2e6b796761
commit 0fd8ce96ac

View File

@ -21,12 +21,32 @@ in
'';
};
nixos.tags = mkOption {
type = types.listOf types.str;
default = [];
example = [ "with-xen" ];
description = ''
Strings to prefix to the default
<option>system.nixos.label</option>.
Useful for not loosing track of configurations built with
different options, e.g.:
<screen>
{
system.nixos.tags = [ "with-xen" ];
virtualisation.xen.enable = true;
}
</screen>
'';
};
};
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);
};
}