mastus: migrate to 21.05

This commit is contained in:
Gabriel Ebner 2021-06-27 14:40:28 +02:00
parent 393a699de3
commit 3fdda46bdd
5 changed files with 72 additions and 21 deletions

@ -5,17 +5,17 @@
[ [
/etc/nixos/hardware-configuration.nix /etc/nixos/hardware-configuration.nix
../basic-tools.nix ../basic-tools.nix
./backup.nix # ./backup.nix
./duplicity.nix ./duplicity.nix
./mail.nix ./mail.nix
./www.nix ./www.nix
./gogs.nix ./gitea.nix
./letsencrypt.nix ./letsencrypt.nix
./website.nix ./website.nix
./wstunnel.nix ./wstunnel.nix
./radicale.nix ./radicale.nix
./ttrss.nix # ./ttrss.nix
./dns.nix ./dns.nix
]; ];

42
mastus/gitea.nix Normal file

@ -0,0 +1,42 @@
{ config, pkgs, ... }:
{
services.gitea = rec {
enable = true;
stateDir = "/srv/git.gebner.org";
appName = "Gabriel Ebner's git server";
domain = "git.gebner.org";
rootUrl = "https://git.gebner.org/";
httpPort = 8001;
cookieSecure = true;
log.level = "Info";
disableRegistration = true;
settings = {
picture = {
DISABLE_GRAVATAR = "false";
AVATAR_UPLOAD_PATH = "${stateDir}/data/avatars";
};
};
};
environment.systemPackages = [
(let cfg = config.services.gitea; in pkgs.writeScriptBin "gitea" ''
exec ${pkgs.sudo}/bin/sudo -u ${cfg.user} \
env GITEA_WORK_DIR=${cfg.stateDir} ${pkgs.gitea}/bin/gitea "$@"
'')
];
services.nginx = {
recommendedProxySettings = true;
virtualHosts."git.gebner.org" = {
forceSSL = true;
useACMEHost = "gebner.org";
locations."/" = {
proxyPass = "http://127.0.0.1:${toString config.services.gitea.httpPort}";
extraConfig = ''
proxy_buffering off;
client_max_body_size 30M;
'';
};
};
};
}

@ -6,22 +6,26 @@ in
services.radicale = { services.radicale = {
enable = true; enable = true;
package = pkgs.radicale2; package = pkgs.radicale2;
config = '' settings = {
[server] server = {
hosts = 127.0.0.1:${toString radicalePort} hosts = "127.0.0.1:${toString radicalePort}";
ssl = false ssl = false;
dns_lookup = false dns_lookup = false;
};
[storage] storage = {
filesystem_folder = /var/lib/radicale/collections filesystem_folder = "/var/lib/radicale/collections";
};
[auth] auth = {
type = htpasswd type = "htpasswd";
htpasswd_filename = /var/lib/radicale/htpasswd htpasswd_filename = "/var/lib/radicale/htpasswd";
};
[rights] rights = {
type = owner_only type = "owner_only";
''; };
};
}; };
security.acme.certs."gebner.org".extraDomainNames = [ "radicale.gebner.org" ]; security.acme.certs."gebner.org".extraDomainNames = [ "radicale.gebner.org" ];

@ -2,8 +2,13 @@
{ {
containers.ttrss = { containers.ttrss = {
config = { config = {
users.extraUsers.ttrss = {}; users.users.ttrss = {
users.extraGroups.ttrss = {}; group = "ttrss";
isSystemUser = true;
};
users.groups.ttrss = {};
users.users.tt_rss.isSystemUser = true;
services.postgresql = { services.postgresql = {
enable = true; enable = true;

@ -9,7 +9,7 @@ let
boot.enableContainers = true; boot.enableContainers = true;
systemd.services.setupVM = rec { systemd.services.setupVM = rec {
wantedBy = [ "gogs.service" "dovecot2.service" "nginx.service" ]; wantedBy = [ "gitea.service" "dovecot2.service" "nginx.service" ];
before = wantedBy; before = wantedBy;
serviceConfig = { serviceConfig = {
Type = "oneshot"; Type = "oneshot";
@ -17,7 +17,7 @@ let
}; };
script = '' script = ''
mkdir -p /srv/git.gebner.org mkdir -p /srv/git.gebner.org
chown git:git -R /srv/git.gebner.org chown gitea:gitea -R /srv/git.gebner.org
''; '';
}; };
@ -29,7 +29,7 @@ let
sqlite-interactive sqlite-interactive
]; ];
systemd.services."acme-gebner.org".serviceConfig.ExecStart = pkgs.lib.mkForce "true"; security.acme.server = "http://localhost";
networking.extraHosts = '' networking.extraHosts = ''
127.0.0.1 gebner.org www.gebner.org reader.gebner.org git.gebner.org mail.gebner.org radicale.gebner.org gabrielebner.at 127.0.0.1 gebner.org www.gebner.org reader.gebner.org git.gebner.org mail.gebner.org radicale.gebner.org gabrielebner.at