From ff9703e542abbea50c31f8577ebf54f02aedaf3b Mon Sep 17 00:00:00 2001 From: teutat3s Date: Tue, 30 Apr 2024 00:52:07 +0200 Subject: [PATCH] matrix: init stickerpicker --- flake.lock | 45 +++++++++++++++++++ flake.nix | 7 +++ modules/nginx-matrix/default.nix | 6 +++ overlays/default.nix | 1 + .../pkgs/element-stickerpicker/default.nix | 9 ++++ terraform/dns.tf | 5 +++ 6 files changed, 73 insertions(+) create mode 100644 overlays/pkgs/element-stickerpicker/default.nix diff --git a/flake.lock b/flake.lock index ae2002c..28b37fc 100644 --- a/flake.lock +++ b/flake.lock @@ -71,6 +71,30 @@ "type": "github" } }, + "element-stickers": { + "inputs": { + "maunium-stickerpicker": [ + "maunium-stickerpicker" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714430716, + "narHash": "sha256-+WmgGbONe5u2wpvkUC5wNhYnrE6eziIv3Liq4pv7jro=", + "ref": "main", + "rev": "85716a9e30fb6fae47336ed0cae3d1425c80f17c", + "revCount": 6, + "type": "git", + "url": "https://git.pub.solar/pub-solar/maunium-stickerpicker-nix" + }, + "original": { + "ref": "main", + "type": "git", + "url": "https://git.pub.solar/pub-solar/maunium-stickerpicker-nix" + } + }, "element-themes": { "flake": false, "locked": { @@ -217,6 +241,25 @@ "url": "https://git.pub.solar/pub-solar/keycloak-theme" } }, + "maunium-stickerpicker": { + "flake": false, + "locked": { + "dir": "web", + "lastModified": 1668509918, + "narHash": "sha256-5Kbok9vJIlOti+ikpJXv2skdADhQQTjX5mVmBTM0wGU=", + "owner": "maunium", + "repo": "stickerpicker", + "rev": "f59406a47a6778cd402e656ffb64f667335f665a", + "type": "github" + }, + "original": { + "dir": "web", + "owner": "maunium", + "ref": "master", + "repo": "stickerpicker", + "type": "github" + } + }, "nix-darwin": { "inputs": { "nixpkgs": [ @@ -301,10 +344,12 @@ "inputs": { "agenix": "agenix", "deploy-rs": "deploy-rs", + "element-stickers": "element-stickers", "element-themes": "element-themes", "flake-parts": "flake-parts", "home-manager": "home-manager", "keycloak-theme-pub-solar": "keycloak-theme-pub-solar", + "maunium-stickerpicker": "maunium-stickerpicker", "nix-darwin": "nix-darwin", "nixos-flake": "nixos-flake", "nixpkgs": "nixpkgs", diff --git a/flake.nix b/flake.nix index 37c73d5..79c9858 100644 --- a/flake.nix +++ b/flake.nix @@ -31,6 +31,13 @@ element-themes.url = "github:aaronraimist/element-themes/master"; element-themes.flake = false; + + maunium-stickerpicker.url = "github:maunium/stickerpicker?ref=master&dir=web"; + maunium-stickerpicker.flake = false; + + element-stickers.url = "git+https://git.pub.solar/pub-solar/maunium-stickerpicker-nix?ref=main"; + element-stickers.inputs.maunium-stickerpicker.follows = "maunium-stickerpicker"; + element-stickers.inputs.nixpkgs.follows = "nixpkgs"; }; outputs = inputs@{ self, ... }: diff --git a/modules/nginx-matrix/default.nix b/modules/nginx-matrix/default.nix index b8f8265..dc978e6 100644 --- a/modules/nginx-matrix/default.nix +++ b/modules/nginx-matrix/default.nix @@ -76,6 +76,12 @@ in }; }; + "stickers.chat.pub.solar" = { + forceSSL = true; + enableACME = true; + root = pkgs.element-stickerpicker; + }; + "matrix.pub.solar" = { root = "/dev/null"; diff --git a/overlays/default.nix b/overlays/default.nix index 74cf409..da437e5 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -15,6 +15,7 @@ { forgejo-runner = unstable.forgejo-runner; element-themes = prev.callPackage ./pkgs/element-themes { inherit (inputs) element-themes; }; + element-stickerpicker = prev.callPackage ./pkgs/element-stickerpicker { inherit (inputs) element-stickers maunium-stickerpicker; }; }) ]; }); diff --git a/overlays/pkgs/element-stickerpicker/default.nix b/overlays/pkgs/element-stickerpicker/default.nix new file mode 100644 index 0000000..53489d0 --- /dev/null +++ b/overlays/pkgs/element-stickerpicker/default.nix @@ -0,0 +1,9 @@ +{ stdenvNoCC, element-stickers, maunium-stickerpicker }: +stdenvNoCC.mkDerivation { + src = maunium-stickerpicker; + name = "element-stickers"; + buildPhase = '' + mv web $out/ + cp ${element-stickers}/uploaded-packs/*.json $out/packs/ + ''; +} diff --git a/terraform/dns.tf b/terraform/dns.tf index 5fb7c0a..15e47c0 100644 --- a/terraform/dns.tf +++ b/terraform/dns.tf @@ -100,6 +100,11 @@ resource "namecheap_domain_records" "pub-solar" { type = "CNAME" address = "nachtigall.pub.solar." } + record { + hostname = "stickers.chat" + type = "CNAME" + address = "nachtigall.pub.solar." + } record { hostname = "wiki" type = "CNAME"