2014-04-01 06:42:18 -07:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
2014-03-17 06:04:39 -07:00
|
|
|
|
|
|
|
{
|
|
|
|
|
2014-04-01 06:42:18 -07:00
|
|
|
config = mkIf config.boot.isContainer {
|
2014-03-17 06:04:39 -07:00
|
|
|
|
2014-04-19 05:41:21 -07:00
|
|
|
# Disable some features that are not useful in a container.
|
2014-04-15 16:44:43 -07:00
|
|
|
sound.enable = mkDefault false;
|
2014-04-19 05:41:21 -07:00
|
|
|
services.udisks2.enable = mkDefault false;
|
2015-04-19 13:40:07 -07:00
|
|
|
powerManagement.enable = mkDefault false;
|
2014-04-15 16:44:43 -07:00
|
|
|
|
2014-04-18 07:40:27 -07:00
|
|
|
networking.useHostResolvConf = true;
|
|
|
|
|
2014-04-22 07:07:53 -07:00
|
|
|
# Containers should be light-weight, so start sshd on demand.
|
|
|
|
services.openssh.startWhenNeeded = mkDefault true;
|
|
|
|
|
2014-04-18 08:00:11 -07:00
|
|
|
# Shut up warnings about not having a boot loader.
|
|
|
|
system.build.installBootLoader = "${pkgs.coreutils}/bin/true";
|
|
|
|
|
2016-01-18 04:57:27 -08:00
|
|
|
# Not supported in systemd-nspawn containers.
|
|
|
|
security.audit.enable = false;
|
|
|
|
|
2014-03-17 06:04:39 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|