nixos/hail: init (#28442)
This commit is contained in:
parent
ed9526949f
commit
de1a25cd69
@ -165,6 +165,7 @@
|
||||
./services/continuous-integration/buildbot/master.nix
|
||||
./services/continuous-integration/buildbot/worker.nix
|
||||
./services/continuous-integration/buildkite-agent.nix
|
||||
./services/continuous-integration/hail.nix
|
||||
./services/continuous-integration/hydra/default.nix
|
||||
./services/continuous-integration/gitlab-runner.nix
|
||||
./services/continuous-integration/gocd-agent/default.nix
|
||||
|
61
nixos/modules/services/continuous-integration/hail.nix
Normal file
61
nixos/modules/services/continuous-integration/hail.nix
Normal file
@ -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}";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user