sf
This commit is contained in:
@@ -1,12 +1,21 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
let
|
||||
cfg = config.${namespace}.services.home-assistant;
|
||||
|
||||
# ESPHome with littlefs-python added to PYTHONPATH so PlatformIO's
|
||||
# espressif32 platform builder can import it (needed for LittleFS support).
|
||||
esphomeWithLittlefs = pkgs.esphome.overridePythonAttrs (oldAttrs: {
|
||||
makeWrapperArgs = (oldAttrs.makeWrapperArgs or [ ]) ++ [
|
||||
"--prefix PYTHONPATH : ${pkgs.${namespace}.littlefs-python}/${pkgs.python3.sitePackages}"
|
||||
];
|
||||
});
|
||||
in
|
||||
{
|
||||
config = mkIf cfg.enable {
|
||||
@@ -15,6 +24,17 @@ in
|
||||
enable = true;
|
||||
openFirewall = true; # 6052
|
||||
address = "0.0.0.0";
|
||||
package = esphomeWithLittlefs;
|
||||
};
|
||||
};
|
||||
|
||||
# Add uv to the ESPHome service PATH so PlatformIO uses the Nix-provided
|
||||
# binary instead of downloading its own (which would fail due to permissions).
|
||||
# Also disable MemoryDenyWriteExecute so uv (a native Rust binary) can run.
|
||||
systemd.services.esphome = {
|
||||
path = [ pkgs.uv ];
|
||||
serviceConfig = {
|
||||
MemoryDenyWriteExecute = lib.mkForce false;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user