anchor.diff:          Pid Directory = "/run";
           ${sd_cfg.extraStorageConfig}
         }
  - 
  +
  +      ${concatStringsSep "\n" (mapAttrsToList (name: value: ''
  +      Autochanger {
  +        Name = "${name}";
  +        Device = ${concatStringsSep ", " (map (a: "\"${a}\"") value.devices)};
  +        Changer Device =  "${value.changerDevice}";
  +        Changer Command = "${value.changerCommand}";
  +        ${value.extraAutochangerConfig}
  +      }
  +      '') sd_cfg.autochanger)}
  +
         ${concatStringsSep "\n" (mapAttrsToList (name: value: ''
         Device {
           Name = "${name}";
  
positive.code:         '';
          type = with types; attrsOf (submodule deviceOptions);
        };
   
        extraStorageConfig = mkOption {
          default = "";
          description = ''
  
negative.code:         default = "no";
          example = "yes";
          description = ''
            If Monitor is set to <literal>no</literal>, this director will have
            full access to this Storage daemon. If Monitor is set to
            <literal>yes</literal>, this director will only be able to fetch the
            current status of this Storage daemon.
  
            Please note that if this director is being used by a Monitor, we
            highly recommend to set this directive to yes to avoid serious
            security problems. 
          '';
        };
      };
    };
  
    autochangerOptions = {...}:
    {
      options = {
        changerDevice = mkOption {
          description = ''
            The specified name-string must be the generic SCSI device name of the
            autochanger that corresponds to the normal read/write Archive Device
            specified in the Device resource. This generic SCSI device name
            should be specified if you have an autochanger or if you have a
            standard tape drive and want to use the Alert Command (see below).
            For example, on Linux systems, for an Archive Device name of
            <literal>/dev/nst0</literal>, you would specify
            <literal>/dev/sg0</literal> for the Changer Device name.  Depending
            on your exact configuration, and the number of autochangers or the
            type of autochanger, what you specify here can vary. This directive
            is optional. See the Using AutochangersAutochangersChapter chapter of
            this manual for more details of using this and the following
            autochanger directives.         
            '';
        };
  
        changerCommand = mkOption {
          description = ''
            The name-string specifies an external program to be called that will
            automatically change volumes as required by Bacula. Normally, this
            directive will be specified only in the AutoChanger resource, which
            is then used for all devices. However, you may also specify the
            different Changer Command in each Device resource. Most frequently,
            you will specify the Bacula supplied mtx-changer script as follows:
  
            <literal>"/path/mtx-changer %c %o %S %a %d"</literal>
  
            and you will install the mtx on your system (found in the depkgs
            release). An example of this command is in the default bacula-sd.conf
            file. For more details on the substitution characters that may be
            specified to configure your autochanger please see the
            AutochangersAutochangersChapter chapter of this manual. For FreeBSD
            users, you might want to see one of the several chio scripts in
            examples/autochangers.
            '';
          default = "/etc/bacula/mtx-changer %c %o %S %a %d";
        };
  
        devices = mkOption {
          description = ''
          '';
        };
  
        extraAutochangerConfig = mkOption {
          default = "";
          description = ''
            Extra configuration to be passed in Autochanger directive.
          '';
          example = ''
     
          '';
        };
      };
    };
  
  
    deviceOptions = {...}:
    {
  