spacemacs/layers/+tools/cfengine
syl20bnr ebe4c60264 Revert "Defer packages by default using use-package-always-defer"
This reverts commit 29c78ce841 and all other fixes
that have been made afterwards.

The motivation is that use-package is seen by many as a replacement for
`require`. Is use-package always defer the loading of packages then is breaks
this use case, this does not respect POLA so even if it was making Spacemacs
loading faster (up to 3s faster on some startup on my machine) we just cannot
use it, it would be irresponsible. Spacemacs should be easy to use, loading
performance will come with time but it is not a priority.
2018-03-03 23:40:10 -05:00
..
img Replace +config-files category by +tools category 2016-06-09 23:56:09 -04:00
packages.el Revert "Defer packages by default using use-package-always-defer" 2018-03-03 23:40:10 -05:00
README.org Fix doc for common-lisp, bibtex, cfengine and gnus layer 2018-01-12 00:37:15 -05:00

CFEngine layer

/TakeV/spacemacs/media/commit/bf61b1500a8d0a11bc6c4ce8622eaf70df49979e/layers/+tools/cfengine/img/agent.png

Description

This layer adds support for CFEngine policies to Spacemacs.

Features:

  • Syntax highlighting
  • On the fly syntax checking via flycheck integration.
  • Auto completion via company integration.
  • Execution of cfengine3 SRC blocks in org-mode via ob-cfengine3 package.

Install

Add cfengine to the dotspacemacs-configuration-layers in your ~/.spacemacs to use this layer.

Configuration

Set file permission on save

Here is a function to set permissions to 600 on save, this can help avoid errors like:

File ./example.cf (owner 1000) is writable by others (security exception)

  (defun cfengine-permissions-policy-owner-only ()
    "If file starts with a shebang, make `buffer-file-name' executable"
    (save-excursion
      (set-file-modes buffer-file-name #o600)
      (message (concat "Made " buffer-file-name " accessibly only by the owner (600)."))))

  (add-hook 'after-save-hook 'cfengine-permissions-policy-owner-only nil 'make-it-local)

Indendation

If you like attributes to be intended from the promiser set Indentation amount from anchor to 2. For example:

  bundle agent main
  {
    vars:

        "promiser"
          string => "value",
          comment => "Indented 2 spaces from promiser";
  }

Execution of cfengine3 SRC blocks

This layers add support for cfengine3 source blocks in org files. With the insertion point inside the SRC block press ,, or CTRL-c Ctrl-c

  bundle agent main
  {
    reports:

        "Hello World!";
  }
R: Hello World!

See the ob-cfengine3 README for information on controlling inclusion of the stdlib, definition of classes and controlling the bundlesequence using header args.

To suppress the confirmation when executing a block set (setq org-confirm-babel-evaluate nil) in dotspacemacs/user-config().

Key bindings

Key Binding Description
SPC m j Reformats JSON string