-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/klipper: preserve SAVE_CONFIG for nixos-managed config #370704
Conversation
d4e45fb
to
88ebe25
Compare
I do support the «deprecate immutable config» part. However, I do want to retain the ability to change the rest of the config without changing nixos configuration. |
Oh yep, you should still be able to do that. If you want to quickly test a change without committing to it in your NixOS config, you can just add something to the Also, if you wanted to permanently persist something outside of your Nix config, you can add an include section in |
But I do want to have a default config! Maybe this should just replace immutable config instead, as it basically retains the same semantics, yet fixing the SAVE_CONFIG problem? |
I'm not really sure what you mean by that, I think there might be a misunderstanding? With this PR, what I mentioned would still allow for a default config.
I think this PR already does this? (but I feel unclear on what you meant earlier, so I might be missing something) You got me thinking though, maybe it would be simpler to patch klipper to automatically include |
What I mean is that I want default config while retaining the option to edit it in arbitrary locations. E.g if I am building an image for a generic printer platform, and I want to provide a default for it, but not to restrict end user in any way. |
Ohhh ok thanks! That makes a lot more sense! Basically what I wanted was to be able to manage all the settings from NixOS, with the exception of It's sounds like you designed How would you feel about a new |
I really do feel that your changes should be enabled by default, as they are strictly better than the previous default — so maybe just use them if |
Oh yeah that would be ideal, but the reason I thought of the new option was because the change would be breaking. So we'd need some kind of transitory option between old state versions and new ones. |
Hmm, I don't really see how it would be breaking |
Oh wait sorry, your right. I'm not sure why I thought it would be earlier 😅 |
88ebe25
to
7116365
Compare
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
7116365
to
434cbc6
Compare
Ok, it should be good now! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Got stuck for a second thinking of removed chmod
, but I guess that should work with piping instead of cp <3
@kira-bruneau Thank you so much for your PR <3 |
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:
services.klipper.configDir
instead of/etc
SAVE_CONFIG
section from the backup is copied over into the new configThings done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.