Compare commits

..

10 commits

5 changed files with 90 additions and 15 deletions

View file

@ -39,6 +39,13 @@
dataLocation = "${config.home.homeDirectory}/.local/share/task";
colorTheme = "light-256";
config.editor = "hx";
config.taskd = {
server = "henri-saudubray.fr:53589";
certificate = "/home/hms/.task/keys/public.cert";
key = "/home/hms/.task/keys/private.key";
ca = "/home/hms/.task/keys/ca.cert";
credentials = "personal/hms/2f8f33f0-a0b3-4f61-aba7-4d2b8c9cfbc7";
};
};
programs.jujutsu = {

View file

@ -4,24 +4,18 @@
./hardware-configuration.nix
./disk-config.nix
../../nixos/server.nix
./nginx.nix
./taskd.nix
./forgejo.nix
];
services.nginx = {
enable = true;
virtualHosts."henri-saudubray.fr" = {
enableACME = true;
forceSSL = true;
root = "/home/hms/www";
};
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
security.acme = {
acceptTerms = true;
defaults.email = "henri.saudubray@proton.me";
};
networking.firewall.allowedTCPPorts = [
80 # HTTP (nginx)
443 # HTTPS (nginx)
53589 # Taskserver
];
networking.hostName = "mystra";
networking.fqdn = "henri-saudubray.fr";
system.stateVersion = "25.11";
}

31
hosts/mystra/forgejo.nix Normal file
View file

@ -0,0 +1,31 @@
{ lib, config, ... }:
let
cfg = config.services.forgejo;
srv = cfg.settings.server;
in
{
services.nginx.virtualHosts."git.henri-saudubray.fr" = {
forceSSL = true;
enableACME = true;
extraConfig = ''
client_max_body_size 512M;
'';
locations."/".proxyPass = "http://localhost:${toString srv.HTTP_PORT}";
};
services.forgejo = {
enable = true;
database.type = "postgres";
lfs.enable = true;
settings = {
server = {
DOMAIN = "git.henri-saudubray.fr";
ROOT_URL = "https://${srv.DOMAIN}/";
HTTP_PORT = 3000;
SSH_PORT = lib.head config.services.openssh.ports;
};
service.DISABLE_REGISTRATION = true;
};
};
}

16
hosts/mystra/nginx.nix Normal file
View file

@ -0,0 +1,16 @@
{ ... }:
{
services.nginx = {
enable = true;
virtualHosts."henri-saudubray.fr" = {
enableACME = true;
forceSSL = true;
root = "/var/www/html";
};
};
security.acme = {
acceptTerms = true;
defaults.email = "henri.saudubray@proton.me";
};
}

27
hosts/mystra/taskd.nix Normal file
View file

@ -0,0 +1,27 @@
{ ... }:
{
# # NOTE:
# After server installation, you must synchronize the clients with
# taskd. To do so, export the user config as follows (on server):
# ```bash
# nixos-taskserver user export personal hms > hms_config.sh
# ```
# and copy it to the client machine. Run it (on client):
# ```bash
# sh hms_config.sh
# ```
# and initialize synchronization (on client):
# ```bash
# task sync init
# ```
# See [this link](https://wiki.kunzelma.de/taskwarrior) for more.
#
# # TODO: find a better way than the mess above.
services.taskserver = {
enable = true;
fqdn = "henri-saudubray.fr";
listenHost = "::";
organisations.personal.users = [ "hms" ];
};
}