update hass components

This commit is contained in:
mjallen18
2025-07-15 15:28:05 -05:00
parent 9587efe719
commit 0fcb6e07f7
25 changed files with 430 additions and 523 deletions

View File

@@ -1,236 +0,0 @@
- id: '1740678838632'
alias: Bedroom Light Switch
description: ''
triggers:
- domain: mqtt
device_id: 8b3a5a5b6faaba744c70ee940446a8af
type: action
subtype: on-press
trigger: device
id: on press
- domain: mqtt
device_id: 8b3a5a5b6faaba744c70ee940446a8af
type: action
subtype: off-press
trigger: device
id: off press
- domain: mqtt
device_id: 8b3a5a5b6faaba744c70ee940446a8af
type: action
subtype: up-press
trigger: device
id: up press
- domain: mqtt
device_id: 8b3a5a5b6faaba744c70ee940446a8af
type: action
subtype: down-press
trigger: device
id: down press
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- on press
sequence:
- action: light.turn_on
metadata: {}
data:
transition: 2
brightness_pct: 100
kelvin: 6004
target:
entity_id: light.bedroom_lights
- conditions:
- condition: trigger
id:
- off press
sequence:
- action: light.turn_off
metadata: {}
data:
transition: 2
target:
entity_id: light.bedroom_lights
- conditions:
- condition: trigger
id:
- up press
sequence:
- action: light.turn_on
metadata: {}
data:
brightness_step_pct: 10
target:
entity_id: light.bedroom_lights
- conditions:
- condition: trigger
id:
- down press
sequence:
- action: light.turn_on
metadata: {}
data:
brightness_step_pct: -10
target:
entity_id: light.bedroom_lights
mode: single
- id: '1740697291423'
alias: Living Rooom Lights
description: ''
triggers:
- domain: mqtt
device_id: b4fb325dfe68d4f80391417998f35843
type: action
subtype: on-press
trigger: device
id: on press
- domain: mqtt
device_id: b4fb325dfe68d4f80391417998f35843
type: action
subtype: off-press
trigger: device
id: off press
- domain: mqtt
device_id: b4fb325dfe68d4f80391417998f35843
type: action
subtype: up-press
trigger: device
id: up press
- domain: mqtt
device_id: b4fb325dfe68d4f80391417998f35843
type: action
subtype: down-press
trigger: device
id: down press
- domain: mqtt
device_id: b4fb325dfe68d4f80391417998f35843
type: action
subtype: on-hold
trigger: device
id: on-hold
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- on press
sequence:
- action: light.turn_on
metadata: {}
data:
transition: 2
brightness_pct: 100
kelvin: 6004
target:
entity_id:
- light.living_room_lights
- conditions:
- condition: trigger
id:
- off press
sequence:
- action: light.turn_off
metadata: {}
data:
transition: 2
target:
entity_id:
- light.living_room_lights
- conditions:
- condition: trigger
id:
- up press
sequence:
- action: light.turn_on
metadata: {}
data:
brightness_step_pct: 10
target:
entity_id: light.living_room_lights
- conditions:
- condition: trigger
id:
- down press
sequence:
- action: light.turn_on
metadata: {}
data:
brightness_step_pct: -10
target:
entity_id: light.living_room_light_1
- conditions:
- condition: trigger
id:
- on-hold
sequence:
- action: light.turn_on
metadata: {}
data:
transition: 0
brightness_pct: 100
rgb_color:
- 224
- 27
- 36
target:
entity_id: light.living_room_lights
mode: single
- id: '1741048414771'
alias: Front Closet
description: ''
triggers:
- type: present
device_id: c6519ea1e715f397dbbf7b73452f9e49
entity_id: c3a7b8892b8b372d2c40556e770ddc68
domain: binary_sensor
trigger: device
for:
hours: 0
minutes: 0
seconds: 0
id: present
- type: not_present
device_id: c6519ea1e715f397dbbf7b73452f9e49
entity_id: c3a7b8892b8b372d2c40556e770ddc68
domain: binary_sensor
trigger: device
for:
hours: 0
minutes: 0
seconds: 5
id: not
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- present
sequence:
- action: light.turn_on
metadata: {}
data:
transition: 2
brightness_pct: 100
kelvin: 6010
target:
entity_id:
- light.front_closet_light_1
- light.front_closet_light_2
- conditions:
- condition: trigger
id:
- not
sequence:
- action: light.turn_off
metadata: {}
data:
transition: 2
target:
entity_id:
- light.front_closet_light_1
- light.front_closet_light_2
mode: single

View File

@@ -1,576 +0,0 @@
- id: '1692388103102'
alias: Weekly Backup
description: Create a full backup every Sunday at 3 am and store it on the NAS
trigger:
- platform: time
at: 03:00:00
condition:
- condition: time
weekday:
- sun
action:
- service: hassio.backup_full
data:
compressed: true
mode: single
- id: '1692389901297'
alias: Livingroom Lights
description: ''
trigger:
- platform: device
domain: mqtt
device_id: 37d42431de65199af00220b43dae04c1
type: action
subtype: on_press
id: 'on'
- platform: device
domain: mqtt
device_id: 37d42431de65199af00220b43dae04c1
type: action
subtype: off_press
id: 'off'
- platform: device
domain: mqtt
device_id: 37d42431de65199af00220b43dae04c1
type: action
subtype: up_press
id: up
- platform: device
domain: mqtt
device_id: 37d42431de65199af00220b43dae04c1
type: action
subtype: down_press
id: down
- platform: device
domain: mqtt
device_id: 37d42431de65199af00220b43dae04c1
type: action
subtype: on_hold
id: hold
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- 'on'
sequence:
- data:
brightness_pct: 100
color_temp_kelvin: 5000
transition: 1
target:
entity_id: light.livingroom_lights
action: light.turn_on
- conditions:
- condition: trigger
id:
- 'off'
sequence:
- data:
transition: 1
target:
entity_id: light.livingroom_lights
action: light.turn_off
- conditions:
- condition: trigger
id:
- hold
sequence:
- data:
brightness_pct: 100
rgb_color:
- 255
- 38
- 0
transition: 1
target:
entity_id: light.livingroom_lights
action: light.turn_on
- conditions:
- condition: trigger
id:
- dim up
sequence:
- data:
brightness_step_pct: 20
target:
entity_id: light.livingroom_lights
action: light.turn_on
- conditions:
- condition: trigger
id:
- dim down
sequence:
- data:
brightness_step_pct: -20
target:
entity_id: light.livingroom_lights
action: light.turn_on
mode: single
- id: '1692390365798'
alias: Bedroom Lights
description: ''
triggers:
- domain: mqtt
device_id: a492c0abb8f14e0888df08101f77f484
type: action
subtype: off_press
id: 'off'
trigger: device
- domain: mqtt
device_id: a492c0abb8f14e0888df08101f77f484
type: action
subtype: on_press
id: 'on'
trigger: device
- domain: mqtt
device_id: a492c0abb8f14e0888df08101f77f484
type: action
subtype: up_press
id: up
trigger: device
- domain: mqtt
device_id: a492c0abb8f14e0888df08101f77f484
type: action
subtype: down_press
id: down
trigger: device
- domain: mqtt
device_id: a492c0abb8f14e0888df08101f77f484
type: action
subtype: on_hold
id: hold on
trigger: device
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- 'on'
sequence:
- data:
brightness_pct: 100
color_temp_kelvin: 5000
transition: 1
target:
entity_id: light.bedroom_lights
action: light.turn_on
- conditions:
- condition: trigger
id:
- 'off'
sequence:
- data:
transition: 1
target:
entity_id:
- light.bedroom_lights
action: light.turn_off
- conditions:
- condition: trigger
id:
- up
sequence:
- device_id: 171fa001578683249ff26f2d85817fef
domain: light
entity_id: 55d41329665f60a55a732c5bbececd22
type: brightness_increase
- device_id: c92fea3d569ca668e6617a189f917a28
domain: light
entity_id: 0c8630c2b37ae9615f9cf815aaebf40f
type: brightness_increase
- conditions:
- condition: trigger
id:
- down
sequence:
- device_id: 171fa001578683249ff26f2d85817fef
domain: light
entity_id: 55d41329665f60a55a732c5bbececd22
type: brightness_decrease
- device_id: c92fea3d569ca668e6617a189f917a28
domain: light
entity_id: 0c8630c2b37ae9615f9cf815aaebf40f
type: brightness_decrease
- conditions:
- condition: trigger
id:
- hold on
sequence:
- metadata: {}
data:
rgb_color:
- 255
- 0
- 0
brightness_pct: 100
target:
entity_id: light.bedroom_lights
action: light.turn_on
mode: single
- id: '1694441037420'
alias: Air Purifier Schedule
description: ''
trigger:
- platform: time
at: 07:00:00
id: fan off
- platform: time
at: '23:00:00'
id: fan on
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- fan on
sequence:
- service: fan.set_percentage
data:
percentage: 100
target:
entity_id: fan.bedroom_air_purifier
- conditions:
- condition: trigger
id:
- fan off
sequence:
- service: fan.set_preset_mode
data:
preset_mode: auto
target:
entity_id: fan.bedroom_air_purifier
mode: single
- id: '1705949582146'
alias: Ice Maker Power Schedule
description: ''
trigger:
- platform: time_pattern
hours: '*'
minutes: '0'
seconds: '0'
condition: []
action:
- type: toggle
device_id: 41c66532e23aadc4c6ac95e520e5d345
entity_id: bd17ac75a91e62ed7e6b148cfe33d43d
domain: switch
- alias: Set Ice Maker Light to Dim
device_id: 41c66532e23aadc4c6ac95e520e5d345
domain: select
entity_id: 8f4f90c62b00df9008d14f7ce8967199
type: select_option
option: 'On'
mode: single
- id: '1708978401738'
alias: Soundbar
description: ''
trigger: []
condition: []
action:
- service: media_player.turn_on
metadata: {}
data: {}
target:
entity_id: media_player.soundbar
- service: media_player.select_source
metadata: {}
data:
source: wifi
target:
entity_id: media_player.soundbar
- service: media_player.play_media
metadata: {}
data:
media_content_id: media-source://radio_browser/2eff3a1f-b821-4267-9f37-f8d7e72061e4
media_content_type: audio/mpeg
target:
entity_id: media_player.soundbar
mode: single
- id: '1711147285926'
alias: Grow Light Schedule
description: ''
trigger:
- platform: time
at: 07:00:00
id: day
- platform: time
at: '20:00:00'
id: night
condition: []
action:
- choose:
- conditions:
- condition: trigger
id:
- day
sequence:
- service: switch.turn_on
metadata: {}
data: {}
target:
entity_id: switch.grow_lights
- conditions:
- condition: trigger
id:
- night
sequence:
- service: switch.turn_off
metadata: {}
data: {}
target:
entity_id: switch.grow_lights
mode: single
- id: '1723142554607'
alias: Restart Luci's Box
description: for some reason this box sucks and needs to get reboot periodically
trigger:
- platform: time_pattern
hours: '*'
condition: []
action:
- type: turn_off
device_id: e7f8974c31567dddbbffb036fe8381bc
entity_id: e1e71e4acdfcbb6c4afdc174807ad8be
domain: switch
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- type: turn_on
device_id: e7f8974c31567dddbbffb036fe8381bc
entity_id: e1e71e4acdfcbb6c4afdc174807ad8be
domain: switch
- type: turn_on
device_id: d5eb3c182a1ef2a231b94b09c26aed45
entity_id: 7106df7ebde274ac4bc2b197d5c45bea
domain: fan
- device_id: d5eb3c182a1ef2a231b94b09c26aed45
domain: number
entity_id: 59a7cd3cb2883bf6002f789c2ff4824c
type: set_value
value: 3
mode: single
- id: '1724707092916'
alias: HASS Updates
description: ''
use_blueprint:
path: edwardtfn/auto_update_scheduled.yaml
input:
schedule_entity: schedule.updates
restart_bool: true
- id: '1724707291994'
alias: IOT Battery Checker
description: ''
use_blueprint:
path: sbyx/low-battery-level-detection-notification-for-all-battery-sensors.yaml
input:
exclude:
entity_id: []
device_id:
- 66e9cee67a740e8925dae5fc9ce940f0
- df76e3a3e48b49e13bd3006350826740
actions:
- action: notify.persistent_notification
metadata: {}
data:
message: Device Battery Low
- id: '1729708621620'
alias: Closet Lights
description: ''
triggers:
- type: present
device_id: 0924cbdcd24416e768caa52301db59f7
entity_id: e9f0acef50550033cd96155bd501b7c3
domain: binary_sensor
trigger: device
for:
hours: 0
minutes: 0
seconds: 0
id: Present
- type: not_present
device_id: 0924cbdcd24416e768caa52301db59f7
entity_id: e9f0acef50550033cd96155bd501b7c3
domain: binary_sensor
trigger: device
for:
hours: 0
minutes: 0
seconds: 0
id: empty
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- Present
sequence:
- action: light.turn_on
metadata: {}
data:
transition: 3
brightness_pct: 100
kelvin: 5008
target:
device_id:
- e25128ac8fcf62af66a039cde3104760
- ddcfd5ea4fc5f5a88e18325b01c615db
- conditions:
- condition: trigger
id:
- empty
sequence:
- action: light.turn_off
metadata: {}
data:
transition: 3
target:
device_id:
- e25128ac8fcf62af66a039cde3104760
- ddcfd5ea4fc5f5a88e18325b01c615db
mode: single
- id: '1729881464325'
alias: Bedroom Closet
description: ''
triggers:
- type: present
device_id: 28e7f211c72409fe244183219abf6ffa
entity_id: aa474f323868586cef62070654f36936
domain: binary_sensor
trigger: device
id: Present
- type: not_present
device_id: 28e7f211c72409fe244183219abf6ffa
entity_id: aa474f323868586cef62070654f36936
domain: binary_sensor
trigger: device
id: empty
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- Present
sequence:
- type: turn_on
device_id: f5936d6143b7927433e9c0430c79acab
entity_id: f6ec42c9db2c191866a335a346b1ec44
domain: switch
- conditions:
- condition: trigger
id:
- empty
sequence:
- type: turn_off
device_id: f5936d6143b7927433e9c0430c79acab
entity_id: f6ec42c9db2c191866a335a346b1ec44
domain: switch
mode: single
- id: '1740179328446'
alias: Living Room Lights
description: ''
triggers:
- domain: mqtt
device_id: f7482a462dc7cc05b4ceaa0d882dc469
type: action
subtype: off_press
trigger: device
id: 'off'
- domain: mqtt
device_id: f7482a462dc7cc05b4ceaa0d882dc469
type: action
subtype: on_press
trigger: device
id: 'on'
- domain: mqtt
device_id: f7482a462dc7cc05b4ceaa0d882dc469
type: action
subtype: up_press
trigger: device
id: up
- domain: mqtt
device_id: f7482a462dc7cc05b4ceaa0d882dc469
type: action
subtype: down_press
trigger: device
id: down
- domain: mqtt
device_id: f7482a462dc7cc05b4ceaa0d882dc469
type: action
subtype: on_hold
trigger: device
id: hold on
conditions: []
actions:
- choose:
- conditions:
- condition: trigger
id:
- 'on'
sequence:
- data:
brightness_pct: 100
color_temp_kelvin: 5000
transition: 1
action: light.turn_on
target:
entity_id: light.livingroom_lights
- conditions:
- condition: trigger
id:
- 'off'
sequence:
- data:
transition: 1
action: light.turn_off
target:
entity_id: light.livingroom_lights
- conditions:
- condition: trigger
id:
- up
sequence:
- device_id: 8bc2033b03d5a474ca3204c5ca53e308
domain: light
entity_id: 4a3cc9043ff985e9271683e1916bd9e1
type: brightness_increase
- device_id: 8f4f51aed9b3b4284f520af25358efd9
domain: light
entity_id: f45e74498c4b6bae65aaf5adf67e29d6
type: brightness_increase
- conditions:
- condition: trigger
id:
- down
sequence:
- device_id: 8bc2033b03d5a474ca3204c5ca53e308
domain: light
entity_id: 4a3cc9043ff985e9271683e1916bd9e1
type: brightness_decrease
- device_id: 8bc2033b03d5a474ca3204c5ca53e308
domain: light
entity_id: 4a3cc9043ff985e9271683e1916bd9e1
type: brightness_decrease
- conditions:
- condition: trigger
id:
- hold on
sequence:
- metadata: {}
data:
rgb_color:
- 255
- 0
- 0
brightness_pct: 100
action: light.turn_on
target:
entity_id: light.livingroom_lights
mode: single

View File

@@ -1,40 +0,0 @@
{ lib, pkgs, ... }:
let
kernel = pkgs.linuxPackages_latest;
in
{
# Configure bootloader with lanzaboot and secureboot
boot = {
kernelModules = [ "nct6775" ];
loader = {
systemd-boot.enable = true;
efi = {
canTouchEfiVariables = true;
efiSysMountPoint = "/boot";
};
};
initrd = {
verbose = false;
systemd.enable = true;
};
plymouth = {
enable = true;
};
kernelPackages = kernel;
kernelParams = [
"quiet"
"splash"
];
consoleLogLevel = 3;
bootspec.enable = true;
};
environment.systemPackages = with pkgs; [
edk2-uefi-shell
];
}

View File

@@ -1,141 +0,0 @@
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page, on
# https://search.nixos.org/options and in the NixOS manual (`nixos-help`).
{ config, lib, pkgs, ... }:
let
user = "hass-admin";
password = "$y$j9T$EkPXmsmIMFFZ.WRrBYCxS1$P0kwo6e4.WM5DsqUcEqWC3MrZp5KfCjxffraMFZWu06";
SSID = "Joey's Jungle 5G";
SSIDpassword = "kR8v&3Qd"; # config.sops.templates."wifi-password".content;
interface = "wlp0s20f3";
timezone = "America/Chicago";
hostname = "jallen-hass";
in
{
imports = [
# Include the results of the hardware scan.
./boot.nix
./hardware-configuration.nix
./impermanence.nix
./homeassistant.nix
../default.nix
];
# Enable nix flakes and nix-command tools
nix.settings.experimental-features = [
"nix-command"
"flakes"
];
nix.settings.trusted-users = [ "@wheel" ];
# Set your time zone.
time.timeZone = timezone;
networking = {
networkmanager = {
enable = true;
# Configure the static connection for eno1
# ensureProfiles = {
# profiles = {
# joeys-jungle = {
# connection = {
# id = "joeys-jungle";
# permissions = "";
# type = "wifi";
# };
# ipv4 = {
# dns-search = "";
# method = "auto";
# };
# ipv6 = {
# addr-gen-mode = "stable-privacy";
# dns-search = "";
# method = "auto";
# };
# wifi = {
# mac-address-blacklist = "";
# mode = "infrastructure";
## ssid = SSID;
# };
# wifi-security = {
# auth-alg = "open";
# key-mgmt = "wpa-psk";
# psk = SSIDpassword;
# };
# };
# "static-eno1" = {
# connection = {
# id = "static-eno1";
# type = "ethernet";
# interface-name = "eno1";
# };
# ipv4 = {
# method = "manual";
# addresses = "10.0.1.19/24";
# gateway = "10.0.1.1";
# dns = "10.0.1.1";
# };
# };
# };
# };
};
hostName = hostname;
wireless = {
enable = false;
networks."${SSID}".psk = SSIDpassword;
interfaces = [ interface ];
};
};
environment.systemPackages = with pkgs; [
vim
htop
git
protonmail-bridge
pass
gnome-keyring
openssl
];
services.xserver.desktopManager.surf-display = {
enable = true;
defaultWwwUri = "http://jallen-hass:8123"; # todo: external maybe for reasons???
};
services.openssh.enable = true;
services.protonmail-bridge = {
enable = true;
path = with pkgs; [ pass gnome-keyring ];
};
# Enable Avahi for .local hostname resolution
services.avahi = {
enable = true;
nssmdns4 = true; # For modern systems, use nssmdns4 instead of nssmdns
publish = {
enable = true;
addresses = true;
domain = true;
workstation = true;
};
};
users = {
mutableUsers = false;
users."${user}" = {
isNormalUser = lib.mkForce true;
initialHashedPassword = password;
extraGroups = [
"wheel"
"docker"
"network-manager"
"hass"
];
shell = pkgs.zsh;
};
};
}

View File

@@ -1,70 +0,0 @@
# Do not modify this file! It was generated by nixos-generate-config
# and may be overwritten by future invocations. Please make changes
# to /etc/nixos/configuration.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod" "sdhci_pci" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
fileSystems."/" =
{ device = "none";
fsType = "tmpfs";
};
fileSystems."/boot" =
{ device = "/dev/disk/by-uuid/AB0D-A6A2";
fsType = "vfat";
options = [ "fmask=0022" "dmask=0022" ];
};
fileSystems."/nix" =
{ device = "/dev/disk/by-uuid/a6ef033d-c305-42d9-88b2-5591008b2a11";
fsType = "btrfs";
options = [ "subvol=nix" ];
};
fileSystems."/etc" =
{ device = "/dev/disk/by-uuid/a6ef033d-c305-42d9-88b2-5591008b2a11";
fsType = "btrfs";
options = [ "subvol=etc" ];
};
fileSystems."/var/log" =
{ device = "/dev/disk/by-uuid/a6ef033d-c305-42d9-88b2-5591008b2a11";
fsType = "btrfs";
options = [ "subvol=log" ];
};
fileSystems."/root" =
{ device = "/dev/disk/by-uuid/a6ef033d-c305-42d9-88b2-5591008b2a11";
fsType = "btrfs";
options = [ "subvol=root" ];
};
fileSystems."/home" =
{ device = "/dev/disk/by-uuid/a6ef033d-c305-42d9-88b2-5591008b2a11";
fsType = "btrfs";
options = [ "subvol=home" ];
};
swapDevices =
[ { device = "/dev/disk/by-uuid/d631d42b-b70a-4579-bfb4-57412ae7c682"; }
];
# Enables DHCP on each ethernet and wireless interface. In case of scripted networking
# (the default) this is the recommended approach. When using systemd-networkd it's
# still possible to use this option, but it's recommended to use it in conjunction
# with explicit per-interface declarations with `networking.interfaces.<interface>.useDHCP`.
networking.useDHCP = lib.mkDefault true;
# networking.interfaces.eno1.useDHCP = lib.mkDefault true;
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}

View File

@@ -1,64 +0,0 @@
{ lib, pkgs, ... }:
let
shellAliases = {
ll = "ls -alh";
update-boot = "sudo nixos-rebuild boot --max-jobs 10 --build-host admin@10.0.1.3";
update-switch = "sudo nixos-rebuild switch --max-jobs 10 --build-host admin@10.0.1.3";
update-flake = "sudo nix flake update ~/nix-config";
update-nas = "nixos-rebuild switch --use-remote-sudo --target-host admin@10.0.1.3 --build-host admin@10.0.1.3 --flake ~/nix-config#jallen-nas";
nas-ssh = "kitten ssh admin@10.0.1.3";
ducks = "du -cksh * | sort -hr | head -n 15";
};
gitAliases = {
co = "checkout";
ci = "commit";
cia = "commit --amend";
s = "status";
st = "status";
b = "branch";
p = "pull --rebase";
pu = "push";
};
in
{
home.username = "hass-admin";
home.homeDirectory = "/home/hass-admin";
home.stateVersion = "23.11";
programs.home-manager.enable = true;
programs = {
fish.enable = false;
mangohud.enable = true;
java.enable = true;
zsh = {
enable = true;
enableCompletion = true;
autosuggestion.enable = true;
syntaxHighlighting.enable = true;
shellAliases = shellAliases;
oh-my-zsh = {
enable = true;
plugins = [ "git" ];
theme = "fishy";
};
};
};
programs.git = {
enable = true;
userName = "mjallen18";
userEmail = "matt.l.jallen@gmail.com";
aliases = gitAliases;
};
home.packages = with pkgs; [
age
fastfetch
firefox
];
}

View File

@@ -1,453 +0,0 @@
{ config, pkgs, ... }:
let
mosquittoPort = 1883;
zigbee2mqttPort = 8080;
ha-bambulab = pkgs.stdenv.mkDerivation {
pname = "ha-bambulab";
version = "v2.1.5"; # Update with correct version
src = pkgs.fetchFromGitHub {
owner = "greghesp"; # Update with correct owner
repo = "ha-bambulab"; # Update with correct repo name
rev = "v2.1.5"; # Or specific tag/commit
sha256 = "sha256-iVcNFdkzdMVjbQuzrTLib8fhirnc+OJdPzM60EnyVe0="; # Replace with actual hash
};
installPhase = ''
mkdir -p $out/custom_components
cp -r custom_components/bambu_lab $out/custom_components/
'';
};
ha-gehome = pkgs.stdenv.mkDerivation {
pname = "ha-gehome";
version = "v2025.2.1"; # Update with correct version
src = pkgs.fetchFromGitHub {
owner = "simbaja"; # Update with correct owner
repo = "ha_gehome"; # Update with correct repo name
rev = "v2025.2.1"; # Or specific tag/commit
sha256 = "sha256-nb+KrJoWqvhqH6E7A22xXwQzTYp7yn+hl9WRDXn95Cc="; # Replace with actual hash
};
installPhase = ''
mkdir -p $out/custom_components
cp -r custom_components/ge_home $out/custom_components/
'';
};
ha-mail-and-packages = pkgs.stdenv.mkDerivation {
pname = "Home-Assistant-Mail-And-Packages";
version = "0.4.2"; # Update with correct version
src = pkgs.fetchFromGitHub {
owner = "moralmunky"; # Update with correct owner
repo = "Home-Assistant-Mail-And-Packages"; # Update with correct repo name
rev = "0.4.2"; # Or specific tag/commit
sha256 = "sha256-5LBTlRlkSUx8DOY+F7UvUs4dzjZKdBdgnDUdK6DBdew="; # Replace with actual hash
};
installPhase = ''
mkdir -p $out/custom_components
cp -r custom_components/mail_and_packages $out/custom_components/
'';
};
ha-overseerr = pkgs.stdenv.mkDerivation {
pname = "ha-overseerr";
version = "0.1.42"; # Update with correct version
src = pkgs.fetchFromGitHub {
owner = "vaparr"; # Update with correct owner
repo = "ha-overseerr"; # Update with correct repo name
rev = "0.1.42"; # Or specific tag/commit
sha256 = "sha256-UvUowCgfay9aRV+iC/AQ9vvJzhGZbH+/1kVjxPFBKcI="; # Replace with actual hash
};
installPhase = ''
mkdir -p $out/custom_components
cp -r custom_components/overseerr $out/custom_components/
'';
};
ha-petlibro = pkgs.stdenv.mkDerivation {
pname = "ha-petlibro";
version = "v1.0.21.1"; # Update with correct version
src = pkgs.fetchzip {
url = "https://github.com/jjjonesjr33/petlibro/archive/refs/tags/v1.0.21.1.zip";
sha256 = "sha256-3EckyAgWxlZeqy9g13yP2nKCcjnyVIp8EdiE/A1pNu4="; # Replace with actual hash
};
installPhase = ''
mkdir -p $out/custom_components
cp -r custom_components/petlibro $out/custom_components/
'';
};
ha-wyzeapi = pkgs.stdenv.mkDerivation {
pname = "ha-wyzeapi";
version = "0.1.32"; # Update with correct version
src = pkgs.fetchzip {
url = "https://github.com/SecKatie/ha-wyzeapi/archive/refs/tags/0.1.32.zip";
sha256 = "sha256-3xUynZBEHuO2hKLYCb2sBpJAe0JF/8uKqR304Y7JQmE="; # Replace with actual hash
};
installPhase = ''
mkdir -p $out/custom_components
cp -r custom_components/wyzeapi $out/custom_components/
'';
};
# In configuration.nix or a separate file
pythonSteam = pkgs.python3.withPackages (ps: [
(ps.buildPythonPackage rec {
pname = "steam";
version = "1.4.4"; # Check for the latest version
src = pkgs.fetchPypi {
inherit pname version;
sha256 = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA="; # Get the correct hash
};
doCheck = false;
propagatedBuildInputs = [ ps.requests ps.protobuf ];
})
]);
in
{
services.home-assistant = {
enable = true;
openFirewall = true;
configWritable = true; # todo
extraComponents = [
# Components required to complete the onboarding
"analytics"
"google_translate"
"met"
"radio_browser"
"shopping_list"
# 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"
];
customComponents = with pkgs.home-assistant-custom-components; [
auth-header
];
customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [
atomic-calendar-revive
bubble-card
button-card
hourly-weather
mini-graph-card
mini-media-player
multiple-entity-row
mushroom
vacuum-card
weather-chart-card
zigbee2mqtt-networkmap
];
# use postgresql instead of sqlite
extraPackages = ps: with ps; [
# Core functionality
aiohttp
aiodns
paho-mqtt
pillow
pytz
pyyaml
sqlalchemy
# Discovery & networking
zeroconf
netdisco
ifaddr
ssdp
# Device protocols
pyserial # Serial communications
bluepy # Bluetooth LE
# Smart home ecosystems
mutagen # Media file metadata
pysonos # Sonos
pywemo # Belkin WeMo
python-miio # Xiaomi devices
python-kasa # TP-Link
# Sensors & monitoring
meteocalc # Weather calculations
speedtest-cli # Internet speed
# Visualization & UI
matplotlib # Graphing
# Security
bcrypt
cryptography
pyjwt
# Media
ha-ffmpeg # Camera streams
# Specialized integrations
python-matter-server # Matter protocol
# System integrations
psutil # System monitoring
psycopg2
numpy
hassil
pyturbojpeg
paho-mqtt
pychromecast
pyatv
python-otbr-api
brother
pyipp
govee-ble
adguardhome
nextcord
aiogithubapi
jellyfin-apiclient-python
pylitterbot
dateparser
aionut
nextcloudmonitor
ollama
pynecil
aiopyarr
pysabnzbd
getmac
zigpy
bellows # For Zigbee EmberZNet-based adapters
zigpy-xbee # For XBee adapters
zigpy-deconz # For ConBee/RaspBee adapters
pyicloud # iCloud
pyatv # Apple TV
opencv-python
face-recognition
ibeacon-ble
gehomesdk
onedrive-personal-sdk
python-roborock
pythonSteam
apple-weatherkit
];
config = {
# Includes dependencies for a basic setup
# https://www.home-assistant.io/integrations/default_config/
default_config = {};
cloud = false;
frontend = {
themes = "!include_dir_merge_named themes";
};
"automation ui" = "!include /etc/nixos/hosts/homeassistant/automations.yaml";
"scene ui" = "!include /etc/nixos/hosts/homeassistant/scenes.yaml";
"script ui" = "!include /etc/nixos/hosts/homeassistant/scripts.yaml";
http = {
use_x_forwarded_for = true;
trusted_proxies = [
"172.30.33.0/24"
"10.0.1.3"
"10.0.1.0/24"
];
};
recorder = {
db_url = "postgresql://@/hass";
purge_keep_days = 180;
};
auth_header = {
debug = false;
username_header = "X-authentik-username";
};
# https://www.home-assistant.io/integrations/ota_updater/
zha.zigpy_config.ota.z2m_remote_index = "https://raw.githubusercontent.com/Koenkk/zigbee-OTA/master/index.json";
};
};
# https://www.home-assistant.io/integrations/automation/
# systemd.tmpfiles.rules = [
# "f ${config.services.home-assistant.configDir}/automations.yaml 0755 hass hass"
# ];
# This bypasses the component validation and places it directly in HA's data directory
system.activationScripts.installCustomComponents = ''
mkdir -p ${config.services.home-assistant.configDir}/custom_components
cp -r ${ha-bambulab}/custom_components/bambu_lab ${config.services.home-assistant.configDir}/custom_components/
cp -r ${ha-gehome}/custom_components/ge_home ${config.services.home-assistant.configDir}/custom_components/
cp -r ${ha-mail-and-packages}/custom_components/mail_and_packages ${config.services.home-assistant.configDir}/custom_components/
cp -r ${ha-overseerr}/custom_components/overseerr ${config.services.home-assistant.configDir}/custom_components/
cp -r ${ha-petlibro}/custom_components/petlibro ${config.services.home-assistant.configDir}/custom_components/
cp -r ${ha-wyzeapi}/custom_components/wyzeapi ${config.services.home-assistant.configDir}/custom_components/
ln -sf /etc/nixos/hosts/homeassistant/automations.yaml ${config.services.home-assistant.configDir}/automations.yaml
ln -sf /etc/nixos/hosts/homeassistant/scenes.yaml ${config.services.home-assistant.configDir}/scenes.yaml
ln -sf /etc/nixos/hosts/homeassistant/scripts.yaml ${config.services.home-assistant.configDir}/scripts.yaml
chown -R hass:hass ${config.services.home-assistant.configDir}
chmod -R 750 ${config.services.home-assistant.configDir}
'';
services = {
postgresql = {
enable = true;
ensureDatabases = [ "hass" ];
ensureUsers = [{
name = "hass";
ensureDBOwnership = true;
}];
};
# Enable and configure Mosquitto MQTT broker
mosquitto = {
enable = true;
listeners = [
{
acl = [ "pattern readwrite #" ];
omitPasswordAuth = true;
settings.allow_anonymous = true;
}
];
};
zigbee2mqtt = {
enable = true;
settings = {
homeassistant = {
enabled = config.services.home-assistant.enable;
# Optional: Home Assistant discovery topic (default: shown below)
# Note: should be different from [MQTT base topic](../mqtt.md) to prevent errors in HA software
discovery_topic = "homeassistant";
# Optional: Home Assistant status topic (default: shown below)
status_topic = "homeassistant/status";
# Optional: Experimental support for Home Assistant event entities, may break in the future (default: shown below) when enabled:
# - An `event` entity will be discovered for each 'action'.
# - The `event_type` attribute will contain the action itself, additional attributes like `button` will have further information.
experimental_event_entities = false;
# Optional: Home Assistant legacy action sensor (default: `false`), when enabled:
# - Zigbee2MQTT will send an empty 'action' after one has been send
# - A 'sensor_action' will be discovered
legacy_action_sensor = false;
};
permit_join = true;
# Web interface
frontend = {
port = zigbee2mqttPort; # Choose an available port
};
# MQTT configuration
mqtt = {
base_topic = "zigbee2mqtt";
server = "mqtt://localhost:1883";
# If using authentication:
# user = "mqttuser";
# password = "your-password";
};
serial = {
port = "/dev/ttyUSB0";
};
};
};
music-assistant = {
enable = true;
providers = [
# "airplay" # music-assistant: airplay support is missing libraop, a library we will not package because it depends on OpenSSL 1.1.
"apple_music"
"bluesound"
"builtin"
"chromecast"
"deezer"
"dlna"
"fanarttv"
"filesystem_local"
"filesystem_smb"
"fully_kiosk"
"hass"
"hass_players"
"jellyfin"
"musicbrainz"
"opensubsonic"
"player_group"
"plex"
"qobuz"
"radiobrowser"
"siriusxm"
"snapcast"
"sonos"
"sonos_s1"
"soundcloud"
"spotify"
"template_player_provider"
"test"
"theaudiodb"
"tidal"
"tunein"
"ytmusic"
];
};
# Enable AirPlay
pipewire = {
# opens UDP ports 6001-6002
raopOpenFirewall = true;
extraConfig.pipewire = {
"10-airplay" = {
"context.modules" = [
{
name = "libpipewire-module-raop-discover";
# increase the buffer size if you get dropouts/glitches
# args = {
# "raop.latency.ms" = 500;
# };
}
];
};
};
};
};
# Enable required hardware support for the Zigbee adapter
hardware.bluetooth.enable = true; # Some adapters use Bluetooth
# Ensure proper permissions for Zigbee USB devices
# services.udev.extraRules = ''
# # For CC2531, CC2530, CC1352P-2, CC2538 and similar adapters
# SUBSYSTEM=="tty", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="16a8", SYMLINK+="zigbee", MODE="0666"
# SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="zigbee", MODE="0666"
# # For ConBee/RaspBee by Dresden Elektronik
# SUBSYSTEM=="tty", ATTRS{idVendor}=="1cf1", ATTRS{idProduct}=="0030", SYMLINK+="zigbee", MODE="0666"
# # For Electrolama zig-a-zig-ah (zzh!)
# SUBSYSTEM=="tty", ATTRS{idVendor}=="1a86", ATTRS{idProduct}=="7523", SYMLINK+="zigbee", MODE="0666"
# '';
environment.systemPackages = with pkgs; [
mosquitto # MQTT command-line tools
usbutils # For lsusb to help identify your adapter
];
networking.firewall.allowedTCPPorts = [
mosquittoPort
zigbee2mqttPort
8095
8097
];
}

View File

@@ -1,57 +0,0 @@
{ ... }:
{
# Set up impernance configuration for things like bluetooth
# In this configuration with /etc and /var/log being persistent, only directories outside of that need to be done here. See hardware configuration for all mountpoints.
environment.persistence."/nix/persist/system" = {
hideMounts = true;
directories = [
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/tailscale"
"/var/lib/systemd/coredump"
"/var/lib/zigbee2mqtt"
"/var/lib/postgresql"
# "/var/lib/music-assistant"
"/etc/NetworkManager/system-connections"
"/etc/secureboot"
{
directory = "/var/lib/private/authentik/media";
user = "authentik";
group = "authentik";
mode = "u=rwx,g=,o=";
}
{
directory = "/var/lib/hass";
user = "hass";
group = "hass";
mode = "u=rwx,g=,o=";
}
{
directory = "/var/lib/private";
mode = "u=rwx,g=rx,o=";
}
{
directory = "/var/lib/colord";
user = "colord";
group = "colord";
mode = "u=rwx,g=rx,o=";
}
{
directory = "/etc/nix";
user = "root";
group = "wheel";
mode = "u=rwx,g=rx,o=rx";
}
];
files = [
"/var/cache-priv-key.pem"
"/etc/machine-id"
];
};
security.sudo.extraConfig = ''
# rollback results in sudo lectures after each reboot
Defaults lecture = never
'';
}

View File

@@ -22,6 +22,8 @@ let
2283 # immich
4444 # code-server
9012
8192
];
in
{

View File

@@ -310,6 +310,7 @@ in
};
hd-idle = {
enable = false;
environment = {
HD_IDLE_OPTS = "-a /dev/disk/by-id/ata-Samsung_SSD_860_EVO_500GB_S3Z1NW0KA10457X,/dev/disk/by-id/ata-SSD2SC240G1SA754D117-820_PNY29140000558890457,/dev/disk/by-id/ata-ST3000DM007-1WY10G_ZFN28XXS,/dev/disk/by-id/ata-ST3000DM007-1WY10G_ZFQ052KN,/dev/disk/by-id/ata-ST3000DM007-1WY10G_ZFQ052NN,/dev/disk/by-id/ata-ST3000VN007-2E4166_Z731JVZJ,/dev/disk/by-id/ata-ST4000VN008-2DR166_ZDHBNBGP,/dev/disk/by-id/ata-ST8000AS0002-1NA17Z_Z8411RMB";
};

View File

@@ -1,51 +0,0 @@
{ ... }:
let
hostAddress = "10.0.1.3";
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;
}
];
};
}