And it's not just "sunset + X minutes" where X would be a constant. In the winter this X is much shorter than in the summer.
For me X is then a "travelling" value which in the winter is at 1/3 between sunset (0°) and civil dusk (-6°), and in the summer it goes up to 2/3. Calculated as the moment when the blinds go down.
You made me check the code and actually I have it the other way around (and with different ratios, winter=-6°, summer=-2°), because else the blinds would go down too late in the summer (after 22:00).
For me X is then a "travelling" value which in the winter is at 1/3 between sunset (0°) and civil dusk (-6°), and in the summer it goes up to 2/3. Calculated as the moment when the blinds go down.
I'm using https://astral.readthedocs.io for this.