Compare commits
34 Commits
6cdaf9b06e
...
d1b805789b
Author | SHA1 | Date | |
---|---|---|---|
d1b805789b
|
|||
1001119829
|
|||
aaa944fd33
|
|||
ad6d6d4f15
|
|||
cd4b58ae90
|
|||
f7b7a65860
|
|||
050a93bc01
|
|||
c2659206a0
|
|||
7bc95779e7
|
|||
8b099e335c
|
|||
e64b4879c0
|
|||
9f1baa4c1e
|
|||
635b5c8921
|
|||
63583d9375
|
|||
c77a0e921a
|
|||
befc31158c
|
|||
556010c860
|
|||
ecbdfbaa7f
|
|||
7cd825d938
|
|||
2b76dbea66
|
|||
df0e6b2924
|
|||
4543939b17
|
|||
85ecd4a72a
|
|||
5d1f6aca74
|
|||
1f665646ea
|
|||
14b53c4321
|
|||
d8e0e78728
|
|||
7879fda102
|
|||
c1f28192a0
|
|||
d1c2adface
|
|||
ab75776ebe
|
|||
dba3b8944d
|
|||
0d8b1e7a37
|
|||
ee02393220
|
@@ -9,6 +9,7 @@
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./gitea-runner.nix
|
./gitea-runner.nix
|
||||||
./nix-serve.nix
|
./nix-serve.nix
|
||||||
|
./zonos-container.nix
|
||||||
../desktop.nix
|
../desktop.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
72
hosts/odyssey/zonos-container.nix
Normal file
72
hosts/odyssey/zonos-container.nix
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
# Auto-generated using compose2nix v0.3.2-pre.
|
||||||
|
{ pkgs, lib, ... }:
|
||||||
|
|
||||||
|
{
|
||||||
|
hardware.nvidia-container-toolkit.enable = true;
|
||||||
|
# Runtime
|
||||||
|
virtualisation.docker = {
|
||||||
|
enable = true;
|
||||||
|
# enableNvidia = true;
|
||||||
|
enableOnBoot = true;
|
||||||
|
autoPrune.enable = true;
|
||||||
|
daemon.settings.features.cdi = true;
|
||||||
|
rootless.enable = true;
|
||||||
|
rootless.daemon.settings.features.cdi = true;
|
||||||
|
};
|
||||||
|
virtualisation.oci-containers.backend = "docker";
|
||||||
|
|
||||||
|
# Containers
|
||||||
|
virtualisation.oci-containers.containers."zonos_container" = {
|
||||||
|
image = "compose2nix/zonos_container";
|
||||||
|
environment = {
|
||||||
|
"GRADIO_SHARE" = "False";
|
||||||
|
"NVIDIA_VISIBLE_DEVICES" = "0";
|
||||||
|
};
|
||||||
|
cmd = [
|
||||||
|
"python3"
|
||||||
|
"gradio_interface.py"
|
||||||
|
];
|
||||||
|
log-driver = "journald";
|
||||||
|
extraOptions = [
|
||||||
|
"--device=nvidia.com/gpu=0"
|
||||||
|
"--network=host"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
systemd.services."docker-zonos_container" = {
|
||||||
|
serviceConfig = {
|
||||||
|
Restart = lib.mkOverride 90 "no";
|
||||||
|
};
|
||||||
|
partOf = [
|
||||||
|
"docker-compose-zonos-root.target"
|
||||||
|
];
|
||||||
|
wantedBy = [
|
||||||
|
"docker-compose-zonos-root.target"
|
||||||
|
];
|
||||||
|
};
|
||||||
|
|
||||||
|
# Builds
|
||||||
|
systemd.services."docker-build-zonos_container" = {
|
||||||
|
path = [
|
||||||
|
pkgs.docker
|
||||||
|
pkgs.git
|
||||||
|
];
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "oneshot";
|
||||||
|
TimeoutSec = 900;
|
||||||
|
};
|
||||||
|
script = ''
|
||||||
|
cd /home/jordan/projects/jordan/Zonos
|
||||||
|
docker build -t compose2nix/zonos_container .
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
# Root service
|
||||||
|
# When started, this will automatically create all resources and start
|
||||||
|
# the containers. When stopped, this will teardown all resources.
|
||||||
|
systemd.targets."docker-compose-zonos-root" = {
|
||||||
|
unitConfig = {
|
||||||
|
Description = "Root target generated by compose2nix.";
|
||||||
|
};
|
||||||
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user