Migrate matrix from Container to VM
This commit is contained in:
Generated
+37
@@ -714,6 +714,42 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"nixlib": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731805462,
|
||||||
|
"narHash": "sha256-yhEMW4MBi+IAyEJyiKbnFvY1uARyMKJpLUhkczI49wk=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"rev": "b9f04e3cf71c23bea21d2768051e6b3068d44734",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixpkgs.lib",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixos-generators": {
|
||||||
|
"inputs": {
|
||||||
|
"nixlib": "nixlib",
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixunstable"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1731892054,
|
||||||
|
"narHash": "sha256-BJtD9NGUWaBe4OZ1JO77w8qBP9yHDJJUjsxkG/milFc=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixos-generators",
|
||||||
|
"rev": "15a87ccb45e06d24a9fd5f99a49782efe11b23f0",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "nixos-generators",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1723282977,
|
"lastModified": 1723282977,
|
||||||
@@ -971,6 +1007,7 @@
|
|||||||
"hmunstable": "hmunstable",
|
"hmunstable": "hmunstable",
|
||||||
"hooks": "hooks",
|
"hooks": "hooks",
|
||||||
"nix23_05": "nix23_05",
|
"nix23_05": "nix23_05",
|
||||||
|
"nixos-generators": "nixos-generators",
|
||||||
"nixstable": "nixstable",
|
"nixstable": "nixstable",
|
||||||
"nixunstable": "nixunstable",
|
"nixunstable": "nixunstable",
|
||||||
"nixvimstable": "nixvimstable",
|
"nixvimstable": "nixvimstable",
|
||||||
|
|||||||
@@ -37,6 +37,10 @@
|
|||||||
url = "github:nix-community/home-manager/master";
|
url = "github:nix-community/home-manager/master";
|
||||||
inputs.nixpkgs.follows = "nixstable";
|
inputs.nixpkgs.follows = "nixstable";
|
||||||
};
|
};
|
||||||
|
nixos-generators = {
|
||||||
|
url = "github:nix-community/nixos-generators";
|
||||||
|
inputs.nixpkgs.follows = "nixunstable";
|
||||||
|
};
|
||||||
nixvimstable.url = "github:nix-community/nixvim/nixos-24.05";
|
nixvimstable.url = "github:nix-community/nixvim/nixos-24.05";
|
||||||
nixvimunstable.url = "github:nix-community/nixvim/main";
|
nixvimunstable.url = "github:nix-community/nixvim/main";
|
||||||
nix23_05.url = "github:NixOS/nixpkgs/nixos-23.05";
|
nix23_05.url = "github:NixOS/nixpkgs/nixos-23.05";
|
||||||
@@ -57,9 +61,9 @@
|
|||||||
packages_overlay = (
|
packages_overlay = (
|
||||||
_: prev:
|
_: prev:
|
||||||
(import ./pkgs {
|
(import ./pkgs {
|
||||||
inherit self;
|
inherit self top;
|
||||||
pkgs = prev;
|
pkgs = prev;
|
||||||
}).packages
|
})
|
||||||
);
|
);
|
||||||
overlays = [
|
overlays = [
|
||||||
top.agenix.overlays.default
|
top.agenix.overlays.default
|
||||||
@@ -104,7 +108,7 @@
|
|||||||
pkgs = import top.nixstable { inherit system overlays; };
|
pkgs = import top.nixstable { inherit system overlays; };
|
||||||
};
|
};
|
||||||
|
|
||||||
imports = [ ./pkgs ];
|
packages = import ./pkgs { inherit pkgs top; };
|
||||||
|
|
||||||
checks = import ./checks.nix {
|
checks = import ./checks.nix {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{ top, overlays, ... }:
|
{ top, overlays, ... }:
|
||||||
let
|
let
|
||||||
|
vm = args: (unstable (args // { extraMods = [ top.nixos-generators.nixosModules.all-formats ]; }));
|
||||||
wsl = args: (unstable (args // { extraMods = [ top.wsl.nixosModules.wsl ]; }));
|
wsl = args: (unstable (args // { extraMods = [ top.wsl.nixosModules.wsl ]; }));
|
||||||
unstable =
|
unstable =
|
||||||
args:
|
args:
|
||||||
@@ -61,6 +62,9 @@ in
|
|||||||
hosea = unstable { name = "hosea"; };
|
hosea = unstable { name = "hosea"; };
|
||||||
jeremiah = unstable { name = "jeremiah"; };
|
jeremiah = unstable { name = "jeremiah"; };
|
||||||
isaiah = unstable { name = "isaiah"; };
|
isaiah = unstable { name = "isaiah"; };
|
||||||
|
|
||||||
|
vm-matrix = vm { name = "vm-matrix"; };
|
||||||
|
|
||||||
iso = machine { name = "iso"; };
|
iso = machine { name = "iso"; };
|
||||||
iso-beta = unstable { name = "iso"; };
|
iso-beta = unstable { name = "iso"; };
|
||||||
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
|
# nix build '.#nixosConfigurations.wsl.config.system.build.installer'
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
./ceph.nix
|
./ceph.nix
|
||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./git.nix
|
./git.nix
|
||||||
./matrix.nix
|
|
||||||
./minio.nix
|
./minio.nix
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@@ -1,99 +0,0 @@
|
|||||||
{ pkgs, ... }:
|
|
||||||
let
|
|
||||||
conn = "postgresql:///dendrite?sslmode=disable&host=/run/postgresql";
|
|
||||||
in
|
|
||||||
{
|
|
||||||
environment.systemPackages = with pkgs; [ upgrade-pg-cluster ];
|
|
||||||
|
|
||||||
greg.containers.matrix = {
|
|
||||||
tailscale = true;
|
|
||||||
subnet = "204";
|
|
||||||
builder =
|
|
||||||
{ config, ... }:
|
|
||||||
{
|
|
||||||
networking.firewall.allowedTCPPorts = [ config.services.dendrite.httpPort ];
|
|
||||||
|
|
||||||
# Environment secrets
|
|
||||||
age = {
|
|
||||||
secrets.dendrite = {
|
|
||||||
file = ../../secrets/dendrite.age;
|
|
||||||
owner = "dendrite";
|
|
||||||
};
|
|
||||||
secrets.dendrite_key = {
|
|
||||||
file = ../../secrets/dendrite_key.age;
|
|
||||||
owner = "dendrite";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
users.users.dendrite = {
|
|
||||||
isSystemUser = true;
|
|
||||||
group = "dendrite";
|
|
||||||
};
|
|
||||||
users.groups.dendrite = { };
|
|
||||||
|
|
||||||
systemd.services.dendrite.serviceConfig = {
|
|
||||||
User = "dendrite";
|
|
||||||
};
|
|
||||||
|
|
||||||
greg.databases.dendrite = { };
|
|
||||||
|
|
||||||
services.dendrite = {
|
|
||||||
enable = true;
|
|
||||||
environmentFile = config.age.secrets.dendrite.path;
|
|
||||||
httpPort = 8448;
|
|
||||||
# Identify ourselves as the root of our own domain
|
|
||||||
settings = (
|
|
||||||
(builtins.listToAttrs (
|
|
||||||
(map
|
|
||||||
(x: {
|
|
||||||
name = x;
|
|
||||||
value = {
|
|
||||||
database.connection_string = conn;
|
|
||||||
};
|
|
||||||
})
|
|
||||||
[
|
|
||||||
"app_service_api"
|
|
||||||
"federation_api"
|
|
||||||
"key_server"
|
|
||||||
"media_api"
|
|
||||||
"mscs"
|
|
||||||
"relay_api"
|
|
||||||
"room_server"
|
|
||||||
"sync_api"
|
|
||||||
]
|
|
||||||
)
|
|
||||||
))
|
|
||||||
// {
|
|
||||||
user_api.account_database.connection_string = conn;
|
|
||||||
user_api.device_database.connection_string = conn;
|
|
||||||
global = {
|
|
||||||
database = {
|
|
||||||
connection_string = conn;
|
|
||||||
max_open_conns = 25;
|
|
||||||
max_idle_conns = 5;
|
|
||||||
conn_max_lifetime = -1;
|
|
||||||
};
|
|
||||||
server_name = "thehellings.com";
|
|
||||||
trusted_third_party_id_servers = [
|
|
||||||
"matrix.org"
|
|
||||||
"vector.im"
|
|
||||||
"jupiterbroadcasting.com"
|
|
||||||
];
|
|
||||||
# Generate this with {path-to-dendrite}/bin/generate-keys --private-key /etc/dendrite.pem
|
|
||||||
private_key = config.age.secrets.dendrite_key.path;
|
|
||||||
};
|
|
||||||
client_api = {
|
|
||||||
registration_enabled = false;
|
|
||||||
registration_shared_secret = "\${REGISTRATION_SHARED_SECRET}";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
systemd.services.dendrite = {
|
|
||||||
after = [ "postgresql.service" ];
|
|
||||||
requires = [ "postgresql.service" ];
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
{ pkgs, config, ... }:
|
||||||
|
let
|
||||||
|
conn = "postgresql:///dendrite?sslmode=disable&host=/run/postgresql";
|
||||||
|
in
|
||||||
|
{
|
||||||
|
environment.systemPackages = with pkgs; [ upgrade-pg-cluster ];
|
||||||
|
|
||||||
|
greg = {
|
||||||
|
tailscale.enable = true;
|
||||||
|
};
|
||||||
|
networking.firewall.allowedTCPPorts = [ config.services.dendrite.httpPort ];
|
||||||
|
|
||||||
|
# Environment secrets
|
||||||
|
age = {
|
||||||
|
secrets.dendrite = {
|
||||||
|
file = ../../secrets/dendrite.age;
|
||||||
|
owner = "dendrite";
|
||||||
|
};
|
||||||
|
secrets.dendrite_key = {
|
||||||
|
file = ../../secrets/dendrite_key.age;
|
||||||
|
owner = "dendrite";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
users.users = {
|
||||||
|
dendrite = {
|
||||||
|
isSystemUser = true;
|
||||||
|
group = "dendrite";
|
||||||
|
};
|
||||||
|
greg.initialPassword = "password";
|
||||||
|
};
|
||||||
|
users.groups.dendrite = { };
|
||||||
|
|
||||||
|
systemd.services.dendrite.serviceConfig = {
|
||||||
|
User = "dendrite";
|
||||||
|
};
|
||||||
|
|
||||||
|
greg.databases.dendrite = { };
|
||||||
|
|
||||||
|
services.dendrite = {
|
||||||
|
enable = true;
|
||||||
|
environmentFile = config.age.secrets.dendrite.path;
|
||||||
|
httpPort = 8448;
|
||||||
|
# Identify ourselves as the root of our own domain
|
||||||
|
settings = (
|
||||||
|
(builtins.listToAttrs (
|
||||||
|
map
|
||||||
|
(x: {
|
||||||
|
name = x;
|
||||||
|
value = {
|
||||||
|
database.connection_string = conn;
|
||||||
|
};
|
||||||
|
})
|
||||||
|
[
|
||||||
|
"app_service_api"
|
||||||
|
"federation_api"
|
||||||
|
"key_server"
|
||||||
|
"media_api"
|
||||||
|
"mscs"
|
||||||
|
"relay_api"
|
||||||
|
"room_server"
|
||||||
|
"sync_api"
|
||||||
|
]
|
||||||
|
))
|
||||||
|
// {
|
||||||
|
user_api.account_database.connection_string = conn;
|
||||||
|
user_api.device_database.connection_string = conn;
|
||||||
|
global = {
|
||||||
|
database = {
|
||||||
|
connection_string = conn;
|
||||||
|
max_open_conns = 25;
|
||||||
|
max_idle_conns = 5;
|
||||||
|
conn_max_lifetime = -1;
|
||||||
|
};
|
||||||
|
server_name = "thehellings.com";
|
||||||
|
trusted_third_party_id_servers = [
|
||||||
|
"matrix.org"
|
||||||
|
"vector.im"
|
||||||
|
"jupiterbroadcasting.com"
|
||||||
|
];
|
||||||
|
# Generate this with {path-to-dendrite}/bin/generate-keys --private-key /etc/dendrite.pem
|
||||||
|
private_key = config.age.secrets.dendrite_key.path;
|
||||||
|
};
|
||||||
|
client_api = {
|
||||||
|
registration_enabled = false;
|
||||||
|
registration_shared_secret = "\${REGISTRATION_SHARED_SECRET}";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
systemd.services.dendrite = {
|
||||||
|
after = [ "postgresql.service" ];
|
||||||
|
requires = [ "postgresql.service" ];
|
||||||
|
};
|
||||||
|
}
|
||||||
+15
-15
@@ -1,21 +1,21 @@
|
|||||||
{ pkgs, ... }:
|
{ pkgs, top, ... }:
|
||||||
|
|
||||||
let
|
let
|
||||||
c = pkgs.callPackage;
|
c = pkgs.callPackage;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = {
|
#default = iso;
|
||||||
#default = iso;
|
#iso = top.self.nixosConfigurations.iso.config.system.build.isoImage;
|
||||||
#iso = top.self.nixosConfigurations.iso.config.system.build.isoImage;
|
#iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage;
|
||||||
#iso-beta = self.nixosConfigurations.iso-beta.config.system.build.isoImage;
|
aacs = c ./aacs.nix { };
|
||||||
aacs = c ./aacs.nix { };
|
brew = c ./homebrew.nix { };
|
||||||
brew = c ./homebrew.nix { };
|
create_ssl = c ./create_ssl.nix { };
|
||||||
create_ssl = c ./create_ssl.nix { };
|
inject-darwin = c ./inject-darwin.nix { };
|
||||||
inject-darwin = c ./inject-darwin.nix { };
|
inject = c ./inject.nix { };
|
||||||
inject = c ./inject.nix { };
|
hms = c ./hms { };
|
||||||
hms = c ./hms { };
|
setup-ssh = c ./setup-ssh { };
|
||||||
setup-ssh = c ./setup-ssh { };
|
upgrade-pg-cluster = c ./upgrade-pg-cluster.nix { };
|
||||||
upgrade-pg-cluster = c ./upgrade-pg-cluster.nix { };
|
zim = c ./zim.nix { };
|
||||||
zim = c ./zim.nix { };
|
|
||||||
};
|
matrix = top.nixosConfigurations.vm-matrix.config.formats.qcow;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user