Add salt master module (#25632)

* salt: 2016.11.2 -> 2016.11.4

* salt: Add master NixOS module

authored by

Aneesh Agrawal and committed by
Jörg Thalheim
779ae064 0d6d47ed

+63 -2
+1
nixos/modules/module-list.nix
··· 129 129 ./security/rtkit.nix 130 130 ./security/wrappers/default.nix 131 131 ./security/sudo.nix 132 + ./services/admin/salt/master.nix 132 133 ./services/amqp/activemq/default.nix 133 134 ./services/amqp/rabbitmq.nix 134 135 ./services/audio/alsa.nix
+60
nixos/modules/services/admin/salt/master.nix
··· 1 + { config, pkgs, lib, ... }: 2 + 3 + with lib; 4 + 5 + let 6 + 7 + cfg = config.services.salt.master; 8 + 9 + fullConfig = lib.recursiveUpdate { 10 + # Provide defaults for some directories to allow an immutable config dir 11 + 12 + # Default is equivalent to /etc/salt/master.d/*.conf 13 + default_include = "/var/lib/salt/master.d/*.conf"; 14 + # Default is in /etc/salt/pki/master 15 + pki_dir = "/var/lib/salt/pki/master"; 16 + } cfg.configuration; 17 + 18 + in 19 + 20 + { 21 + options = { 22 + services.salt.master = { 23 + enable = mkEnableOption "Salt master service"; 24 + configuration = mkOption { 25 + type = types.attrs; 26 + default = {}; 27 + description = "Salt master configuration as Nix attribute set."; 28 + }; 29 + }; 30 + }; 31 + 32 + config = mkIf cfg.enable { 33 + environment = { 34 + # Set this up in /etc/salt/master so `salt`, `salt-key`, etc. work. 35 + # The alternatives are 36 + # - passing --config-dir to all salt commands, not just the master unit, 37 + # - setting a global environment variable, 38 + etc."salt/master".source = pkgs.writeText "master" ( 39 + builtins.toJSON fullConfig 40 + ); 41 + systemPackages = with pkgs; [ salt ]; 42 + }; 43 + systemd.services.salt-master = { 44 + description = "Salt Master"; 45 + wantedBy = [ "multi-user.target" ]; 46 + after = [ "network.target" ]; 47 + path = with pkgs; [ 48 + utillinux # for dmesg 49 + ]; 50 + serviceConfig = { 51 + ExecStart = "${pkgs.salt}/bin/salt-master"; 52 + LimitNOFILE = 16384; 53 + Type = "notify"; 54 + NotifyAccess = "all"; 55 + }; 56 + }; 57 + }; 58 + 59 + meta.maintainers = with lib.maintainers; [ aneeshusa ]; 60 + }
+2 -2
pkgs/tools/admin/salt/default.nix
··· 8 8 9 9 python2Packages.buildPythonApplication rec { 10 10 name = "salt-${version}"; 11 - version = "2016.11.2"; 11 + version = "2016.11.4"; 12 12 13 13 src = fetchurl { 14 14 url = "mirror://pypi/s/salt/${name}.tar.gz"; 15 - sha256 = "0hrss5x47cr7ffyjl8jlkhf9j88lqvg7c33rjc5bimck8b7x7hzm"; 15 + sha256 = "0pvn0pkndwx81xkpah14awz4rg9zhkpl4bhn3hlrin1zinr0jhgv"; 16 16 }; 17 17 18 18 propagatedBuildInputs = with python2Packages; [