summary refs log tree commit diff
path: root/nixos/modules/misc/label.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/misc/label.nix')
-rw-r--r--nixos/modules/misc/label.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/nixos/modules/misc/label.nix b/nixos/modules/misc/label.nix
new file mode 100644
index 00000000000..30d8fc9952b
--- /dev/null
+++ b/nixos/modules/misc/label.nix
@@ -0,0 +1,32 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.system;
+in
+
+{
+
+  options.system = {
+
+    nixosLabel = mkOption {
+      type = types.str;
+      description = ''
+        NixOS version name to be used in the names of generated
+        outputs and boot labels.
+
+        If you ever wanted to influence the labels in your GRUB menu,
+        this is the option for you.
+      '';
+    };
+
+  };
+
+  config = {
+    # This is set here rather than up there so that changing it would
+    # not rebuild the manual
+    system.nixosLabel = mkDefault cfg.nixosVersion;
+  };
+
+}