tangled
alpha
login
or
join now
ptr.pet
/
ark
2
fork
atom
nix machine / user configurations
2
fork
atom
overview
issues
pulls
pipelines
matrix
ptr.pet
3 years ago
b6fea862
8af465a2
+48
-35
3 changed files
expand all
collapse all
unified
split
hosts
wolumonde
modules
conduit.nix
modules
network
iwd.nix
users
modules
discord
default.nix
+32
-19
hosts/wolumonde/modules/conduit.nix
···
1
1
-
{config, pkgs, ...}:
2
2
-
let
3
3
-
wellKnownFileClient =
4
4
-
pkgs.writeText "client" (
5
5
-
builtins.toJSON
6
6
-
{ "m.homeserver"."base_url" = "https://matrix.gaze.systems"; }
7
7
-
);
8
8
-
wellKnownFileServer =
1
1
+
{
2
2
+
config,
3
3
+
pkgs,
4
4
+
...
5
5
+
}: let
6
6
+
_wellKnownFileClient = pkgs.writeText "client" (
7
7
+
builtins.toJSON
8
8
+
{"m.homeserver"."base_url" = "https://matrix.gaze.systems";}
9
9
+
);
10
10
+
_wellKnownFileServer =
9
11
pkgs.writeText "server"
10
10
-
(builtins.toJSON { "m.server" = "matrix.gaze.systems:443"; });
11
11
-
in
12
12
-
{
12
12
+
(builtins.toJSON {"m.server" = "matrix.gaze.systems:443";});
13
13
+
wellKnownFiles = pkgs.runCommand "well-known" {} ''
14
14
+
mkdir -p $out
15
15
+
cp ${_wellKnownFileServer} $out/server
16
16
+
cp ${_wellKnownFileClient} $out/client
17
17
+
'';
18
18
+
in {
13
19
services.matrix-conduit = {
14
20
enable = true;
21
21
+
package = pkgs.matrix-conduit.overrideAttrs (old: rec {
22
22
+
name = "${old.pname}-${version}";
23
23
+
version = "147f2752";
24
24
+
src = pkgs.fetchFromGitLab {
25
25
+
owner = "famedly";
26
26
+
repo = "conduit";
27
27
+
rev = "147f27521c0d7dbc32d39ec1d8da6cd00008f23c";
28
28
+
sha256 = "sha256-j469Zh8zyqJNWz7q6gjRu1Khk9y6Xbb52SpxzNjADW8=";
29
29
+
};
30
30
+
});
15
31
settings.global = {
16
32
server_name = "gaze.systems";
17
33
max_request_size = 1000 * 1000 * 20;
18
18
-
allow_registration = true;
34
34
+
allow_registration = false;
19
35
allow_federation = true;
20
36
trusted_servers = ["matrix.org" "nixos.dev" "conduit.rs"];
21
37
address = "::1";
···
26
42
services.nginx.virtualHosts."matrix.gaze.systems" = {
27
43
enableACME = true;
28
44
forceSSL = true;
29
29
-
locations."/".proxyPass =
30
30
-
"http://localhost:${toString config.services.matrix-conduit.settings.global.port}";
45
45
+
locations."/".proxyPass = "http://localhost:${toString config.services.matrix-conduit.settings.global.port}";
31
46
};
32
47
services.nginx.virtualHosts."gaze.systems" = {
33
33
-
locations."/.well-known/matrix/client".extraConfig = ''
34
34
-
alias ${wellKnownFileClient};
35
35
-
'';
36
36
-
locations."/.well-known/matrix/server".extraConfig = ''
37
37
-
alias ${wellKnownFileServer};
48
48
+
locations."/.well-known/matrix/".extraConfig = ''
49
49
+
add_header content-type application/json;
50
50
+
alias ${wellKnownFiles}/;
38
51
'';
39
52
};
40
53
}
+2
-2
modules/network/iwd.nix
···
3
3
networking.wireless.iwd = {
4
4
enable = true;
5
5
settings = {
6
6
-
Network = { EnableIPv6 = true; };
7
7
-
Settings = { AutoConnect = true; };
6
6
+
Network = {EnableIPv6 = true;};
7
7
+
Settings = {AutoConnect = true;};
8
8
};
9
9
};
10
10
networking.networkmanager.wifi.backend = "iwd";
+14
-14
users/modules/discord/default.nix
···
17
17
home.persistence."${config.system.persistDir}${config.home.homeDirectory}".directories = [
18
18
".config/WebCord"
19
19
];
20
20
-
home.packages =
21
21
-
let
20
20
+
home.packages = let
22
21
pkg = inputs.webcord.packages.${pkgs.system}.webcord;
23
23
-
in
24
24
-
[(
25
25
-
pkgs.runCommand pkg.name {nativeBuildInputs = [pkgs.makeWrapper];} ''
26
26
-
mkdir -p $out
27
27
-
ln -sf ${pkg}/* $out/
28
28
-
rm $out/bin
29
29
-
mkdir $out/bin
30
30
-
ln -s ${pkg}/bin/webcord $out/bin/webcord
31
31
-
wrapProgram $out/bin/webcord \
32
32
-
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [pkgs.pipewire]}"
33
33
-
''
34
34
-
)];
22
22
+
in [
23
23
+
(
24
24
+
pkgs.runCommand pkg.name {nativeBuildInputs = [pkgs.makeWrapper];} ''
25
25
+
mkdir -p $out
26
26
+
ln -sf ${pkg}/* $out/
27
27
+
rm $out/bin
28
28
+
mkdir $out/bin
29
29
+
ln -s ${pkg}/bin/webcord $out/bin/webcord
30
30
+
wrapProgram $out/bin/webcord \
31
31
+
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [pkgs.pipewire]}"
32
32
+
''
33
33
+
)
34
34
+
];
35
35
}