Loading
nixos/klipper: preserve SAVE_CONFIG for nixos-managed config
Klipper macros that use `SAVE_CONFIG` (eg. bed mesh calibration, PID tuning, ...) don't currently work with a nixos-managed config. This can be worked around by using `services.klipper.mutableConfig = true`, but then you lose out on being able to configure klipper from NixOS. This changes the default behaviour so that: 1. The config is stored in `services.klipper.configDir` instead of `/etc` 2. The config is copied instead of symlinked (keeping a timestamped backup of the existing config) 3. The `SAVE_CONFIG` section from the backup is copied over into the new config 4. The backup is deleted if the final config is identical