Merge pull request #110614 from cpcloud/nomad-mkdefault-data-dir

nixos/nomad: fix data_dir-default-not-propagating bug
This commit is contained in:
Robert Hensing 2021-01-23 21:09:27 +01:00 committed by GitHub
commit e03103707b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,10 +51,7 @@ in
settings = mkOption {
type = format.type;
default = {
# Agrees with `StateDirectory = "nomad"` set below.
data_dir = "/var/lib/nomad";
};
default = {};
description = ''
Configuration for Nomad. See the <link xlink:href="https://www.nomadproject.io/docs/configuration">documentation</link>
for supported values.
@ -77,6 +74,11 @@ in
##### implementation
config = mkIf cfg.enable {
services.nomad.settings = {
# Agrees with `StateDirectory = "nomad"` set below.
data_dir = mkDefault "/var/lib/nomad";
};
environment = {
etc."nomad.json".source = format.generate "nomad.json" cfg.settings;
systemPackages = [ cfg.package ];
@ -114,6 +116,7 @@ in
} // (optionalAttrs cfg.enableDocker {
SupplementaryGroups = "docker"; # space-separated string
});
unitConfig = {
StartLimitIntervalSec = 10;
StartLimitBurst = 3;