tidying
This commit is contained in:
parent
13afaf15a4
commit
85e38766ce
|
@ -21,7 +21,6 @@
|
||||||
nixos-wsl.inputs.flake-utils.follows = "flake-utils";
|
nixos-wsl.inputs.flake-utils.follows = "flake-utils";
|
||||||
nixos-wsl.inputs.flake-compat.follows = "flake-compat";
|
nixos-wsl.inputs.flake-compat.follows = "flake-compat";
|
||||||
|
|
||||||
|
|
||||||
tree-input.url = "github:kittywitch/tree";
|
tree-input.url = "github:kittywitch/tree";
|
||||||
tree-input.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
tree-input.inputs.nixpkgs.follows = "nixpkgs-unstable";
|
||||||
|
|
||||||
|
|
|
@ -1,36 +1,21 @@
|
||||||
{
|
{lib, ...}: let
|
||||||
self,
|
|
||||||
lib,
|
|
||||||
...
|
|
||||||
}: let
|
|
||||||
inherit (lib.modules) mkMerge;
|
inherit (lib.modules) mkMerge;
|
||||||
inherit (lib.lists) forEach;
|
|
||||||
inherit (builtins) attrNames;
|
|
||||||
|
|
||||||
containerAddresses = import "${self}/hosts/hetzner-arm/data/containerAddresses.nix";
|
|
||||||
in {
|
in {
|
||||||
programs.ssh.enable = true;
|
programs.ssh = {
|
||||||
programs.ssh.matchBlocks =
|
enable = true;
|
||||||
mkMerge
|
matchBlocks = mkMerge [
|
||||||
((forEach ["hetzner-arm" "hetzner-arm-decrypt" "vault" "vault-decrypt" "raspberry"] (hostname: {
|
(mkMerge (map (hostname: {
|
||||||
"${hostname}" = {
|
"${hostname}" = {
|
||||||
user = "root";
|
user = "root";
|
||||||
hostname = "${hostname}.servers.genderfucked.monster";
|
hostname = "${hostname}.servers.genderfucked.monster";
|
||||||
};
|
};
|
||||||
}))
|
}) ["hetzner-arm" "hetzner-arm-decrypt" "vault" "vault-decrypt" "raspberry"]))
|
||||||
++ (forEach (attrNames containerAddresses.containers) (name: {
|
|
||||||
"hetzner-arm-container-${name}" = {
|
|
||||||
user = "root";
|
|
||||||
hostname = "${containerAddresses.containers.${name}}";
|
|
||||||
proxyJump = "hetzner-arm";
|
|
||||||
};
|
|
||||||
}))
|
|
||||||
++ [
|
|
||||||
{
|
{
|
||||||
"blahaj" = {
|
"blahaj" = {
|
||||||
user = "chaos";
|
user = "chaos";
|
||||||
hostname = "blahaj.sapphicco.de";
|
hostname = "blahaj.sapphicco.de";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
]);
|
];
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,9 +31,6 @@ in {
|
||||||
[
|
[
|
||||||
presets.nixos.containerBase
|
presets.nixos.containerBase
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
|
|
||||||
#./profiles/postgres.nix
|
|
||||||
#./profiles/restic.nix
|
|
||||||
]
|
]
|
||||||
++ (with hosts.hetzner-arm.containers.caldav.profiles; [
|
++ (with hosts.hetzner-arm.containers.caldav.profiles; [
|
||||||
radicale
|
radicale
|
||||||
|
|
|
@ -35,8 +35,6 @@ in {
|
||||||
imports = with tree;
|
imports = with tree;
|
||||||
[
|
[
|
||||||
presets.nixos.containerBase
|
presets.nixos.containerBase
|
||||||
profiles.sshd
|
|
||||||
profiles.firewallAllow.ssh
|
|
||||||
|
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
]
|
]
|
||||||
|
|
|
@ -54,12 +54,11 @@ in {
|
||||||
[
|
[
|
||||||
presets.nixos.containerBase
|
presets.nixos.containerBase
|
||||||
|
|
||||||
profiles.nginx
|
|
||||||
|
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
]
|
]
|
||||||
++ (with hosts.hetzner-arm.containers.mail; [
|
++ (with hosts.hetzner-arm.containers.mail; [
|
||||||
modules.mailserver
|
modules.mailserver
|
||||||
|
|
||||||
profiles.mailserver
|
profiles.mailserver
|
||||||
profiles.restic
|
profiles.restic
|
||||||
]);
|
]);
|
||||||
|
|
|
@ -43,8 +43,6 @@ in {
|
||||||
imports = with tree;
|
imports = with tree;
|
||||||
[
|
[
|
||||||
presets.nixos.containerBase
|
presets.nixos.containerBase
|
||||||
profiles.sshd
|
|
||||||
profiles.firewallAllow.ssh
|
|
||||||
|
|
||||||
profiles.nginx
|
profiles.nginx
|
||||||
profiles.firewallAllow.httpCommon
|
profiles.firewallAllow.httpCommon
|
||||||
|
@ -89,7 +87,8 @@ in {
|
||||||
in {
|
in {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
enableACME = true;
|
enableACME = true;
|
||||||
locations = mkMerge ([
|
locations =
|
||||||
|
mkMerge [
|
||||||
{
|
{
|
||||||
"/mpd/flac" = {
|
"/mpd/flac" = {
|
||||||
proxyPass = "http://${containerIP}:${toString ports.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}" = {
|
"/mpd/opus-${quality}" = {
|
||||||
proxyPass = "http://${containerIP}:${toString ports."mpd-opus-${quality}"}";
|
proxyPass = "http://${containerIP}:${toString ports."mpd-opus-${quality}"}";
|
||||||
inherit extraConfig;
|
inherit extraConfig;
|
||||||
|
|
|
@ -27,13 +27,15 @@ in {
|
||||||
config = {...}: {
|
config = {...}: {
|
||||||
nixpkgs.pkgs = pkgs;
|
nixpkgs.pkgs = pkgs;
|
||||||
|
|
||||||
imports = with tree; [
|
imports = with tree;
|
||||||
|
[
|
||||||
presets.nixos.containerBase
|
presets.nixos.containerBase
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
|
]
|
||||||
./profiles/postgres.nix
|
++ (with hosts.hetzner-arm.containers.postgresql.profiles; [
|
||||||
./profiles/restic.nix
|
postgres
|
||||||
];
|
restic
|
||||||
|
]);
|
||||||
|
|
||||||
networking.firewall.allowedTCPPorts = [5432];
|
networking.firewall.allowedTCPPorts = [5432];
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,6 @@ in {
|
||||||
imports = with tree;
|
imports = with tree;
|
||||||
[
|
[
|
||||||
presets.nixos.containerBase
|
presets.nixos.containerBase
|
||||||
profiles.sshd
|
|
||||||
profiles.firewallAllow.ssh
|
|
||||||
|
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
]
|
]
|
||||||
|
|
|
@ -30,9 +30,6 @@ in {
|
||||||
imports = with tree;
|
imports = with tree;
|
||||||
[
|
[
|
||||||
presets.nixos.containerBase
|
presets.nixos.containerBase
|
||||||
profiles.sshd
|
|
||||||
profiles.firewallAllow.ssh
|
|
||||||
|
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
]
|
]
|
||||||
++ (with hosts.hetzner-arm.containers.social.profiles; [
|
++ (with hosts.hetzner-arm.containers.social.profiles; [
|
||||||
|
|
|
@ -37,10 +37,6 @@ in {
|
||||||
imports = with tree;
|
imports = with tree;
|
||||||
[
|
[
|
||||||
presets.nixos.containerBase
|
presets.nixos.containerBase
|
||||||
|
|
||||||
profiles.sshd
|
|
||||||
profiles.firewallAllow.ssh
|
|
||||||
|
|
||||||
./secrets.nix
|
./secrets.nix
|
||||||
]
|
]
|
||||||
++ (with hosts.hetzner-arm.containers.storage.profiles; [
|
++ (with hosts.hetzner-arm.containers.storage.profiles; [
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
{ config, pkgs, lib, ... }: let
|
{
|
||||||
|
config,
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
...
|
||||||
|
}: let
|
||||||
inherit (lib.modules) mkIf;
|
inherit (lib.modules) mkIf;
|
||||||
cfg = config.wsl;
|
cfg = config.wsl;
|
||||||
in
|
in {
|
||||||
{
|
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
system.build.tarballBuilderExt = pkgs.writeShellApplication {
|
system.build.tarballBuilderExt = pkgs.writeShellApplication {
|
||||||
name = "nixos-wsl-tarball-builder-ext";
|
name = "nixos-wsl-tarball-builder-ext";
|
||||||
|
|
|
@ -17,7 +17,9 @@
|
||||||
"tablet"
|
"tablet"
|
||||||
]
|
]
|
||||||
then usbSSHKeyFile
|
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 = {
|
builderDefaults = {
|
||||||
sshUser = "root";
|
sshUser = "root";
|
||||||
|
|
Loading…
Reference in a new issue