This commit is contained in:
mjallen18
2025-06-08 18:56:08 -05:00
parent 08b90ac1ae
commit 85d98ab453
5 changed files with 56 additions and 64 deletions

View File

@@ -97,7 +97,7 @@ let
};
# In configuration.nix or a separate file
pythonSteam = pkgs.python3.withPackages (ps: with ps; [
pythonSteam = pkgs.python3.withPackages (ps: [
(ps.buildPythonPackage rec {
pname = "steam";
version = "1.4.4"; # Check for the latest version

View File

@@ -16,6 +16,8 @@ in
./networking.nix
./services.nix
./sops.nix
./hass.nix
];
# Enable nix flakes and nix-command tools

51
hosts/pi5/hass.nix Normal file
View File

@@ -0,0 +1,51 @@
{ ... }:
let
hostAddress = "10.0.1.18";
localAddress = "10.0.5.18";
hassPort = 8192;
in
{
containers.homeassistant = {
autoStart = true;
privateNetwork = true;
hostAddress = hostAddress;
localAddress = localAddress;
config = { lib, ... }:
{
imports = [ ../homeassistant/homeassistant.nix ];
networking = {
firewall = {
enable = true;
allowedTCPPorts = [ hassPort ];
};
# Use systemd-resolved inside the container
# Workaround for bug https://github.com/NixOS/nixpkgs/issues/162686
useHostResolvConf = lib.mkForce false;
};
# Create and set permissions for required directories
system.activationScripts.gitea-dirs = ''
mkdir -p /var/lib/gitea
chown -R gitea:gitea /var/lib/gitea
chmod -R 775 /var/lib/gitea
mkdir -p /run/secrets/jallen-nas
chown -R gitea:gitea /run/secrets/jallen-nas
chmod -R 775 /run/secrets/jallen-nas
'';
services.resolved.enable = true;
system.stateVersion = "23.11";
};
};
networking.nat = {
forwardPorts = [
{
destination = "${localAddress}:${toString hassPort}";
sourcePort = hassPort;
}
];
};
}