This commit is contained in:
mjallen18
2025-07-18 13:21:50 -05:00
parent 996e34d075
commit 407f8ede87
14 changed files with 83 additions and 133 deletions

View File

@@ -0,0 +1,7 @@
{ lib, namespace, ... }:
with lib;
{
options.${namespace}.hardware.disko = {
enable = mkEnableOption "enable disko";
};
}

View File

@@ -1,10 +1,13 @@
{ config, lib, system, ... }:
{ config, lib, system, namespace, ... }:
let
cfg = config.${namespace}.hardware.disko;
isArm = builtins.match "aarch64*" system != null;
rootDisk = "/dev/nvme0n1";
in
{
config = lib.mkIf (!isArm) {
imports = [ ../options.nix ];
config = lib.mkIf (cfg.enable && !isArm) {
disko.devices = {
nodev."/" = {
fsType = "tmpfs";

View File

@@ -44,43 +44,42 @@ in
"cloudflare"
"co2signal"
"color_extractor"
"esphome"
"ffmpeg"
"google_translate"
"holiday"
"homekit"
"isal"
"jellyfin"
"met"
"music_assistant"
"mqtt"
"nut"
"nextcloud"
"nws"
"ollama"
"onedrive"
"ping"
"radio_browser"
"samsungtv"
"season"
"shopping_list"
"simplefin"
"smartthings"
"subaru"
"upnp"
"vesync"
"workday"
"wyoming"
"google_translate"
"met"
"radio_browser"
"shopping_list"
"esphome"
# Recommended for fast zlib compression
# https://www.home-assistant.io/integrations/isal
"isal"
"subaru"
"vesync"
"mqtt" # Enables MQTT integration in HA
"ffmpeg" # Enables camera streams
"zha" # Enables Zigbee integration
"homekit"
"music_assistant"
"zha"
];
customComponents = with pkgs.home-assistant-custom-components; [
# nixpkgs
auth-header
localtuya
# packages
pkgs.${namespace}.ha-anycubic
pkgs.${namespace}.ha-bambulab
pkgs.${namespace}.ha-gehome
@@ -91,6 +90,7 @@ in
pkgs.${namespace}.ha-petlibro
pkgs.${namespace}.ha-wyzeapi
];
customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [
atomic-calendar-revive
bubble-card

View File

@@ -1,62 +0,0 @@
{ dream2nix, ... }:
let
hostAddress = "10.0.1.4";
localAddress = "10.0.4.2";
hassPort = 8123;
in
{
containers.homeassistant = {
autoStart = true;
privateNetwork = true;
hostAddress = hostAddress;
localAddress = localAddress;
bindMounts = {
"/var/lib/homeassistant" = {
hostPath = "/var/lib/homeassistant";
isReadOnly = false;
};
USB0 = {
hostPath = "/dev/ttyUSB0";
mountPoint = "/dev/ttyUSB0";
isReadOnly = false;
};
};
config = { lib, ... }:
{
imports = [
./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.hass-dirs = ''
mkdir -p /var/lib/homeassistant
chown -R homeassistant:homeassistant /var/lib/homeassistat
chmod -R 775 /var/lib/homeassistant
'';
services.resolved.enable = true;
system.stateVersion = "23.11";
};
};
networking.nat = {
forwardPorts = [
{
destination = "${localAddress}:${toString hassPort}";
sourcePort = hassPort;
}
];
};
}

View File

@@ -1,12 +1,12 @@
{
lib,
config,
pkgs,
namespace,
...
}:
with lib;
let
cfg = config.share.hardware.nvidia;
cfg = config.${namespace}.hardware.nvidia;
in
{
imports = [ ./options.nix ];

View File

@@ -1,7 +1,7 @@
{ lib, ... }:
{ lib, namespace, ... }:
with lib;
{
options.share.hardware.nvidia = {
options.${namespace}.hardware.nvidia = {
enable = mkEnableOption "nvidia hardware config";
enableOpen = mkOption {