1 { pkgs, lib, config, ... }:
3 inherit (config) networking;
4 inherit (config.services) sourcehut;
5 inherit (config.users) users groups;
6 inherit (config.security) gnupg;
7 domain = "hut.${networking.domain}";
10 security.gnupg.secrets = lib.genAttrs [
11 "sourcehut/network-key"
12 "sourcehut/service-key"
13 "sourcehut/webhook-key"
14 "sourcehut/oauth-client-secret"
16 systemdConfig.before = [ "metasrht.service" ];
17 systemdConfig.wantedBy = [ "metasrht.service" ];
22 secretKey = "12345678";
26 #environment.systemPackages = [ pkgs.minio-client ];
27 services.sourcehut = {
29 listenAddress = "localhost";
33 images.nixos.unstable.x86_64 =
34 import sourcehut/builds/nixos-unstable.nix
35 "x86_64-linux" { inherit pkgs lib config; };
38 #dispatch.enable = true;
49 postgresql.enable = true;
50 postfix.enable = true;
52 #redis.url = "redis+socket:///run/redis-sourcehut/redis.sock?virtual_host=";
55 useACMEHost = networking.domain;
59 environment = "production";
60 global-domain = domain;
61 owner-email = "julm+srht@sourcephile.fr";
62 owner-name = "Sourcephile";
63 site-blurb = "a simple free software forge";
64 site-info = "https://${domain}";
65 site-name = "Sourcephile";
66 # nix shell nixpkgs#sourcehut.coresrht -c srht-keygen network
67 network-key = gnupg.secrets."sourcehut/network-key".path;
68 # nix shell nixpkgs#sourcehut.coresrht -c srht-keygen service
69 service-key = gnupg.secrets."sourcehut/service-key".path;
70 #redis-host = "redis://localhost:6379/";
73 s3-upstream = "localhost";
74 s3-access-key = "12345";
75 s3-secret-key = pkgs.writeText "s3-secret-key" "12345678";
77 # nix shell nixpkgs#sourcehut.metasrht -c metasrht-manageuser -t admin -e mymail@gmail.com misuzu
79 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
80 oauth-client-id = "299db9f9c2013170";
84 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
85 oauth-client-id = "299db9f9c2013170";
88 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
89 oauth-client-id = "299db9f9c2013170";
90 s3-bucket = "pagesbuck";
93 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
94 oauth-client-id = "299db9f9c2013170";
97 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
98 oauth-client-id = "299db9f9c2013170";
102 "meta.sr.ht::settings" = {
103 onboarding-redirect = "https://meta.${domain}";
104 registration = false;
106 "meta.sr.ht::api" = {
107 #internal-ipnet= [ "127.0.0.0/8" "::1/128" "192.168.0.0/16" "10.0.0.0/8"];
110 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
111 oauth-client-id = "299db9f9c2013170";
114 outgoing-domain = "https://git.${domain}";
115 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
116 oauth-client-id = "gitsrht";
119 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
120 oauth-client-id = "299db9f9c2013170";
123 oauth-client-secret = gnupg.secrets."sourcehut/oauth-client-secret".path;
124 oauth-client-id = "299db9f9c2013170";
126 "lists.sr.ht::worker" = {
127 #sock = "/var/lib/postfix/queue/private/srht-lmtp";
129 # nix shell nixpkgs#sourcehut.coresrht -c srht-keygen webhook
130 #webhooks.private-key= "U7yd/8mGs/v0O3kId4jpeSghUCa9tqP1fYQwSV8UOqo=";
131 webhooks.private-key = gnupg.secrets."sourcehut/webhook-key".path;
133 smtp-host = "localhost";
136 smtp-password = null;
137 smtp-from = "julm+hut@${networking.domain}";
138 error-to = "julm+hut+error@${networking.domain}";
139 error-from = "julm+hut+error@${networking.domain}";
146 fileSystems."/var/lib/sourcehut" = {
147 device = "rpool/var/sourcehut";
150 services.sanoid.datasets = {
151 "rpool/var/sourcehut" = {
152 use_template = [ "snap" ];