propellor-5.1.0: property-based host configuration management in haskell

MaintainerSean Whitton <>
Safe HaskellNone




Build and maintain schroots for use with sbuild.

For convenience we set up several enhancements, such as ccache and eatmydata. This means we have to make several assumptions:

  1. you want to build for a Debian release strictly newer than squeeze, or for a Buntish release newer than or equal to trusty
  2. if you want to build for Debian stretch or newer, you have sbuild 0.70.0 or newer

The latter is due to the migration from GnuPG v1 to GnuPG v2.1 in Debian stretch, which older sbuild can't handle.

Suggested usage in config.hs:

 mybox = host "" $ props
 	& osDebian (Stable "stretch") X86_64
 	& Apt.useLocalCacher
 	& sidSchrootBuilt
 	& Sbuild.usableBy (User "spwhitton")
 	& Schroot.overlaysInTmpfs
 	sidSchrootBuilt = Sbuild.built Sbuild.UseCcache $ props
 		& osDebian Unstable X86_32
 		& Sbuild.update `period` Weekly (Just 1)
 		& Sbuild.useHostProxy mybox

If you are using sbuild older than 0.70.0, you also need:

 & Sbuild.keypairGenerated

To take advantage of the piuparts and autopkgtest support, add to your ~/.sbuildrc (assumes sbuild 0.71.0 or newer):

 $piuparts_opts = [

 $autopkgtest_root_args = "";
 $autopkgtest_opts = ["--", "schroot", "%r-%a-sbuild"];


Creating and updating sbuild schroots

data UseCcache Source #

Whether an sbuild schroot should use ccache during builds

ccache is generally useful but it breaks building some packages. This data types allows you to toggle it on and off for particular schroots.



built :: UseCcache -> Props metatypes -> RevertableProperty (HasInfo + DebianLike) Linux Source #

Build and configure a schroot for use with sbuild

The second parameter should specify, at a minimum, the operating system for the schroot. This is usually done using a property like osDebian

Properties for use inside sbuild schroots

update :: Property DebianLike Source #

Ensure that an sbuild schroot's packages and apt indexes are updated

This replaces use of sbuild-update(1).

useHostProxy :: Host -> Property DebianLike Source #

Ensure that an sbuild schroot uses the host's Apt proxy.

This property is standardly used when the host has useLocalCacher.

Global sbuild configuration

keypairGenerated :: Property DebianLike Source #

Generate the apt keys needed by sbuild

You only need this if you are using sbuild older than 0.70.0.

keypairInsecurelyGenerated :: Property DebianLike Source #

Generate the apt keys needed by sbuild using a low-quality source of randomness

Note that any running rngd will be killed; if you are using rngd, you should arrange for it to be restarted after this property has been ensured. E.g.

 & Sbuild.keypairInsecurelyGenerated
 	`onChange` Systemd.started "my-rngd-service"

Useful on throwaway build VMs.

You only need this if you are using sbuild older than 0.70.0.

usableBy :: User -> Property DebianLike Source #

Add an user to the sbuild group in order to use sbuild

userConfig :: User -> Property DebianLike Source #

Maintain recommended ~/.sbuildrc for a user, and adds them to the sbuild group

You probably want a custom ~/.sbuildrc on your workstation, but this property is handy for quickly setting up build boxes.