mirror of
https://github.com/ItsDrike/nixdots
synced 2024-12-25 06:54:35 +00:00
Add docker
This commit is contained in:
parent
b8ae87b938
commit
618144c7ac
|
@ -37,6 +37,7 @@
|
|||
username = "itsdrike";
|
||||
|
||||
sound.enable = true;
|
||||
docker.enable = true;
|
||||
|
||||
impermanence = {
|
||||
root = {
|
||||
|
@ -48,6 +49,7 @@
|
|||
|
||||
extraDirectories = [
|
||||
"/var/log"
|
||||
"/var/lib/docker"
|
||||
];
|
||||
};
|
||||
|
||||
|
|
|
@ -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";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -7,5 +7,6 @@ _: {
|
|||
./thermald.nix
|
||||
./journald.nix
|
||||
./fstrim.nix
|
||||
./docker.nix
|
||||
];
|
||||
}
|
||||
|
|
16
system/shared/services/docker.nix
Normal file
16
system/shared/services/docker.nix
Normal 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;
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Reference in a new issue