From 689a95d690490cbccd794171bf27977294ea4426 Mon Sep 17 00:00:00 2001 From: Ingolf Wagner Date: Wed, 21 Jun 2023 08:34:43 +0200 Subject: [PATCH] add tts and stuff --- nixos/components/gui/home-manager/default.nix | 30 ++++++++----------- nixos/components/gui/home-manager/i3.nix | 5 ++++ nixos/machines/chungus/configuration.nix | 1 + nixos/machines/chungus/tts.nix | 29 ++++++++++++++++++ nixos/machines/robi/gitea.nix | 2 +- 5 files changed, 49 insertions(+), 18 deletions(-) create mode 100644 nixos/machines/chungus/tts.nix diff --git a/nixos/components/gui/home-manager/default.nix b/nixos/components/gui/home-manager/default.nix index 26fae36..35459bb 100644 --- a/nixos/components/gui/home-manager/default.nix +++ b/nixos/components/gui/home-manager/default.nix @@ -159,23 +159,19 @@ with lib; ''; # todo : still needed? - home.file.".xprofile".text = '' - # to allow sudo commands to access X - # todo : only allow the browsers and rambox access - ${pkgs.xorg.xhost}/bin/xhost + - - # no shitty pcspkr crap - ${pkgs.xorg.xset}/bin/xset -b - - # no sleeping monitor - ${pkgs.xorg.xset}/bin/xset -dpms - ${pkgs.xorg.xset}/bin/xset s off - - ${pkgs.flameshot}/bin/flameshot & - - # cleanup xmonad - rm -f ~/.xmonad/xmonad.state - ''; + # home.file.".xprofile".text = '' + # # to allow sudo commands to access X + # # todo : only allow the browsers and rambox access + # ${pkgs.xorg.xhost}/bin/xhost + + # # no shitty pcspkr crap + # ${pkgs.xorg.xset}/bin/xset -b + # # no sleeping monitor + # ${pkgs.xorg.xset}/bin/xset -dpms + # ${pkgs.xorg.xset}/bin/xset s off + # ${pkgs.flameshot}/bin/flameshot & + # # cleanup xmonad + # rm -f ~/.xmonad/xmonad.state + # ''; xdg.configFile."khal/config".text = '' [calendars] diff --git a/nixos/components/gui/home-manager/i3.nix b/nixos/components/gui/home-manager/i3.nix index 2175eb4..043df04 100644 --- a/nixos/components/gui/home-manager/i3.nix +++ b/nixos/components/gui/home-manager/i3.nix @@ -127,6 +127,9 @@ in config = { modifier = "Mod4"; terminal = "alacritty"; + focus = { + followMouse = true; + }; startup = let height = config.configuration.desktop.height; @@ -190,6 +193,7 @@ in }; }; }]; + colors = with colorTheme; { background = background; focused = { @@ -221,6 +225,7 @@ in text = foreground; }; }; + keybindings = { "Print" = "exec ${pkgs.flameshot}/bin/flameshot gui -c -p /share/"; "${cfg.config.modifier}+Return" = "exec ${cfg.config.terminal}"; diff --git a/nixos/machines/chungus/configuration.nix b/nixos/machines/chungus/configuration.nix index b53be21..0c25116 100644 --- a/nixos/machines/chungus/configuration.nix +++ b/nixos/machines/chungus/configuration.nix @@ -44,6 +44,7 @@ ./trilium.nix ./cache.nix + ./tts.nix ]; diff --git a/nixos/machines/chungus/tts.nix b/nixos/machines/chungus/tts.nix new file mode 100644 index 0000000..0a6c946 --- /dev/null +++ b/nixos/machines/chungus/tts.nix @@ -0,0 +1,29 @@ +{ pkgs +, config +, ... +}: { + + systemd.services.tts = { + after = [ "network.target" ]; + wantedBy = [ "multi-user.target" ]; + path = [ pkgs.espeak ]; + environment.HOME = "/var/lib/tts"; + serviceConfig = { + StateDirectory = "tts"; + DynamicUser = true; + User = "tts"; + Group = "tts"; + ExecStart = '' + ${pkgs.tts}/bin/tts-server --model_name tts_models/en/ljspeech/vits --port 5004 + ''; + }; + }; + + services.nginx = { + recommendedProxySettings = true; + enable = true; + virtualHosts."tts.${config.networking.hostName}.private" = { + locations."/".proxyPass = "http://localhost:5004"; + }; + }; +} diff --git a/nixos/machines/robi/gitea.nix b/nixos/machines/robi/gitea.nix index 7ce0ac6..4cb6b03 100644 --- a/nixos/machines/robi/gitea.nix +++ b/nixos/machines/robi/gitea.nix @@ -30,8 +30,8 @@ SHOW_FOOTER_VERSION = false; }; }; - }; backup.dirs = [ "/var/lib/gitea" ]; + }