2024-10-10 14:59:38 -04:00
|
|
|
{
|
|
|
|
pkgs,
|
|
|
|
self,
|
|
|
|
...
|
|
|
|
}: {
|
2024-09-05 21:33:06 -04:00
|
|
|
imports = [
|
|
|
|
./assist.nix
|
2024-09-10 01:21:08 -04:00
|
|
|
./bluetooth.nix
|
2024-09-05 21:33:06 -04:00
|
|
|
./firmware.nix
|
|
|
|
./frontend.nix
|
2024-12-02 11:12:33 -05:00
|
|
|
|
2024-10-05 12:38:13 -04:00
|
|
|
./netdaemon
|
2024-12-02 11:12:33 -05:00
|
|
|
./spotify
|
|
|
|
./timer
|
2024-09-05 21:33:06 -04:00
|
|
|
|
2024-10-09 23:14:05 -04:00
|
|
|
self.nixosModules.ha-plus
|
|
|
|
];
|
2024-10-09 11:59:13 -04:00
|
|
|
|
2024-09-05 21:33:06 -04:00
|
|
|
services.home-assistant = {
|
|
|
|
enable = true;
|
|
|
|
|
|
|
|
extraComponents = [
|
2024-10-23 00:30:24 -04:00
|
|
|
"androidtv"
|
2024-09-28 21:33:11 -04:00
|
|
|
"androidtv_remote"
|
2024-09-05 21:33:06 -04:00
|
|
|
"caldav"
|
2024-09-28 21:33:11 -04:00
|
|
|
"cast"
|
2024-09-05 21:33:06 -04:00
|
|
|
"holiday"
|
|
|
|
"isal"
|
|
|
|
"met"
|
2024-09-19 22:16:11 -04:00
|
|
|
"switchbot"
|
2024-09-05 21:33:06 -04:00
|
|
|
"upnp"
|
|
|
|
"yamaha_musiccast"
|
|
|
|
];
|
|
|
|
|
2024-10-23 00:30:24 -04:00
|
|
|
customComponents = builtins.attrValues {
|
|
|
|
inherit
|
2024-11-20 15:17:55 -05:00
|
|
|
(self.scopedPackages.${pkgs.system}.hass-components)
|
2024-10-23 00:30:24 -04:00
|
|
|
yamaha-soundbar
|
|
|
|
;
|
|
|
|
};
|
|
|
|
|
2024-09-05 21:33:06 -04:00
|
|
|
config = {
|
2024-09-06 10:14:03 -04:00
|
|
|
homeassistant = {
|
|
|
|
name = "Home";
|
|
|
|
unit_system = "metric";
|
|
|
|
currency = "CAD";
|
|
|
|
country = "CA";
|
|
|
|
time_zone = "America/Montreal";
|
|
|
|
external_url = "https://homie.nelim.org";
|
|
|
|
};
|
|
|
|
|
2024-10-23 00:30:24 -04:00
|
|
|
media_player = [
|
|
|
|
{
|
|
|
|
platform = "yamaha_soundbar";
|
|
|
|
host = "192.168.0.96";
|
|
|
|
name = "Living Room Speaker";
|
|
|
|
sources = {
|
|
|
|
HDMI = "TV";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
];
|
|
|
|
|
2024-09-05 21:33:06 -04:00
|
|
|
# Proxy settings
|
|
|
|
http = {
|
|
|
|
server_host = "0.0.0.0";
|
|
|
|
trusted_proxies = ["100.64.0.8" "100.64.0.9"];
|
|
|
|
use_x_forwarded_for = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# `default_config` enables too much stuff. this is what I want from it
|
|
|
|
config = {};
|
|
|
|
dhcp = {};
|
|
|
|
history = {};
|
|
|
|
image_upload = {};
|
|
|
|
logbook = {};
|
|
|
|
mobile_app = {};
|
|
|
|
my = {};
|
|
|
|
sun = {};
|
|
|
|
zeroconf = {};
|
|
|
|
};
|
|
|
|
};
|
2024-10-06 22:16:59 -04:00
|
|
|
|
|
|
|
environment.systemPackages = [
|
|
|
|
(pkgs.writeShellApplication {
|
|
|
|
name = "yaml2nix";
|
|
|
|
runtimeInputs = with pkgs; [yj];
|
|
|
|
text = ''
|
|
|
|
input="$(yj < "$1")"
|
|
|
|
output="''${2:-""}"
|
|
|
|
|
|
|
|
nixCode="$(nix eval --expr "builtins.fromJSON '''$input'''" --impure | alejandra -q | sed 's/ = null;/ = {};/g')"
|
|
|
|
|
|
|
|
if [[ "$output" != "" ]]; then
|
|
|
|
echo "$nixCode" > "$output"
|
|
|
|
else
|
|
|
|
echo "$nixCode"
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
|
|
|
|
(pkgs.writeShellApplication {
|
|
|
|
name = "nix2yaml";
|
|
|
|
runtimeInputs = with pkgs; [remarshal];
|
|
|
|
text = ''
|
|
|
|
input="$1"
|
|
|
|
output="''${2:-""}"
|
|
|
|
|
|
|
|
yamlCode="$(nix eval --json --file "$input" | remarshal --if json --of yaml)"
|
|
|
|
|
|
|
|
if [[ "$output" != "" ]]; then
|
|
|
|
echo "$yamlCode" > "$output"
|
|
|
|
else
|
|
|
|
echo "$yamlCode"
|
|
|
|
fi
|
|
|
|
'';
|
|
|
|
})
|
|
|
|
];
|
2024-09-05 21:33:06 -04:00
|
|
|
}
|