tangled
alpha
login
or
join now
encode42.dev
/
nixos
0
fork
atom
Personal-use NixOS configuration
0
fork
atom
overview
issues
pulls
pipelines
Start work on Zipline
encode42.dev
3 weeks ago
1188b79b
21adfdd2
+71
-2
4 changed files
expand all
collapse all
unified
split
hosts
index
config
web
zipline.nix
default.nix
lib
mkProxies.nix
packages
server
web
zipline.nix
+29
hosts/index/config/web/zipline.nix
···
1
1
+
{ flakeRoot, ... }:
2
2
+
3
3
+
let
4
4
+
host = "deer.zip";
5
5
+
6
6
+
ziplineModule = import (flakeRoot + /packages/server/web/zipline.nix) {
7
7
+
hosts = [
8
8
+
{
9
9
+
name = host;
10
10
+
ssl = "cloudflare";
11
11
+
}
12
12
+
];
13
13
+
};
14
14
+
in
15
15
+
{
16
16
+
imports = [
17
17
+
ziplineModule
18
18
+
];
19
19
+
20
20
+
services.zipline = {
21
21
+
environmentFiles = [ "/mnt/apps/zipline/.env" ];
22
22
+
23
23
+
settings = {
24
24
+
CORE_DEFAULT_DOMAIN = host;
25
25
+
26
26
+
DATASOURCE_LOCAL_DIRECTORY = "/mnt/data/zipline/";
27
27
+
};
28
28
+
};
29
29
+
}
+2
-1
hosts/index/default.nix
···
49
49
./config/sharing/soulseek.nix
50
50
51
51
./config/web/caddy.nix
52
52
-
./config/web/forgejo.nix
52
52
+
#./config/web/forgejo.nix
53
53
./config/web/linkwarden.nix
54
54
./config/web/miniflux.nix
55
55
./config/web/network-optimizer.nix
56
56
./config/web/vaultwarden.nix
57
57
#./config/web/wakapi.nix
58
58
+
./config/web/zipline.nix
58
59
59
60
./users
60
61
];
+3
-1
lib/mkProxies.nix
···
1
1
{ lib }:
2
2
3
3
# hosts:
4
4
-
# [ { name = str; ssl = str; useLocal = bool?; } ];
4
4
+
# [ { name = str; ssl = str; useLocal = bool?; extraConfig = string?; } ];
5
5
hosts: proxy:
6
6
7
7
let
···
32
32
${sslModules.${host.ssl}}
33
33
34
34
${proxy}
35
35
+
36
36
+
${host.extraConfig or ""}
35
37
'';
36
38
};
37
39
}) hosts
+37
packages/server/web/zipline.nix
···
1
1
+
{
2
2
+
hosts ? [ ],
3
3
+
}:
4
4
+
5
5
+
{ config, flakeLib, ... }:
6
6
+
7
7
+
{
8
8
+
services.zipline = {
9
9
+
enable = true;
10
10
+
11
11
+
settings = {
12
12
+
URLS_ROUTE = "/";
13
13
+
FILES_ROUTE = "/";
14
14
+
15
15
+
URLS_LENGTH = 3;
16
16
+
FILES_LENGTH = 3;
17
17
+
18
18
+
FILES_MAX_FILE_SIZE = "500mb";
19
19
+
20
20
+
CORE_PORT = 3030;
21
21
+
22
22
+
FEATURES_USER_REGISTRATION = false;
23
23
+
FEATURES_OAUTH_REGISTRATION = false;
24
24
+
25
25
+
FEATURES_METRICS_ENABLED = false;
26
26
+
27
27
+
FEATURES_VERSION_CHECKING = false;
28
28
+
29
29
+
# https://zipline.diced.sh/docs/config/settings#variables-9
30
30
+
# https://zipline.diced.sh/docs/config/settings#pwa
31
31
+
};
32
32
+
};
33
33
+
34
34
+
services.caddy.virtualHosts = flakeLib.mkProxies hosts ''
35
35
+
reverse_proxy :${toString config.services.zipline.settings.CORE_PORT}
36
36
+
'';
37
37
+
}