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 {
name = "anywhere-deploy_${name}.sh";
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 = ''
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 =
{
name,
nodes,
users,
...
}:
{ users, ... }:
{
deployment.allowLocalDeployment = true;
@ -73,7 +69,7 @@ in
};
kat-r86s =
{ name, nodes, ... }:
{ users, ... }:
{
deployment.targetHost = "r86s.kat";
imports = [
@ -82,10 +78,23 @@ in
];
};
kat-virt =
{ name, nodes, ... }:
kat-watcher =
{ 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 = [
./machines/kat-virt
@ -95,9 +104,12 @@ in
};
kat-traque =
{ name, nodes, ... }:
{ users, ... }:
{
deployment.targetHost = "traque.kat";
deployment = {
targetHost = "traque.kat";
tags = [ "kat-vms" ];
};
imports = [
./machines/kat-traque
@ -107,9 +119,12 @@ in
};
kat-mail-test =
{ name, nodes, ... }:
{ users, ... }:
{
deployment.targetHost = "mail-test.kat";
deployment = {
targetHost = "mail-test.kat";
tags = [ "kat-vms" ];
};
imports = [
./machines/kat-mail-test
@ -118,20 +133,13 @@ in
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 =
{ name, nodes, ... }:
{ users, ... }:
{
deployment.targetHost = "son.kat";
deployment = {
targetHost = "son.kat";
tags = [ "kat-vms" ];
};
imports = [
./machines/kat-son
(users.root { ssh = true; })
@ -140,7 +148,7 @@ in
kat-iso =
{
name,
users,
pkgs,
modulesPath,
...
@ -175,7 +183,7 @@ in
kat-kexec =
{
name,
users,
pkgs,
modulesPath,
lib,

View file

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

View file

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

View file

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

View file

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