This commit is contained in:
chaos 2023-10-16 18:17:28 +01:00
parent 13afaf15a4
commit 85e38766ce
No known key found for this signature in database
13 changed files with 39 additions and 63 deletions

View file

@ -21,7 +21,6 @@
nixos-wsl.inputs.flake-utils.follows = "flake-utils";
nixos-wsl.inputs.flake-compat.follows = "flake-compat";
tree-input.url = "github:kittywitch/tree";
tree-input.inputs.nixpkgs.follows = "nixpkgs-unstable";

View file

@ -1,36 +1,21 @@
{
self,
lib,
...
}: let
{lib, ...}: let
inherit (lib.modules) mkMerge;
inherit (lib.lists) forEach;
inherit (builtins) attrNames;
containerAddresses = import "${self}/hosts/hetzner-arm/data/containerAddresses.nix";
in {
programs.ssh.enable = true;
programs.ssh.matchBlocks =
mkMerge
((forEach ["hetzner-arm" "hetzner-arm-decrypt" "vault" "vault-decrypt" "raspberry"] (hostname: {
programs.ssh = {
enable = true;
matchBlocks = mkMerge [
(mkMerge (map (hostname: {
"${hostname}" = {
user = "root";
hostname = "${hostname}.servers.genderfucked.monster";
};
}))
++ (forEach (attrNames containerAddresses.containers) (name: {
"hetzner-arm-container-${name}" = {
user = "root";
hostname = "${containerAddresses.containers.${name}}";
proxyJump = "hetzner-arm";
}) ["hetzner-arm" "hetzner-arm-decrypt" "vault" "vault-decrypt" "raspberry"]))
{
"blahaj" = {
user = "chaos";
hostname = "blahaj.sapphicco.de";
};
}))
++ [
{
"blahaj" = {
user = "chaos";
hostname = "blahaj.sapphicco.de";
};
}
]);
}
];
};
}

View file

@ -31,9 +31,6 @@ in {
[
presets.nixos.containerBase
./secrets.nix
#./profiles/postgres.nix
#./profiles/restic.nix
]
++ (with hosts.hetzner-arm.containers.caldav.profiles; [
radicale

View file

@ -35,8 +35,6 @@ in {
imports = with tree;
[
presets.nixos.containerBase
profiles.sshd
profiles.firewallAllow.ssh
./secrets.nix
]

View file

@ -54,12 +54,11 @@ in {
[
presets.nixos.containerBase
profiles.nginx
./secrets.nix
]
++ (with hosts.hetzner-arm.containers.mail; [
modules.mailserver
profiles.mailserver
profiles.restic
]);

View file

@ -43,8 +43,6 @@ in {
imports = with tree;
[
presets.nixos.containerBase
profiles.sshd
profiles.firewallAllow.ssh
profiles.nginx
profiles.firewallAllow.httpCommon
@ -89,7 +87,8 @@ in {
in {
forceSSL = true;
enableACME = true;
locations = mkMerge ([
locations =
mkMerge [
{
"/mpd/flac" = {
proxyPass = "http://${containerIP}:${toString ports.mpd-flac}";
@ -97,7 +96,7 @@ in {
};
}
]
++ (forEach ["low" "medium" "high"] (quality: {
++ (mkMerge (forEach ["low" "medium" "high"] (quality: {
"/mpd/opus-${quality}" = {
proxyPass = "http://${containerIP}:${toString ports."mpd-opus-${quality}"}";
inherit extraConfig;

View file

@ -27,13 +27,15 @@ in {
config = {...}: {
nixpkgs.pkgs = pkgs;
imports = with tree; [
presets.nixos.containerBase
./secrets.nix
./profiles/postgres.nix
./profiles/restic.nix
];
imports = with tree;
[
presets.nixos.containerBase
./secrets.nix
]
++ (with hosts.hetzner-arm.containers.postgresql.profiles; [
postgres
restic
]);
networking.firewall.allowedTCPPorts = [5432];

View file

@ -30,8 +30,6 @@ in {
imports = with tree;
[
presets.nixos.containerBase
profiles.sshd
profiles.firewallAllow.ssh
./secrets.nix
]

View file

@ -30,9 +30,6 @@ in {
imports = with tree;
[
presets.nixos.containerBase
profiles.sshd
profiles.firewallAllow.ssh
./secrets.nix
]
++ (with hosts.hetzner-arm.containers.social.profiles; [

View file

@ -37,10 +37,6 @@ in {
imports = with tree;
[
presets.nixos.containerBase
profiles.sshd
profiles.firewallAllow.ssh
./secrets.nix
]
++ (with hosts.hetzner-arm.containers.storage.profiles; [

View file

@ -1,5 +1,5 @@
{ tree, ... }: {
imports = with tree;[
{tree, ...}: {
imports = with tree; [
users.root
users.chaos
profiles.sshd

View file

@ -1,8 +1,12 @@
{ config, pkgs, lib, ... }: let
{
config,
pkgs,
lib,
...
}: let
inherit (lib.modules) mkIf;
cfg = config.wsl;
in
{
in {
config = mkIf cfg.enable {
system.build.tarballBuilderExt = pkgs.writeShellApplication {
name = "nixos-wsl-tarball-builder-ext";
@ -49,4 +53,4 @@ in
'';
};
};
}
}

View file

@ -17,7 +17,9 @@
"tablet"
]
then usbSSHKeyFile
else if builtins.elem currentHostname ["wsl"] then normalSSHKeyFile else throw "host isn't configured for remote-builders";
else if builtins.elem currentHostname ["wsl"]
then normalSSHKeyFile
else throw "host isn't configured for remote-builders";
builderDefaults = {
sshUser = "root";