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" "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-compat": {
"flake": false, "flake": false,
"locked": { "locked": {
@ -271,6 +288,7 @@
"inputs": { "inputs": {
"agenix": "agenix", "agenix": "agenix",
"deploy-rs": "deploy-rs", "deploy-rs": "deploy-rs",
"element-themes": "element-themes",
"flake-parts": "flake-parts", "flake-parts": "flake-parts",
"home-manager": "home-manager", "home-manager": "home-manager",
"keycloak-theme-pub-solar": "keycloak-theme-pub-solar", "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.url = "git+https://git.pub.solar/pub-solar/infra-vintage?ref=main&dir=vmtools";
triton-vmtools.inputs.nixpkgs.follows = "nixpkgs"; triton-vmtools.inputs.nixpkgs.follows = "nixpkgs";
element-themes.url = "github:aaronraimist/element-themes/master";
element-themes.flake = false;
}; };
outputs = inputs@{ self, ... }: outputs = inputs@{ self, ... }:

View file

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

View file

@ -5,7 +5,7 @@ let
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
add_header X-XSS-Protection "1; mode=block"; 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: { wellKnownClient = domain: {
"m.homeserver".base_url = "https://matrix.${domain}"; "m.homeserver".base_url = "https://matrix.${domain}";
"m.identity_server".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; forgejo-actions-runner = inputs.unstable.legacyPackages.${prev.system}.forgejo-actions-runner;
mediawiki = inputs.unstable.legacyPackages.${prev.system}.mediawiki; 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
'';
}