use continuwuity from nixpkgs

This commit is contained in:
Henry Hiles 2025-09-22 19:06:54 -04:00
commit a6c96c23ae
No known key found for this signature in database
5 changed files with 106 additions and 122 deletions

View file

@ -6,19 +6,19 @@
homeserverList = ["federated.nexus"]; homeserverList = ["federated.nexus"];
allowCustomHomeservers = false; allowCustomHomeservers = false;
}; };
cinny-unwrapped = pkgs.cinny-unwrapped.overrideAttrs (old: rec { # cinny-unwrapped = pkgs.cinny-unwrapped.overrideAttrs (old: rec {
src = pkgs.fetchFromGitHub { # src = pkgs.fetchFromGitHub {
owner = "GigiaJ"; # owner = "GigiaJ";
repo = "cinny"; # repo = "cinny";
rev = "a299e9c4cb4df1a3b732fdfddb1297170251a10d"; # rev = "a299e9c4cb4df1a3b732fdfddb1297170251a10d";
hash = "sha256-EDsDVOlaYT0S30Cml+t71U7OOKkfcE4aJxwE8iTdV3s="; # hash = "sha256-EDsDVOlaYT0S30Cml+t71U7OOKkfcE4aJxwE8iTdV3s=";
}; # };
npmDeps = pkgs.fetchNpmDeps { # npmDeps = pkgs.fetchNpmDeps {
inherit src; # inherit src;
name = "${old.pname}-${old.version}-npm-deps"; # name = "${old.pname}-${old.version}-npm-deps";
hash = "sha256-k8eCQO1uIpoKpLHO3E3EYWbQSjcAya2AxngA9mvSfns="; # hash = "sha256-k8eCQO1uIpoKpLHO3E3EYWbQSjcAya2AxngA9mvSfns=";
}; # };
}); # });
}} }}
try_files {path} {path}/ /index.html try_files {path} {path}/ /index.html
file_server file_server

View file

@ -3,43 +3,40 @@
pkgs, pkgs,
lib, lib,
... ...
}: }: {
{
systemd.services.continuwuity.serviceConfig.Restart = lib.mkForce "always"; systemd.services.continuwuity.serviceConfig.Restart = lib.mkForce "always";
services = services = let
let domain = "federated.nexus";
domain = "federated.nexus"; subdomain = "matrix.${domain}";
subdomain = "matrix.${domain}"; socket = "/var/run/continuwuity/continuwuity.sock";
socket = "/var/run/continuwuity/continuwuity.sock"; in {
in matrix-continuwuity = {
{ enable = true;
matrix-continuwuity = { package = inputs.nixpkgs-continuwuity.legacyPackages.${pkgs.system}.matrix-continuwuity;
enable = true; group = "caddy";
package = inputs.continuwuity.packages.${pkgs.system}.default; settings.global = {
group = "caddy"; server_name = domain;
settings.global = { unix_socket_path = socket;
server_name = domain; new_user_displayname_suffix = "";
unix_socket_path = socket; allow_public_room_directory_over_federation = true;
new_user_displayname_suffix = ""; trusted_servers = [
allow_public_room_directory_over_federation = true; "matrix.org"
trusted_servers = [ "tchncs.de"
"matrix.org" "maunium.net"
"tchncs.de" ];
"maunium.net" ignore_messages_from_server_names = [];
]; url_preview_domain_explicit_allowlist = ["*"];
ignore_messages_from_server_names = [ ];
url_preview_domain_explicit_allowlist = [ "*" ];
well_known = { well_known = {
client = "https://${subdomain}"; client = "https://${subdomain}";
server = "${subdomain}:443"; server = "${subdomain}:443";
support_email = "henry@henryhiles.com"; support_email = "henry@henryhiles.com";
support_mxid = "@quadradical:${domain}"; support_mxid = "@quadradical:${domain}";
};
}; };
}; };
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}";
}; };
caddy.virtualHosts."${subdomain}".extraConfig = "reverse_proxy unix/${socket}";
};
} }

137
flake.nix
View file

@ -2,14 +2,10 @@
inputs = { inputs = {
gnome-mobile.url = "github:chuangzhu/nixpkgs-gnome-mobile"; gnome-mobile.url = "github:chuangzhu/nixpkgs-gnome-mobile";
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; 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"; wrapper-manager.url = "github:viperML/wrapper-manager";
flake-parts.url = "github:hercules-ci/flake-parts"; flake-parts.url = "github:hercules-ci/flake-parts";
nix-maid.url = "github:viperML/nix-maid"; nix-maid.url = "github:viperML/nix-maid";
continuwuity = {
url = "path:/home/quadradical/Documents/Code/continuwuity";
inputs.nixpkgs.follows = "nixpkgs";
};
disko = { disko = {
url = "github:nix-community/disko"; url = "github:nix-community/disko";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -64,49 +60,44 @@
}; };
}; };
outputs = outputs = inputs: let
inputs: lib = inputs.nixpkgs.lib;
let dirUtils = {
lib = inputs.nixpkgs.lib; opt = lib.optionals;
dirUtils = { dirFiles = type: dir: lib.filter (lib.hasSuffix type) (lib.filesystem.listFilesRecursive dir);
opt = lib.optionals; };
dirFiles = type: dir: lib.filter (lib.hasSuffix type) (lib.filesystem.listFilesRecursive dir); system = info:
}; lib.nixosSystem {
system = inherit (info) system;
info: specialArgs = {
lib.nixosSystem { inherit inputs dirUtils;
inherit (info) system; inherit (info) type;
specialArgs = {
inherit inputs dirUtils;
inherit (info) type;
crossPkgs = import inputs.nixpkgs { crossPkgs = import inputs.nixpkgs {
hostPlatform = info.system; hostPlatform = info.system;
localSystem = info.system; localSystem = info.system;
buildPlatform = "x86_64-linux"; buildPlatform = "x86_64-linux";
overlays = overlays = let
let path = ./cross-overlays/${info.hostname};
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};
in 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 ./wrappers/default.nix
{ networking.hostName = info.hostname; } {networking.hostName = info.hostname;}
inputs.agenix.nixosModules.default inputs.agenix.nixosModules.default
inputs.run0-sudo-shim.nixosModules.default inputs.run0-sudo-shim.nixosModules.default
] ]
@ -122,31 +113,29 @@
./stylix.nix ./stylix.nix
] ]
); );
}; };
in in
inputs.flake-parts.lib.mkFlake { inherit inputs; } { inputs.flake-parts.lib.mkFlake {inherit inputs;} {
systems = [ systems = [
"aarch64-linux" "aarch64-linux"
"x86_64-linux" "x86_64-linux"
]; ];
perSystem = perSystem = {pkgs, ...}: {
{ pkgs, ... }: apps.image = {
{ type = "app";
apps.image = { program = pkgs.writeShellApplication {
type = "app"; name = "image";
program = pkgs.writeShellApplication { runtimeInputs = with pkgs; [nix-output-monitor];
name = "image"; text = "nom build .#nixosConfigurations.\"$1\".config.system.build.image";
runtimeInputs = with pkgs; [ nix-output-monitor ];
text = "nom build .#nixosConfigurations.\"$1\".config.system.build.image";
};
}; };
}; };
};
flake.nixosConfigurations = flake.nixosConfigurations =
builtins.mapAttrs builtins.mapAttrs
( (
name: value: name: value:
system ( system (
{ {
system = "x86_64-linux"; system = "x86_64-linux";
@ -155,22 +144,22 @@
} }
// value // value
) )
) )
{ {
"quadraticpc".type = "desktop"; "quadraticpc".type = "desktop";
"quadtop".type = "desktop"; "quadtop".type = "desktop";
"quadraticserver" = { "quadraticserver" = {
type = "server"; type = "server";
graphical = false; graphical = false;
};
"quadphone" = {
type = "mobile";
system = "aarch64-linux";
};
"everquad" = {
type = "mobile";
system = "aarch64-linux";
};
}; };
"quadphone" = {
type = "mobile";
system = "aarch64-linux";
};
"everquad" = {
type = "mobile";
system = "aarch64-linux";
};
};
}; };
} }

View file

@ -7,6 +7,5 @@
libreoffice libreoffice
authenticator authenticator
prismlauncher prismlauncher
# cinny-desktop
]; ];
} }

View file

@ -8,6 +8,5 @@
wl-clipboard wl-clipboard
google-cursor google-cursor
papirus-icon-theme papirus-icon-theme
# crossPkgs.cinny-desktop
]; ];
} }