From 231d5836aa20bf4a80f3dea0dce1069aedaacb7b Mon Sep 17 00:00:00 2001 From: L-Nafaryus Date: Thu, 6 Mar 2025 19:27:05 +0500 Subject: [PATCH] fix: catarina: matrix client (element) validation --- nixosConfigurations/astora/users.nix | 64 +++---------------- nixosConfigurations/catarina/default.nix | 20 ++++++ .../catarina/services/matrix.nix | 1 + nixosConfigurations/catarina/users.nix | 33 +++++++++- nixosConfigurations/common/hm/nushell.nix | 3 +- nixosConfigurations/common/hm/wezterm.nix | 47 ++++++++++++++ nixosConfigurations/common/hm/yazi.nix | 13 ++++ nixosConfigurations/common/hm/zellij.nix | 17 +++++ nixosConfigurations/default.nix | 3 +- 9 files changed, 142 insertions(+), 59 deletions(-) create mode 100644 nixosConfigurations/common/hm/wezterm.nix create mode 100644 nixosConfigurations/common/hm/yazi.nix create mode 100644 nixosConfigurations/common/hm/zellij.nix diff --git a/nixosConfigurations/astora/users.nix b/nixosConfigurations/astora/users.nix index ad56444..d1e24f5 100644 --- a/nixosConfigurations/astora/users.nix +++ b/nixosConfigurations/astora/users.nix @@ -36,12 +36,16 @@ in { imports = [ (bonLib.injectArgs { inherit hmConfig; + inherit inputs; }) inputs.catppuccin.homeManagerModules.catppuccin inputs.ags.homeManagerModules.default #bonLib.preconfiguredModules.homeManager.hyprland ../common/hm/helix.nix ../common/hm/nushell.nix + ../common/hm/zellij.nix + ../common/hm/wezterm.nix + ../common/hm/yazi.nix ]; home.packages = with pkgs; [ @@ -132,6 +136,10 @@ in { # virtiofsd wl-clipboard + + ripgrep + repgrep + delta ]; xdg.portal = { @@ -262,61 +270,6 @@ in { # Graphical - wezterm = { - enable = true; - package = inputs.wezterm.packages.x86_64-linux.default; - extraConfig = '' - return { - default_prog = { "nu" }, - font_size = 10.0, - enable_tab_bar = true, - hide_tab_bar_if_only_one_tab = true, - term = "wezterm", - window_padding = { - left = 0, - right = 0, - top = 0, - bottom = 0 - }, - enable_wayland = true, - color_scheme = "gruvbox-dark", - color_schemes = { - ["gruvbox-dark"] = { - foreground = "#D4BE98", - background = "#282828", - cursor_bg = "#D4BE98", - cursor_border = "#D4BE98", - cursor_fg = "#282828", - selection_bg = "#D4BE98", - selection_fg = "#45403d", - - ansi = { "#282828", "#ea6962", "#a9b665", "#d8a657", "#7daea3", "#d3869b", "#89b482", "#d4be98" }, - brights = { "#eddeb5", "#ea6962", "#a9b665", "#d8a657", "#7daea3", "#d3869b", "#89b482", "#d4be98" } - } - }, - keys = { - { key = 'F11', action = wezterm.action.ToggleFullScreen } - } - } - ''; - }; - - zellij = { - enable = true; - settings = { - theme = "gruvbox-dark"; - default_mode = "normal"; - copy_command = "${lib.getExe' pkgs.wl-clipboard "wl-copy"}"; - copy_clipboard = "primary"; - }; - }; - - yazi = { - enable = true; - enableNushellIntegration = true; - enableBashIntegration = true; - }; - rofi = { enable = false; package = pkgs.rofi-wayland; @@ -396,6 +349,7 @@ in { home.sessionVariables = { HYPRSHOT_DIR = "${hmConfig.xdg.userDirs.pictures}/screenshots"; + GNUPGHOME = hmConfig.programs.gpg.homedir; }; }; diff --git a/nixosConfigurations/catarina/default.nix b/nixosConfigurations/catarina/default.nix index c9f750d..7123247 100644 --- a/nixosConfigurations/catarina/default.nix +++ b/nixosConfigurations/catarina/default.nix @@ -129,6 +129,26 @@ forceSSL = true; enableACME = true; root = "/var/www"; + + listen = [ + { + port = 8448; + addr = "0.0.0.0"; + ssl = true; + } + { + port = 443; + addr = "0.0.0.0"; + ssl = true; + } + ]; + locations."~ ^/(_matrix|.well_known)" = { + proxyPass = "http://127.0.0.1:6167"; + extraConfig = '' + proxy_http_version 1.0; + client_max_body_size 50M; + ''; + }; }; "*.elnafo.ru" = { diff --git a/nixosConfigurations/catarina/services/matrix.nix b/nixosConfigurations/catarina/services/matrix.nix index b913fc2..8fca8f4 100644 --- a/nixosConfigurations/catarina/services/matrix.nix +++ b/nixosConfigurations/catarina/services/matrix.nix @@ -44,6 +44,7 @@ }; }; }; + # Federation tester: https://federationtester.matrix.org/#elnafo.ru virtualHosts."matrix-federation" = { serverName = "elnafo.ru"; forceSSL = true; diff --git a/nixosConfigurations/catarina/users.nix b/nixosConfigurations/catarina/users.nix index 541c3f0..60215bf 100644 --- a/nixosConfigurations/catarina/users.nix +++ b/nixosConfigurations/catarina/users.nix @@ -1,8 +1,16 @@ { config, pkgs, + lib, + bonPkgs, + bonLib, + inputs, ... }: { + home-manager.useGlobalPkgs = true; + home-manager.useUserPackages = true; + home-manager.backupFileExtension = "hmbackup"; + # Users users.users.root.hashedPasswordFile = config.sops.secrets."users/root".path; @@ -12,13 +20,36 @@ description = "L-Nafaryus"; extraGroups = ["networkmanager" "wheel"]; group = "users"; - shell = pkgs.fish; + shell = pkgs.nushell; hashedPasswordFile = config.sops.secrets."users/l-nafaryus".path; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIG1YGp8AI48hJUSQBZpuKLpbj2+3Q09vq64NxFr0N1MS nafaryus" ]; }; + home-manager.users.l-nafaryus = {pkgs, ...}: let + hmConfig = config.home-manager.users.l-nafaryus; + in { + home.stateVersion = "23.11"; + home.username = "l-nafaryus"; + home.homeDirectory = "/home/l-nafaryus"; + imports = [ + (bonLib.injectArgs { + inherit hmConfig; + inherit inputs; + }) + ../common/hm/helix.nix + ../common/hm/nushell.nix + ../common/hm/zellij.nix + ../common/hm/yazi.nix + ]; + + home.packages = with pkgs; [ + ripgrep + repgrep + ]; + }; + users.users.nginx.extraGroups = ["acme" "papermc"]; users.users.kirill = { diff --git a/nixosConfigurations/common/hm/nushell.nix b/nixosConfigurations/common/hm/nushell.nix index 339a13c..d8a7a06 100644 --- a/nixosConfigurations/common/hm/nushell.nix +++ b/nixosConfigurations/common/hm/nushell.nix @@ -12,7 +12,7 @@ # for editing directly to config.nu extraConfig = '' let carapace_completer = {|spans| - carapace $spans.0 nushell $spans | from json + carapace $spans.0 nushell ...$spans | from json } $env.config = { show_banner: false, @@ -33,6 +33,7 @@ environmentVariables = { GNUPGHOME = hmConfig.programs.gpg.homedir; SSH_AUTH_SOCK = "/run/user/1000/ssh-agent"; + EDITOR = "${lib.getExe' hmConfig.programs.helix.package "hx"}"; }; }; diff --git a/nixosConfigurations/common/hm/wezterm.nix b/nixosConfigurations/common/hm/wezterm.nix new file mode 100644 index 0000000..fd27393 --- /dev/null +++ b/nixosConfigurations/common/hm/wezterm.nix @@ -0,0 +1,47 @@ +{ + pkgs, + lib, + config, + hmConfig, + inputs, + ... +}: { + programs.wezterm = { + enable = true; + package = inputs.wezterm.packages.x86_64-linux.default; + extraConfig = '' + return { + default_prog = { "nu" }, + font_size = 10.0, + enable_tab_bar = true, + hide_tab_bar_if_only_one_tab = true, + term = "wezterm", + window_padding = { + left = 0, + right = 0, + top = 0, + bottom = 0 + }, + enable_wayland = false, + color_scheme = "gruvbox-dark", + color_schemes = { + ["gruvbox-dark"] = { + foreground = "#D4BE98", + background = "#282828", + cursor_bg = "#D4BE98", + cursor_border = "#D4BE98", + cursor_fg = "#282828", + selection_bg = "#D4BE98", + selection_fg = "#45403d", + + ansi = { "#282828", "#ea6962", "#a9b665", "#d8a657", "#7daea3", "#d3869b", "#89b482", "#d4be98" }, + brights = { "#eddeb5", "#ea6962", "#a9b665", "#d8a657", "#7daea3", "#d3869b", "#89b482", "#d4be98" } + } + }, + keys = { + { key = 'F11', action = wezterm.action.ToggleFullScreen } + } + } + ''; + }; +} diff --git a/nixosConfigurations/common/hm/yazi.nix b/nixosConfigurations/common/hm/yazi.nix new file mode 100644 index 0000000..66100fe --- /dev/null +++ b/nixosConfigurations/common/hm/yazi.nix @@ -0,0 +1,13 @@ +{ + pkgs, + lib, + config, + hmConfig, + ... +}: { + programs.yazi = { + enable = true; + enableNushellIntegration = true; + enableBashIntegration = true; + }; +} diff --git a/nixosConfigurations/common/hm/zellij.nix b/nixosConfigurations/common/hm/zellij.nix new file mode 100644 index 0000000..dd0679b --- /dev/null +++ b/nixosConfigurations/common/hm/zellij.nix @@ -0,0 +1,17 @@ +{ + pkgs, + lib, + config, + hmConfig, + ... +}: { + programs.zellij = { + enable = true; + settings = { + theme = "gruvbox-dark"; + default_mode = "normal"; + copy_command = "${lib.getExe' pkgs.wl-clipboard "wl-copy"}"; + copy_clipboard = "primary"; + }; + }; +} diff --git a/nixosConfigurations/default.nix b/nixosConfigurations/default.nix index 741761e..2ac2e49 100644 --- a/nixosConfigurations/default.nix +++ b/nixosConfigurations/default.nix @@ -22,6 +22,7 @@ catarina = lib.nixosSystem { system = "x86_64-linux"; modules = with inputs; [ + home-manager.nixosModules.home-manager elnafo-radio.nixosModules.elnafo-radio nixos-mailserver.nixosModules.mailserver sops-nix.nixosModules.sops @@ -43,6 +44,4 @@ bonPkgs = self.packages.x86_64-linux; }; }; - - }