diff options
Diffstat (limited to 'systems/eldiron/gemini/default.nix')
-rw-r--r-- | systems/eldiron/gemini/default.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/systems/eldiron/gemini/default.nix b/systems/eldiron/gemini/default.nix new file mode 100644 index 0000000..600afbc --- /dev/null +++ b/systems/eldiron/gemini/default.nix | |||
@@ -0,0 +1,50 @@ | |||
1 | { lib, config, pkgs, ... }: | ||
2 | let | ||
3 | configFile = pkgs.writeText "config.yaml" '' | ||
4 | listen: ":1965" | ||
5 | hosts: | ||
6 | immae.eu: | ||
7 | cert: /var/lib/acme/immae/full.pem | ||
8 | key: /var/lib/acme/immae/key.pem | ||
9 | paths: | ||
10 | - path: / | ||
11 | root: ${./public} | ||
12 | ''; | ||
13 | in | ||
14 | { | ||
15 | options.myServices.gemini.enable = lib.mkEnableOption "enable Gemini capsule"; | ||
16 | config = lib.mkIf config.myServices.gemini.enable { | ||
17 | security.acme.certs.immae.postRun = '' | ||
18 | systemctl restart gemini.service | ||
19 | ''; | ||
20 | myServices.chatonsProperties.hostings.gemini = { | ||
21 | file.datetime = "2022-08-27T18:00:00"; | ||
22 | hosting = { | ||
23 | name = "Hébergement Gemini"; | ||
24 | description = "Hébergement de capsules Gemini"; | ||
25 | type = "INSTANCE"; | ||
26 | website = "gemini://immae.eu"; | ||
27 | status.level = "OK"; | ||
28 | status.description = "OK"; | ||
29 | registration.load = "OPEN"; | ||
30 | install.type = "PACKAGE"; | ||
31 | }; | ||
32 | software = { | ||
33 | name = "twins"; | ||
34 | website = "https://code.rocketnine.space/tslocum/twins"; | ||
35 | license.url = "https://code.rocketnine.space/tslocum/twins/src/branch/master/LICENSE"; | ||
36 | license.name = "MIT License"; | ||
37 | version = pkgs.twins.version; | ||
38 | source.url = "https://code.rocketnine.space/tslocum/twins"; | ||
39 | }; | ||
40 | }; | ||
41 | networking.firewall.allowedTCPPorts = [ 1965 ]; | ||
42 | systemd.services.gemini = { | ||
43 | description = "Gemini capsule server"; | ||
44 | wantedBy = [ "multi-user.target" ]; | ||
45 | after = [ "network.target" ]; | ||
46 | serviceConfig.ExecStart = "${pkgs.twins}/bin/twins -config ${configFile}"; | ||
47 | serviceConfig.Type = "simple"; | ||
48 | }; | ||
49 | }; | ||
50 | } | ||