Compare commits
3 commits
c059379233
...
a48d9ae8d0
Author | SHA1 | Date | |
---|---|---|---|
![]() |
a48d9ae8d0 | ||
![]() |
58e63b2f3b | ||
![]() |
569c340756 |
3 changed files with 30 additions and 13 deletions
|
@ -8,13 +8,23 @@ let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
inherit (lib.options) mkEnableOption;
|
inherit (lib.options) mkEnableOption;
|
||||||
inherit (lib.lists) singleton;
|
inherit (lib.lists) singleton;
|
||||||
|
inherit (builtins) toJSON;
|
||||||
|
|
||||||
cfg = config.modules.system.services.matrix;
|
cfg = config.modules.system.services.matrix;
|
||||||
|
|
||||||
registrationToken = config.sops.secrets.tuwunel_token_file.path;
|
registrationToken = config.sops.secrets.tuwunel_token_file.path;
|
||||||
|
|
||||||
port = 4926;
|
port = 4926;
|
||||||
domain = "matrix.faukah.com";
|
domain = "faukah.com";
|
||||||
|
|
||||||
|
# Taken from Max Privatevoid.
|
||||||
|
serverFederation = pkgs.writeText "server_federation.json" (toJSON {
|
||||||
|
"m.server" = "matrix.${domain}:443";
|
||||||
|
});
|
||||||
|
|
||||||
|
clientFederation = pkgs.writeText "client_federation.json" (toJSON {
|
||||||
|
"m.homeserver".base_url = "https://matrix.${domain}";
|
||||||
|
});
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
options.modules.system.services.matrix.enable = mkEnableOption "matrix";
|
options.modules.system.services.matrix.enable = mkEnableOption "matrix";
|
||||||
|
@ -25,10 +35,16 @@ in
|
||||||
virtualHosts.${domain} = {
|
virtualHosts.${domain} = {
|
||||||
addSSL = true;
|
addSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations."/" = {
|
locations = {
|
||||||
proxyPass = "http://localhost:${toString port}";
|
"= /.well-known/matrix/server".alias = serverFederation;
|
||||||
|
"= /.well-known/matrix/client".alias = clientFederation;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
virtualHosts."matrix.${domain}" = {
|
||||||
|
addSSL = true;
|
||||||
|
enableACME = true;
|
||||||
|
locations."/_matrix".proxyPass = "http://localhost:${toString port}";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
matrix-tuwunel = {
|
matrix-tuwunel = {
|
||||||
|
@ -45,6 +61,7 @@ in
|
||||||
allow_registration = true;
|
allow_registration = true;
|
||||||
allow_federation = true;
|
allow_federation = true;
|
||||||
allow_encryption = true;
|
allow_encryption = true;
|
||||||
|
new_user_displayname_suffix = "";
|
||||||
registration_token_file = registrationToken;
|
registration_token_file = registrationToken;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
_: {
|
{
|
||||||
zramSwap = {
|
zramSwap = {
|
||||||
enable = true;
|
enable = true;
|
||||||
algorithm = "zstd";
|
algorithm = "zstd";
|
||||||
|
|
|
@ -295,29 +295,29 @@ in
|
||||||
(plain "Mod+Shift+Equal" [ (leaf "set-window-height" [ "+10%" ]) ])
|
(plain "Mod+Shift+Equal" [ (leaf "set-window-height" [ "+10%" ]) ])
|
||||||
(plain "Mod+Shift+F" [ (flag "fullscreen-window") ])
|
(plain "Mod+Shift+F" [ (flag "fullscreen-window") ])
|
||||||
(plain "Mod+Shift+H" [ (flag "move-column-left-or-to-monitor-left") ])
|
(plain "Mod+Shift+H" [ (flag "move-column-left-or-to-monitor-left") ])
|
||||||
# (plain "Mod+Shift+I" [ (flag "move-column-to-workspace-up") ])
|
(plain "Mod+Shift+I" [ (flag "move-column-to-workspace-up") ])
|
||||||
# (plain "Mod+Shift+J" [ (flag "move-window-down-or-to-workspace-down") ])
|
(plain "Mod+Shift+J" [ (flag "move-window-down-or-to-workspace-down") ])
|
||||||
# (plain "Mod+Shift+K" [ (flag "move-window-up-or-to-workspace-up") ])
|
(plain "Mod+Shift+K" [ (flag "move-window-up-or-to-workspace-up") ])
|
||||||
(plain "Mod+Shift+L" [ (flag "move-column-right-or-to-monitor-right") ])
|
(plain "Mod+Shift+L" [ (flag "move-column-right-or-to-monitor-right") ])
|
||||||
(plain "Mod+Shift+Minus" [ (leaf "set-window-height" [ "-10%" ]) ])
|
(plain "Mod+Shift+Minus" [ (leaf "set-window-height" [ "-10%" ]) ])
|
||||||
# (plain "Mod+Shift+Page_Down" [ (flag "move-column-to-workspace-down") ])
|
(plain "Mod+Shift+Page_Down" [ (flag "move-column-to-workspace-down") ])
|
||||||
(plain "Mod+Shift+Page_Up" [ (flag "move-column-to-workspace-up") ])
|
(plain "Mod+Shift+Page_Up" [ (flag "move-column-to-workspace-up") ])
|
||||||
(plain "Mod+Shift+P" [ (flag "power-off-monitors") ])
|
(plain "Mod+Shift+P" [ (flag "power-off-monitors") ])
|
||||||
(plain "Mod+Shift+R" [ (flag "switch-preset-window-height") ])
|
(plain "Mod+Shift+R" [ (flag "switch-preset-window-height") ])
|
||||||
# (plain "Mod+Shift+U" [ (flag "move-column-to-workspace-down") ])
|
(plain "Mod+Shift+U" [ (flag "move-column-to-workspace-down") ])
|
||||||
(plain "Mod+Shift+V" [ (flag "switch-focus-between-floating-and-tiling") ])
|
(plain "Mod+Shift+V" [ (flag "switch-focus-between-floating-and-tiling") ])
|
||||||
# (plain "Mod+Shift+WheelScrollDown" [ (flag "move-column-to-workspace-down") ])
|
(plain "Mod+Shift+WheelScrollDown" [ (flag "move-column-to-workspace-down") ])
|
||||||
(plain "Mod+Shift+WheelScrollLeft" [ (flag "move-column-left") ])
|
(plain "Mod+Shift+WheelScrollLeft" [ (flag "move-column-left") ])
|
||||||
(plain "Mod+Shift+WheelScrollRight" [ (flag "move-column-right") ])
|
(plain "Mod+Shift+WheelScrollRight" [ (flag "move-column-right") ])
|
||||||
# (plain "Mod+Shift+WheelScrollUp" [ (flag "move-column-to-workspace-up") ])
|
(plain "Mod+Shift+WheelScrollUp" [ (flag "move-column-to-workspace-up") ])
|
||||||
(plain "Mod+T" [ (flag "screenshot") ])
|
(plain "Mod+T" [ (flag "screenshot") ])
|
||||||
(plain "Mod+U" [ (flag "focus-workspace-down") ])
|
(plain "Mod+U" [ (flag "focus-workspace-down") ])
|
||||||
(plain "Mod+V" [ (flag "toggle-window-floating") ])
|
(plain "Mod+V" [ (flag "toggle-window-floating") ])
|
||||||
(plain "Mod+W" [ (flag "toggle-column-tabbed-display") ])
|
(plain "Mod+W" [ (flag "toggle-column-tabbed-display") ])
|
||||||
# (plain "Mod+WheelScrollDown" [ (flag "focus-workspace-down") ])
|
(plain "Mod+WheelScrollDown" [ (flag "focus-workspace-down") ])
|
||||||
(plain "Mod+WheelScrollLeft" [ (flag "focus-column-left") ])
|
(plain "Mod+WheelScrollLeft" [ (flag "focus-column-left") ])
|
||||||
(plain "Mod+WheelScrollRight" [ (flag "focus-column-right") ])
|
(plain "Mod+WheelScrollRight" [ (flag "focus-column-right") ])
|
||||||
# (plain "Mod+WheelScrollUp" [ (flag "focus-workspace-up") ])
|
(plain "Mod+WheelScrollUp" [ (flag "focus-workspace-up") ])
|
||||||
(plain "Print" [ (flag "screenshot") ])
|
(plain "Print" [ (flag "screenshot") ])
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue