anchor.diff:      };
   
     };
  -  
   
     ###### implementation
   
  
positive.code:             example = true;
              type = types.bool;
              description = "
                Cipher the swap device to protect swapped data.
              ";
            };
  
  
negative.code:           command = ''
              if test -e "${config.device}"; then
                ${if config.cipher then ''
                    plainDevice="${config.device}"
                    name="crypt$(echo "$plainDevice" | sed -e 's,/,.,g')"
                    device="/dev/mapper/$name"
                    if ! test -e "$device"; then
                      ${cryptsetup}/sbin/cryptsetup -c aes -s 128 -d /dev/urandom create "$name" "$plainDevice"
                      ${utillinux}/sbin/mkswap -f "$device" || true
                    fi
                  ''
                  else ''
                    device="${config.device}"
                  ''
                }
                # Add new swap devices.
                if echo $unused | grep -q "^$device\$"; then
                  unused="$(echo $unused | grep -v "^$device\$")"
                else
                  ${utillinux}/sbin/swapon "$device" || true
                fi
              fi
            '';
          };
  