Add docker

This commit is contained in:
ItsDrike 2024-08-24 10:33:53 +02:00
parent b8ae87b938
commit 618144c7ac
Signed by: ItsDrike
GPG key ID: FA2745890B7048C0
4 changed files with 30 additions and 3 deletions

View file

@ -37,6 +37,7 @@
username = "itsdrike";
sound.enable = true;
docker.enable = true;
impermanence = {
root = {
@ -48,6 +49,7 @@
extraDirectories = [
"/var/log"
"/var/lib/docker"
];
};

View file

@ -1,6 +1,5 @@
{lib, ...}:
with lib; let
inherit (lib) mkOption;
{lib, ...}: let
inherit (lib) mkOption mkEnableOption types;
in {
imports = [
./boot
@ -21,5 +20,14 @@ in {
sound = {
enable = mkEnableOption "sound related programs and audio-dependent programs";
};
docker = {
enable = mkEnableOption "docker virtualisation platform";
data-root = mkOption {
type = types.str;
description = "Path to the directory where docker data should be stored";
default = "/var/lib/docker";
};
};
};
}

View file

@ -7,5 +7,6 @@ _: {
./thermald.nix
./journald.nix
./fstrim.nix
./docker.nix
];
}

View file

@ -0,0 +1,16 @@
{
lib,
config,
...
}: let
cfg = config.myOptions.system.docker;
in {
config = lib.mkIf cfg.enable {
virtualisation.docker = {
enable = true;
storageDriver = "btrfs";
daemon.settings.data-root = cfg.data-root;
};
};
}