Repository navigation
esphome: allow user to configure state dir - #486701
karlbeecken wants to merge 1 commit into
Conversation
|
|
@oddlama you are listed as maintainer, not sure why the bot didn't tag you |
|
I also use impermanence and in this case it should suffice to use impermance to add Adding an option to change directories like this usually comes with some caveats, for example having to disable ProtectHome, disabling other hardening options or disabling DynamicUser (which then requires a real uid allocation on which we are short for system services). All of this just makes the service more complex, so if this can be solved with a simple bind mount, I would first advocate to use those and only add options to change the directory if there's a good reason to do so. Is there any reason a bind mount would not work for your usecase? |
|
I do not like that this will make the module rather complicated with many conditions most people cannot even reasonable verify. The PR linked above this comment removes DynamcUser which already removes much of the currently required complexity and maybe after that all those things can easily live in a persons own config? |
I agree, I think with #508178 this PR isn't really needed anymore, and anything further can be done in the user-side config. Thanks for the heads-up! |
Hi!
I wanted to erase my darlings and noticed esphome used a hardcoded state dir. I changed this and added an option to the esphome service that allows the user to set a custom stateDir. I tested it with my esphome setup, it is backwards-compatible and I also added a condition to disable ProtectHome when the state dir is under
/home. DynamicUser needs to be disabled for a different state dir than the default, and is conditionally disabled if the user changes this option. Otherwise, the behaviour stays as it was.Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.