Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: be19ad150c45
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ea031fe7c15d
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on May 11, 2017

  1. Verified

    This commit was signed with the committer’s verified signature.
    mcollina Matteo Collina
    Copy the full SHA
    e22ccad View commit details
  2. Copy the full SHA
    ad67c28 View commit details
  3. Merge pull request #25696 from aneeshusa/add-salt-minion-service

    salt: Add minion service module
    Mic92 authored May 11, 2017
    Copy the full SHA
    ea031fe View commit details
Showing with 57 additions and 0 deletions.
  1. +1 −0 nixos/modules/module-list.nix
  2. +56 −0 nixos/modules/services/admin/salt/minion.nix
1 change: 1 addition & 0 deletions nixos/modules/module-list.nix
Original file line number Diff line number Diff line change
@@ -130,6 +130,7 @@
./security/wrappers/default.nix
./security/sudo.nix
./services/admin/salt/master.nix
./services/admin/salt/minion.nix
./services/amqp/activemq/default.nix
./services/amqp/rabbitmq.nix
./services/audio/alsa.nix
56 changes: 56 additions & 0 deletions nixos/modules/services/admin/salt/minion.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{ config, pkgs, lib, ... }:

with lib;

let

cfg = config.services.salt.minion;

fullConfig = lib.recursiveUpdate {
# Provide defaults for some directories to allow an immutable config dir
# NOTE: the config dir being immutable prevents `minion_id` caching

# Default is equivalent to /etc/salt/minion.d/*.conf
default_include = "/var/lib/salt/minion.d/*.conf";
# Default is in /etc/salt/pki/minion
pki_dir = "/var/lib/salt/pki/minion";
} cfg.configuration;
configDir = pkgs.writeTextDir "minion" (builtins.toJSON fullConfig);

in

{
options = {
services.salt.minion = {
enable = mkEnableOption "Salt minion service";
configuration = mkOption {
type = types.attrs;
default = {};
description = ''
Salt minion configuration as Nix attribute set.
See <link xlink:href="https://docs.saltstack.com/en/latest/ref/configuration/minion.html"/>
for details.
'';
};
};
};

config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [ salt ];
systemd.services.salt-minion = {
description = "Salt Minion";
wantedBy = [ "multi-user.target" ];
after = [ "network.target" ];
path = with pkgs; [
utillinux
];
serviceConfig = {
ExecStart = "${pkgs.salt}/bin/salt-minion --config-dir=${configDir}";
LimitNOFILE = 8192;
Type = "notify";
NotifyAccess = "all";
};
};
};
}