This commit is contained in:
catvayor 2024-06-25 18:31:43 +02:00
parent 07146859b4
commit 88c9607c2f
5 changed files with 50 additions and 45 deletions

View file

@ -44,20 +44,16 @@ in
system.build.anywhere = pkgs.writeShellApplication { system.build.anywhere = pkgs.writeShellApplication {
name = "anywhere-deploy_${name}.sh"; name = "anywhere-deploy_${name}.sh";
runtimeInputs = [ pkgs.nixos-anywhere ]; runtimeInputs = [ pkgs.nixos-anywhere ];
# --kexec ${nodes.kat-kexec.config.system.build.kexecTarball}/${nodes.kat-kexec.config.system.kexec-installer.name}-${pkgs.stdenv.hostPlatform.system}.tar.gz
text = '' text = ''
nixos-anywhere --kexec ${nodes.kat-kexec.config.system.build.kexecTarball}/${nodes.kat-kexec.config.system.kexec-installer.name}-${pkgs.stdenv.hostPlatform.system}.tar.gz --store-paths ${config.system.build.diskoScriptNoDeps} ${config.system.build.toplevel} ${config.deployment.targetHost} nixos-anywhere --store-paths ${config.system.build.diskoScriptNoDeps} ${config.system.build.toplevel} ${config.deployment.targetHost}
''; '';
}; };
}; };
}; };
kat-probook = kat-probook =
{ { users, ... }:
name,
nodes,
users,
...
}:
{ {
deployment.allowLocalDeployment = true; deployment.allowLocalDeployment = true;
@ -73,7 +69,7 @@ in
}; };
kat-r86s = kat-r86s =
{ name, nodes, ... }: { users, ... }:
{ {
deployment.targetHost = "r86s.kat"; deployment.targetHost = "r86s.kat";
imports = [ imports = [
@ -82,10 +78,23 @@ in
]; ];
}; };
kat-virt = kat-watcher =
{ name, nodes, ... }: { users, ... }:
{ {
deployment.targetHost = "virt.kat"; deployment.targetHost = "watcher.kat";
imports = [
./machines/kat-watcher
(users.root { ssh = true; })
];
};
kat-virt =
{ users, ... }:
{
deployment = {
targetHost = "virt.kat";
tags = [ "kat-vms" ];
};
imports = [ imports = [
./machines/kat-virt ./machines/kat-virt
@ -95,9 +104,12 @@ in
}; };
kat-traque = kat-traque =
{ name, nodes, ... }: { users, ... }:
{ {
deployment.targetHost = "traque.kat"; deployment = {
targetHost = "traque.kat";
tags = [ "kat-vms" ];
};
imports = [ imports = [
./machines/kat-traque ./machines/kat-traque
@ -107,9 +119,12 @@ in
}; };
kat-mail-test = kat-mail-test =
{ name, nodes, ... }: { users, ... }:
{ {
deployment.targetHost = "mail-test.kat"; deployment = {
targetHost = "mail-test.kat";
tags = [ "kat-vms" ];
};
imports = [ imports = [
./machines/kat-mail-test ./machines/kat-mail-test
@ -118,20 +133,13 @@ in
users.users.root.openssh.authorizedKeys.keys = [ id_sylvain ]; users.users.root.openssh.authorizedKeys.keys = [ id_sylvain ];
}; };
kat-watcher =
{ name, nodes, ... }:
{
deployment.targetHost = "watcher.kat";
imports = [
./machines/kat-watcher
(users.root { ssh = true; })
];
};
kat-son = kat-son =
{ name, nodes, ... }: { users, ... }:
{ {
deployment.targetHost = "son.kat"; deployment = {
targetHost = "son.kat";
tags = [ "kat-vms" ];
};
imports = [ imports = [
./machines/kat-son ./machines/kat-son
(users.root { ssh = true; }) (users.root { ssh = true; })
@ -140,7 +148,7 @@ in
kat-iso = kat-iso =
{ {
name, users,
pkgs, pkgs,
modulesPath, modulesPath,
... ...
@ -175,7 +183,7 @@ in
kat-kexec = kat-kexec =
{ {
name, users,
pkgs, pkgs,
modulesPath, modulesPath,
lib, lib,

View file

@ -99,9 +99,7 @@ in
loginAccounts = { loginAccounts = {
"root@${host}" = { "root@${host}" = {
catchAll = [ catchAll = [ host ];
host
];
aliases = builtins.genList (id: "user${toString id}@${host}") 10 ++ [ "moderators@${host}" ]; aliases = builtins.genList (id: "user${toString id}@${host}") 10 ++ [ "moderators@${host}" ];
hashedPassword = "$2b$05$FoCVDECXYG0KXPigPuIZtuNFiviwSg8RuXx0FbnzC7ZRp.Mz8VWOe"; hashedPassword = "$2b$05$FoCVDECXYG0KXPigPuIZtuNFiviwSg8RuXx0FbnzC7ZRp.Mz8VWOe";
}; };

View file

@ -160,9 +160,7 @@ in
serviceConfig = { serviceConfig = {
WorkingDirectory = "/var/lib/traque"; WorkingDirectory = "/var/lib/traque";
ExecStart = "${traque-pkg}/bin/traque"; ExecStart = "${traque-pkg}/bin/traque";
ExecReload = [ ExecReload = [ "${pkgs.coreutils}/bin/kill -HUP $MAINPID" ];
"${pkgs.coreutils}/bin/kill -HUP $MAINPID"
];
User = "traque"; User = "traque";
Group = "traque"; Group = "traque";
DynamicUser = true; DynamicUser = true;

View file

@ -1,6 +1,4 @@
{ lib { lib, rustPlatform }:
, rustPlatform
}:
rustPlatform.buildRustPackage rec { rustPlatform.buildRustPackage rec {
pname = "traque"; pname = "traque";

View file

@ -90,12 +90,15 @@
}) vhosts; }) vhosts;
streamConfig = streamConfig =
builtins.concatStringsSep "\n" ( builtins.concatStringsSep "\n" (
lib.mapAttrsToList (vhost: sshport: lib.optionalString (!isNull sshport) '' lib.mapAttrsToList (
vhost: sshport:
lib.optionalString (!isNull sshport) ''
server { server {
listen ${toString sshport}; listen ${toString sshport};
proxy_pass ${kat-r86s}:${toString sshport}; proxy_pass ${kat-r86s}:${toString sshport};
} }
'') vhosts ''
) vhosts
) )
+ '' + ''
server { server {