Rebase to flake parts #7
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
{ ... }: {
|
||||
flake.nixosModules.systemDocker =
|
||||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
cfg = config.chiasson.system.docker;
|
||||
in
|
||||
{
|
||||
options.chiasson.system.docker = {
|
||||
enable = lib.mkEnableOption ''
|
||||
`virtualisation.docker` — add users to `docker` if they need the socket.
|
||||
'';
|
||||
|
||||
compose.enable = lib.mkOption {
|
||||
type = lib.types.bool;
|
||||
default = true;
|
||||
description = "Install `docker-compose` in `environment.systemPackages`.";
|
||||
};
|
||||
|
||||
daemonSettings = lib.mkOption {
|
||||
type = lib.types.attrs;
|
||||
default = { };
|
||||
description = "Merged into `virtualisation.docker.daemon.settings`.";
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
enableOnBoot = true;
|
||||
daemon.settings = cfg.daemonSettings;
|
||||
};
|
||||
|
||||
environment.systemPackages = lib.optionals cfg.compose.enable [ pkgs.docker-compose ];
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user