From a6c96c23aea27c2b641b9d3603e7096e8474d8ca Mon Sep 17 00:00:00 2001 From: Henry-Hiles Date: Mon, 22 Sep 2025 19:06:54 -0400 Subject: [PATCH] use continuwuity from nixpkgs --- clients/quadraticserver/matrix/cinny.nix | 26 ++-- .../quadraticserver/matrix/continuwuity.nix | 63 ++++---- flake.nix | 137 ++++++++---------- modules/desktop/packages.nix | 1 - modules/graphical/packages.nix | 1 - 5 files changed, 106 insertions(+), 122 deletions(-) diff --git a/clients/quadraticserver/matrix/cinny.nix b/clients/quadraticserver/matrix/cinny.nix index 2bac6bc..643a3ed 100644 --- a/clients/quadraticserver/matrix/cinny.nix +++ b/clients/quadraticserver/matrix/cinny.nix @@ -6,19 +6,19 @@ homeserverList = ["federated.nexus"]; allowCustomHomeservers = false; }; - cinny-unwrapped = pkgs.cinny-unwrapped.overrideAttrs (old: rec { - src = pkgs.fetchFromGitHub { - owner = "GigiaJ"; - repo = "cinny"; - rev = "a299e9c4cb4df1a3b732fdfddb1297170251a10d"; - hash = "sha256-EDsDVOlaYT0S30Cml+t71U7OOKkfcE4aJxwE8iTdV3s="; - }; - npmDeps = pkgs.fetchNpmDeps { - inherit src; - name = "${old.pname}-${old.version}-npm-deps"; - hash = "sha256-k8eCQO1uIpoKpLHO3E3EYWbQSjcAya2AxngA9mvSfns="; - }; - }); + # cinny-unwrapped = pkgs.cinny-unwrapped.overrideAttrs (old: rec { + # src = pkgs.fetchFromGitHub { + # owner = "GigiaJ"; + # repo = "cinny"; + # rev = "a299e9c4cb4df1a3b732fdfddb1297170251a10d"; + # hash = "sha256-EDsDVOlaYT0S30Cml+t71U7OOKkfcE4aJxwE8iTdV3s="; + # }; + # npmDeps = pkgs.fetchNpmDeps { + # inherit src; + # name = "${old.pname}-${old.version}-npm-deps"; + # hash = "sha256-k8eCQO1uIpoKpLHO3E3EYWbQSjcAya2AxngA9mvSfns="; + # }; + # }); }} try_files {path} {path}/ /index.html file_server diff --git a/clients/quadraticserver/matrix/continuwuity.nix b/clients/quadraticserver/matrix/continuwuity.nix index d8b0c48..a462376 100644 --- a/clients/quadraticserver/matrix/continuwuity.nix +++ b/clients/quadraticserver/matrix/continuwuity.nix @@ -3,43 +3,40 @@ pkgs, lib, ... -}: -{ +}: { systemd.services.continuwuity.serviceConfig.Restart = lib.mkForce "always"; - services = - let - domain = "federated.nexus"; - subdomain = "matrix.${domain}"; - socket = "/var/run/continuwuity/continuwuity.sock"; - in - { - matrix-continuwuity = { - enable = true; - package = inputs.continuwuity.packages.${pkgs.system}.default; - group = "caddy"; - settings.global = { - server_name = domain; - unix_socket_path = socket; - new_user_displayname_suffix = ""; - allow_public_room_directory_over_federation = true; - trusted_servers = [ - "matrix.org" - "tchncs.de" - "maunium.net" - ]; - ignore_messages_from_server_names = [ ]; - url_preview_domain_explicit_allowlist = [ "*" ]; + services = let + domain = "federated.nexus"; + subdomain = "matrix.${domain}"; + socket = "/var/run/continuwuity/continuwuity.sock"; + in { + matrix-continuwuity = { + enable = true; + package = inputs.nixpkgs-continuwuity.legacyPackages.${pkgs.system}.matrix-continuwuity; + group = "caddy"; + settings.global = { + server_name = domain; + unix_socket_path = socket; + new_user_displayname_suffix = ""; + allow_public_room_directory_over_federation = true; + trusted_servers = [ + "matrix.org" + "tchncs.de" + "maunium.net" + ]; + ignore_messages_from_server_names = []; + url_preview_domain_explicit_allowlist = ["*"]; - well_known = { - client = "https://${subdomain}"; - server = "${subdomain}:443"; - support_email = "henry@henryhiles.com"; - support_mxid = "@quadradical:${domain}"; - }; + well_known = { + client = "https://${subdomain}"; + server = "${subdomain}:443"; + support_email = "henry@henryhiles.com"; + support_mxid = "@quadradical:${domain}"; }; }; - - caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}"; }; + + caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}"; + }; } diff --git a/flake.nix b/flake.nix index 998b994..43067af 100755 --- a/flake.nix +++ b/flake.nix @@ -2,14 +2,10 @@ inputs = { gnome-mobile.url = "github:chuangzhu/nixpkgs-gnome-mobile"; nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; - nixpkgs-lasuite.url = "github:Henry-Hiles/nixpkgs/bump-lasuite"; + nixpkgs-continuwuity.url = "github:savyajha/nixpkgs/continuwuity"; wrapper-manager.url = "github:viperML/wrapper-manager"; flake-parts.url = "github:hercules-ci/flake-parts"; nix-maid.url = "github:viperML/nix-maid"; - continuwuity = { - url = "path:/home/quadradical/Documents/Code/continuwuity"; - inputs.nixpkgs.follows = "nixpkgs"; - }; disko = { url = "github:nix-community/disko"; inputs.nixpkgs.follows = "nixpkgs"; @@ -64,49 +60,44 @@ }; }; - outputs = - inputs: - let - lib = inputs.nixpkgs.lib; - dirUtils = { - opt = lib.optionals; - dirFiles = type: dir: lib.filter (lib.hasSuffix type) (lib.filesystem.listFilesRecursive dir); - }; - system = - info: - lib.nixosSystem { - inherit (info) system; - specialArgs = { - inherit inputs dirUtils; - inherit (info) type; + outputs = inputs: let + lib = inputs.nixpkgs.lib; + dirUtils = { + opt = lib.optionals; + dirFiles = type: dir: lib.filter (lib.hasSuffix type) (lib.filesystem.listFilesRecursive dir); + }; + system = info: + lib.nixosSystem { + inherit (info) system; + specialArgs = { + inherit inputs dirUtils; + inherit (info) type; - crossPkgs = import inputs.nixpkgs { - hostPlatform = info.system; - localSystem = info.system; - buildPlatform = "x86_64-linux"; + crossPkgs = import inputs.nixpkgs { + hostPlatform = info.system; + localSystem = info.system; + buildPlatform = "x86_64-linux"; - overlays = - let - path = ./cross-overlays/${info.hostname}; - in - dirUtils.opt (builtins.pathExists path) ( - map (file: import file inputs) (lib.filesystem.listFilesRecursive path) - ); - - config.permittedInsecurePackages = [ - "libsoup-2.74.3" - ]; - }; - }; - - modules = - let - clientPath = ./clients/${info.hostname}; + overlays = let + path = ./cross-overlays/${info.hostname}; in - with dirUtils; + dirUtils.opt (builtins.pathExists path) ( + map (file: import file inputs) (lib.filesystem.listFilesRecursive path) + ); + + config.permittedInsecurePackages = [ + "libsoup-2.74.3" + ]; + }; + }; + + modules = let + clientPath = ./clients/${info.hostname}; + in + with dirUtils; [ ./wrappers/default.nix - { networking.hostName = info.hostname; } + {networking.hostName = info.hostname;} inputs.agenix.nixosModules.default inputs.run0-sudo-shim.nixosModules.default ] @@ -122,31 +113,29 @@ ./stylix.nix ] ); - }; - in - inputs.flake-parts.lib.mkFlake { inherit inputs; } { + }; + in + inputs.flake-parts.lib.mkFlake {inherit inputs;} { systems = [ "aarch64-linux" "x86_64-linux" ]; - perSystem = - { pkgs, ... }: - { - apps.image = { - type = "app"; - program = pkgs.writeShellApplication { - name = "image"; - runtimeInputs = with pkgs; [ nix-output-monitor ]; - text = "nom build .#nixosConfigurations.\"$1\".config.system.build.image"; - }; + perSystem = {pkgs, ...}: { + apps.image = { + type = "app"; + program = pkgs.writeShellApplication { + name = "image"; + runtimeInputs = with pkgs; [nix-output-monitor]; + text = "nom build .#nixosConfigurations.\"$1\".config.system.build.image"; }; }; + }; flake.nixosConfigurations = builtins.mapAttrs - ( - name: value: + ( + name: value: system ( { system = "x86_64-linux"; @@ -155,22 +144,22 @@ } // value ) - ) - { - "quadraticpc".type = "desktop"; - "quadtop".type = "desktop"; - "quadraticserver" = { - type = "server"; - graphical = false; - }; - "quadphone" = { - type = "mobile"; - system = "aarch64-linux"; - }; - "everquad" = { - type = "mobile"; - system = "aarch64-linux"; - }; + ) + { + "quadraticpc".type = "desktop"; + "quadtop".type = "desktop"; + "quadraticserver" = { + type = "server"; + graphical = false; }; + "quadphone" = { + type = "mobile"; + system = "aarch64-linux"; + }; + "everquad" = { + type = "mobile"; + system = "aarch64-linux"; + }; + }; }; } diff --git a/modules/desktop/packages.nix b/modules/desktop/packages.nix index 3594c46..198ed4f 100644 --- a/modules/desktop/packages.nix +++ b/modules/desktop/packages.nix @@ -7,6 +7,5 @@ libreoffice authenticator prismlauncher - # cinny-desktop ]; } diff --git a/modules/graphical/packages.nix b/modules/graphical/packages.nix index bf3b074..7045490 100644 --- a/modules/graphical/packages.nix +++ b/modules/graphical/packages.nix @@ -8,6 +8,5 @@ wl-clipboard google-cursor papirus-icon-theme - # crossPkgs.cinny-desktop ]; }