From ee02393220ad7031c93a6357e20fbf9b7c5d944b Mon Sep 17 00:00:00 2001 From: Jordan Holt Date: Sun, 16 Mar 2025 11:40:22 +0000 Subject: [PATCH] hyprland: add notification daemon --- hosts/odyssey/default.nix | 1 + hosts/odyssey/zonos-container.nix | 72 +++++++++++++++++++++++ modules/home-manager/options.nix | 1 + modules/nixos/podman.nix | 3 - modules/nixos/system/desktop/hyprland.nix | 1 + 5 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 hosts/odyssey/zonos-container.nix diff --git a/hosts/odyssey/default.nix b/hosts/odyssey/default.nix index d4ac9e2..2f2a8cf 100644 --- a/hosts/odyssey/default.nix +++ b/hosts/odyssey/default.nix @@ -9,6 +9,7 @@ imports = [ ./hardware-configuration.nix ./gitea-runner.nix + ./zonos-container.nix ../desktop.nix ]; diff --git a/hosts/odyssey/zonos-container.nix b/hosts/odyssey/zonos-container.nix new file mode 100644 index 0000000..d2b7fa1 --- /dev/null +++ b/hosts/odyssey/zonos-container.nix @@ -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" ]; + }; +} diff --git a/modules/home-manager/options.nix b/modules/home-manager/options.nix index c0010b9..e8f8b60 100644 --- a/modules/home-manager/options.nix +++ b/modules/home-manager/options.nix @@ -88,6 +88,7 @@ with lib; isNormalUser = true; extraGroups = [ "audio" + "docker" "lxd" "networkmanager" "wheel" diff --git a/modules/nixos/podman.nix b/modules/nixos/podman.nix index 848eb94..87752e1 100644 --- a/modules/nixos/podman.nix +++ b/modules/nixos/podman.nix @@ -21,8 +21,6 @@ in config = mkIf cfg.enable { virtualisation = { - docker.enable = false; - podman = { enable = true; defaultNetwork.settings.dns_enabled = true; @@ -40,7 +38,6 @@ in runroot = "/run/containers/storage"; }; - oci-containers.backend = "podman"; }; networking.firewall.interfaces."podman+" = { diff --git a/modules/nixos/system/desktop/hyprland.nix b/modules/nixos/system/desktop/hyprland.nix index 4ea83c5..1dd0238 100644 --- a/modules/nixos/system/desktop/hyprland.nix +++ b/modules/nixos/system/desktop/hyprland.nix @@ -33,6 +33,7 @@ in user.packages = with pkgs.unstable; [ anyrun clipse + dunst hyprpaper kitty mpv