NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.46k stars 13.66k forks source link

fwupd cannot update its config #158497

Open orangecms opened 2 years ago

orangecms commented 2 years ago

Describe the bug

fwupd has features that can be activated from its CLI, e.g., automatic upload of reports. Because Nix makes the config drop-in read-only symlinks, the config cannot be persisted.

Steps To Reproduce

sudo fwupdmgr get-updates

Say yes to uploading reports, and yes to doing so automatically in the future.

Expected behavior

An application should be able to update its config.

Additional context

This is a design question to a degree. Nix could run a daemon that watches a defined set of files for changes and tracks them, or define a replacement store etc.. I am not sure how it's done for other services such as NetworkManager.

Notify maintainers

@jtojnar @maxeaubrey

Metadata

N/A

jtojnar commented 2 years ago

Currently, we either have config files managed by NixOS (e.g. fwupd) or by the program (NetworkManager). Some programs support multiple config locations that will allow both mutable and declarative configs to be merged.

Mutable configs are not a priority for me personally so someone who cares would need to try to make them work.

loafofpiecrust commented 2 years ago

This also makes it currently impossible to use the lvfs-testing remote because the lvfs-testing.conf file linked from the nix store has Enabled = false. The CLI can't write to this file and there's no config to change it. Personally, I would just like to have a nixos option that let's me specify which remotes I want to enable.

Either that or the remotes.d folder in etc could be mutable but the rest of fwupd config be read-only? I think other programs just have an explicit state folder that the program will setup if empty. For example, iwd has /etc/iwd which is immutable but also /var/lib/iwd for things like network config that's mutable at runtime.

jtojnar commented 1 year ago

There is now a PR for enabling the remotes: https://github.com/NixOS/nixpkgs/pull/193694

vifino commented 1 week ago

I'm regularly annoyed by the automatic reports thing. Perhaps we should add an option for the automatic uploads and ensure fwupd doesn't bother trying to change it?

orangecms commented 1 week ago

We're 2.5 years after I reported this issue.

My POV: An app best understands its own state and should be able to control it. I see no point in another tool (like Nix) trying to chase after it and taking years to come up with another solution. Hence my original question on how this is handled for e.g. NetworkManager. Overall, this is a design problem with Unixy systems where apps are not self-contained and non-volatile. If this were, say, a desktop app that has its own space for local config, such as XDG config directories, it would be no deal. So, is there some option to say "this file/directory can be mutated by this app"?