try docker
This commit is contained in:
@@ -76,6 +76,12 @@
|
|||||||
steam.enable = false;
|
steam.enable = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
docker = {
|
||||||
|
enable = true;
|
||||||
|
|
||||||
|
portainer.enable = true;
|
||||||
|
};
|
||||||
|
|
||||||
virtualization = {
|
virtualization = {
|
||||||
traefik.enable = true;
|
traefik.enable = true;
|
||||||
jellyfin.enable = true;
|
jellyfin.enable = true;
|
||||||
@@ -101,7 +107,7 @@
|
|||||||
|
|
||||||
rustdesk.enable = false; #broken
|
rustdesk.enable = false; #broken
|
||||||
|
|
||||||
pihole.enable = true; #broken
|
pihole.enable = false; #broken
|
||||||
|
|
||||||
code-server.enable = false;
|
code-server.enable = false;
|
||||||
|
|
||||||
@@ -109,7 +115,7 @@
|
|||||||
|
|
||||||
minecraft.enable = true;
|
minecraft.enable = true;
|
||||||
|
|
||||||
#sandbox.enable = false;
|
sandbox.enable = false;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
37
system/services/docker/default.nix
Normal file
37
system/services/docker/default.nix
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{ config, lib, ... }: {
|
||||||
|
|
||||||
|
options.sysconfig.docker = {
|
||||||
|
enable = with lib; mkOption {
|
||||||
|
type = with types; bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
nvidia = with lib; mkOption {
|
||||||
|
type = with types; bool;
|
||||||
|
default = false;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
imports = let
|
||||||
|
dir = builtins.readDir ./.;
|
||||||
|
in builtins.map (x: ./${x}) (builtins.filter
|
||||||
|
(file: (dir.${file} == "directory"))
|
||||||
|
(builtins.attrNames dir)
|
||||||
|
);
|
||||||
|
|
||||||
|
config = lib.mkIf config.sysconfig.docker.enable {
|
||||||
|
|
||||||
|
virtualisation = {
|
||||||
|
docker = {
|
||||||
|
enable = true;
|
||||||
|
storageDriver = "btrfs";
|
||||||
|
};
|
||||||
|
|
||||||
|
oci-containers = {
|
||||||
|
backend = "docker";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
hardware.nvidia-container-toolkit.enable = config.sysconfig.docker.nvidia;
|
||||||
|
};
|
||||||
|
}
|
||||||
1
system/services/docker/ollama/default.nix
Normal file
1
system/services/docker/ollama/default.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{ ... }: {}
|
||||||
1
system/services/docker/pihole/default.nix
Normal file
1
system/services/docker/pihole/default.nix
Normal file
@@ -0,0 +1 @@
|
|||||||
|
{ ... }: {}
|
||||||
26
system/services/docker/portainer/default.nix
Normal file
26
system/services/docker/portainer/default.nix
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{ config, lib, ... }: lib.mkIf config.sysconfig.services.docker.enable {
|
||||||
|
|
||||||
|
options.sysconfig.docker.portainer.enable = with lib; mkOption {
|
||||||
|
type = with types; bool;
|
||||||
|
default = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
config = lib.mkIf config.sysconfig.docker.portainer.enable {
|
||||||
|
|
||||||
|
virtualisation.oci-containers.contianers.portainer = {
|
||||||
|
image = "portainer/portainer-ce";
|
||||||
|
|
||||||
|
pull = "newer";
|
||||||
|
|
||||||
|
ports = [
|
||||||
|
"127.0.0.1:8000:8000"
|
||||||
|
"127.0.0.1:9000:9000"
|
||||||
|
];
|
||||||
|
|
||||||
|
volumes = [
|
||||||
|
"vol_portainer:/data"
|
||||||
|
"/run/docker.sock:/var/run/docker.sock"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user