element: Add themes #70

Merged
axeman merged 1 commit from feat/element-themes into main 2023-11-19 16:22:04 +00:00
6 changed files with 39 additions and 8 deletions

View file

@ -70,6 +70,23 @@
"type": "github"
}
},
"element-themes": {
"flake": false,
"locked": {
"lastModified": 1690602100,
"narHash": "sha256-fc/YOx5Py0iOBg2Aw3qjl0SHm+byIjuKdU1b/3q0FXs=",
"owner": "aaronraimist",
"repo": "element-themes",
"rev": "b1dbe27acee74cebe180538ef215208a1c26dc02",
"type": "github"
},
"original": {
"owner": "aaronraimist",
"ref": "master",
"repo": "element-themes",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@ -271,6 +288,7 @@
"inputs": {
"agenix": "agenix",
"deploy-rs": "deploy-rs",
"element-themes": "element-themes",
"flake-parts": "flake-parts",
"home-manager": "home-manager",
"keycloak-theme-pub-solar": "keycloak-theme-pub-solar",

View file

@ -28,6 +28,9 @@
triton-vmtools.url = "git+https://git.pub.solar/pub-solar/infra-vintage?ref=main&dir=vmtools";
triton-vmtools.inputs.nixpkgs.follows = "nixpkgs";
element-themes.url = "github:aaronraimist/element-themes/master";
element-themes.flake = false;
};
outputs = inputs@{ self, ... }:

View file

@ -1,4 +1,4 @@
{
{ pkgs, lib, ... }: {
default_server_config = {
"m.homeserver" = {
base_url = "https://matrix.test.pub.solar";
@ -8,12 +8,11 @@
base_url = "";
};
};
# TODO: Add themes
# setting_defaults = {
# custom_themes = {{ matrix_client_element_setting_defaults_custom_themes | to_json }}
# };
# default_theme = {{ matrix_client_element_default_theme | string | to_json }};
# default_country_code = {{ matrix_client_element_default_country_code | string | to_json }};
setting_defaults = {
custom_themes = (lib.modules.importJSON "${pkgs.element-themes}").config;
};
default_theme = "light";
default_country_code = "DE";
permalink_prefix = "https://matrix.to";
disable_custom_urls = true;
disable_guests = true;

View file

@ -5,7 +5,7 @@ let
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-XSS-Protection "1; mode=block";
'';
clientConfig = import ./matrix/element-client-config.nix;
clientConfig = import ./matrix/element-client-config.nix { inherit lib pkgs; };
wellKnownClient = domain: {
"m.homeserver".base_url = "https://matrix.${domain}";
"m.identity_server".base_url = "https://matrix.${domain}";

View file

@ -13,6 +13,8 @@
forgejo-actions-runner = inputs.unstable.legacyPackages.${prev.system}.forgejo-actions-runner;
mediawiki = inputs.unstable.legacyPackages.${prev.system}.mediawiki;
element-themes = prev.callPackage ./pkgs/element-themes { inherit (inputs) element-themes; };
})
];
});

View file

@ -0,0 +1,9 @@
{ stdenvNoCC, jq, element-themes }:
stdenvNoCC.mkDerivation {
src = element-themes;
name = "element-themes";
nativeBuildInputs = [ jq ];
buildPhase = ''
find "$src" -name '*.json' -print0 | xargs -0 jq -s '.' > $out
'';
}