about summary refs log tree commit diff stats
path: root/modules/nixos
diff options
context:
space:
mode:
authorAlan Pearce2025-03-09 21:34:04 +0100
committerAlan Pearce2025-03-09 21:34:04 +0100
commita28ff3126cb089e25d1938ab320d6dfdc1a30cef (patch)
treeea8dd933a99e60226a174e58c13bc7855c2799e3 /modules/nixos
parentaffbe9a165a939dc51b38f3f0214552c237b2e6e (diff)
downloadnix-packages-a28ff3126cb089e25d1938ab320d6dfdc1a30cef.tar.lz
nix-packages-a28ff3126cb089e25d1938ab320d6dfdc1a30cef.tar.zst
nix-packages-a28ff3126cb089e25d1938ab320d6dfdc1a30cef.zip
modules/laminar: support showing a reason in the web interface
Diffstat (limited to 'modules/nixos')
-rw-r--r--modules/nixos/laminar.nix10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/nixos/laminar.nix b/modules/nixos/laminar.nix
index 3e50033..64ba208 100644
--- a/modules/nixos/laminar.nix
+++ b/modules/nixos/laminar.nix
@@ -69,6 +69,13 @@ in
             description = "Name of the timer.";
           };
 
+          reason = mkOption {
+            type = with types; nullOr str;
+            example = "Nightly build";
+            default = null;
+            description = "optional human-readable string that will be displayed in the web UI as the cause of the build.";
+          };
+
           startAt = mkOption {
             type = with types; either str (listOf str);
             default = "daily";
@@ -179,6 +186,9 @@ in
             "/run/wrappers"
           ]
           ++ cfg.path;
+          environment = {
+            LAMINAR_REASON = job.reason;
+          };
           serviceConfig = {
             User = cfg.user;
             Group = cfg.group;