summary refs log tree commit diff
path: root/nixos/modules/services/continuous-integration
diff options
context:
space:
mode:
authorPhilipp Hausmann <phile314@users.noreply.github.com>2017-08-23 20:23:13 +0200
committerJoachim F <joachifm@users.noreply.github.com>2017-08-23 18:23:13 +0000
commitde1a25cd6974c02f16fdd8a1441466d09d9fdc6d (patch)
tree5f7a516c6babf32d1e81ac67d9b84d4ba7bb2652 /nixos/modules/services/continuous-integration
parented9526949f6d17e6df85f111a0443336d124277c (diff)
downloadnixlib-de1a25cd6974c02f16fdd8a1441466d09d9fdc6d.tar
nixlib-de1a25cd6974c02f16fdd8a1441466d09d9fdc6d.tar.gz
nixlib-de1a25cd6974c02f16fdd8a1441466d09d9fdc6d.tar.bz2
nixlib-de1a25cd6974c02f16fdd8a1441466d09d9fdc6d.tar.lz
nixlib-de1a25cd6974c02f16fdd8a1441466d09d9fdc6d.tar.xz
nixlib-de1a25cd6974c02f16fdd8a1441466d09d9fdc6d.tar.zst
nixlib-de1a25cd6974c02f16fdd8a1441466d09d9fdc6d.zip
nixos/hail: init (#28442)
Diffstat (limited to 'nixos/modules/services/continuous-integration')
-rw-r--r--nixos/modules/services/continuous-integration/hail.nix61
1 files changed, 61 insertions, 0 deletions
diff --git a/nixos/modules/services/continuous-integration/hail.nix b/nixos/modules/services/continuous-integration/hail.nix
new file mode 100644
index 000000000000..5d0c3f7b4ab3
--- /dev/null
+++ b/nixos/modules/services/continuous-integration/hail.nix
@@ -0,0 +1,61 @@
+{ config, lib, pkgs, ...}:
+
+with lib;
+
+let
+  cfg = config.services.hail;
+in {
+
+
+  ###### interface
+
+  options.services.hail = {
+    enable = mkOption {
+      type = types.bool;
+      default = false;
+      description = ''
+        Enables the Hail Auto Update Service. Hail can automatically deploy artifacts
+        built by a Hydra Continous Integration server. A common use case is to provide
+        continous deployment for single services or a full NixOS configuration.'';
+    };
+    profile = mkOption {
+      type = types.str;
+      default = "hail-profile";
+      description = "The name of the Nix profile used by Hail.";
+    };
+    hydraJobUri = mkOption {
+      type = types.str;
+      description = "The URI of the Hydra Job.";
+    };
+    netrc = mkOption {
+      type = types.nullOr types.path;
+      description = "The netrc file to use when fetching data from Hydra.";
+      default = null;
+    };
+    package = mkOption {
+      type = types.package;
+      default = pkgs.haskellPackages.hail;
+      defaultText = "pkgs.haskellPackages.hail";
+      description = "Hail package to use.";
+    };
+  };
+
+
+  ###### implementation
+
+  config = mkIf cfg.enable {
+    systemd.services.hail = {
+      description = "Hail Auto Update Service";
+      wants = [ "network-online.target" ];
+      wantedBy = [ "multi-user.target" ];
+      path = with pkgs; [ nix ];
+      environment = {
+        HOME = "/var/lib/empty";
+      };
+      serviceConfig = {
+        ExecStart = "${cfg.package}/bin/hail --profile ${cfg.profile} --job-uri ${cfg.hydraJobUri}"
+          + lib.optionalString (cfg.netrc != null) " --netrc-file ${cfg.netrc}";
+      };
+    };
+  };
+}