mirror of
https://github.com/Stunkymonkey/nixos.git
synced 2025-05-24 09:54:40 +02:00
system/docker: modularize
This commit is contained in:
parent
082478e688
commit
19520eae7f
5 changed files with 40 additions and 15 deletions
7
modules/system/default.nix
Normal file
7
modules/system/default.nix
Normal file
|
@ -0,0 +1,7 @@
|
|||
{ ... }:
|
||||
{
|
||||
imports = [
|
||||
./docker
|
||||
];
|
||||
}
|
||||
|
22
modules/system/docker/default.nix
Normal file
22
modules/system/docker/default.nix
Normal file
|
@ -0,0 +1,22 @@
|
|||
# Docker related settings
|
||||
{ config, inputs, lib, options, pkgs, ... }:
|
||||
let
|
||||
cfg = config.my.system.docker;
|
||||
in
|
||||
{
|
||||
options.my.system.docker = with lib; {
|
||||
enable = mkEnableOption "docker configuration";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
environment.systemPackages = with pkgs; [
|
||||
docker
|
||||
docker-compose
|
||||
];
|
||||
|
||||
virtualisation.docker = {
|
||||
enable = true;
|
||||
autoPrune.enable = true;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue