nixfiles/hosts/hetzner-arm/containers/quassel/default.nix

59 lines
1.1 KiB
Nix
Raw Normal View History

2023-08-01 20:53:25 +01:00
{
2023-09-18 03:56:58 +01:00
self,
hostPath,
2023-08-01 20:53:25 +01:00
tree,
inputs,
config,
pkgs,
2023-08-01 20:53:25 +01:00
...
}: let
2023-09-18 03:56:58 +01:00
containerAddresses = import "${hostPath}/data/containerAddresses.nix";
hostIP = containerAddresses.host;
containerIP = containerAddresses.containers.quassel;
2023-08-01 20:53:25 +01:00
in {
containers.quassel = {
autoStart = true;
privateNetwork = true;
hostAddress = hostIP;
localAddress = containerIP;
specialArgs = {
inherit inputs;
inherit tree;
2023-09-18 03:56:58 +01:00
inherit self;
inherit hostPath;
};
config = {...}: {
nixpkgs.pkgs = pkgs;
2023-08-01 20:53:25 +01:00
imports = with tree;
[
2023-09-18 03:56:58 +01:00
presets.nixos.containerBase
2023-08-01 20:53:25 +01:00
profiles.sshd
2023-09-18 03:56:58 +01:00
profiles.firewallAllow.ssh
./secrets.nix
2023-08-01 20:53:25 +01:00
]
++ (with hosts.hetzner-arm.containers.quassel.profiles; [
2023-09-18 03:56:58 +01:00
quassel
restic
2023-08-01 20:53:25 +01:00
]);
2023-09-18 03:56:58 +01:00
networking.firewall.allowedTCPPorts = [4242];
2023-08-01 20:53:25 +01:00
2023-09-18 03:56:58 +01:00
home-manager.users.root.home.stateVersion = "23.05";
2023-08-01 20:53:25 +01:00
system.stateVersion = "23.05";
};
};
2023-09-18 03:56:58 +01:00
networking.nat.forwardPorts = [
{
sourcePort = 4242;
destination = "${containerIP}\:4242";
}
];
2023-08-01 20:53:25 +01:00
networking.firewall.allowedTCPPorts = [4242];
}