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

View file

@ -1,6 +1,5 @@
{lib, ...}: {lib, ...}: let
with lib; let inherit (lib) mkOption mkEnableOption types;
inherit (lib) mkOption;
in { in {
imports = [ imports = [
./boot ./boot
@ -21,5 +20,14 @@ in {
sound = { sound = {
enable = mkEnableOption "sound related programs and audio-dependent programs"; 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 ./thermald.nix
./journald.nix ./journald.nix
./fstrim.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;
};
};
}