Preserving GNOME Bluetooth and Brightness Settings Across Reboots

Hey there,

I’m running a distro called NixOS that has an interesting feature called “impermanence” - it basically wipes most of the system state on each reboot and rebuilds everything from configuration files. This keeps the system clean and reproducible, but it means I need to explicitly specify which settings and data should persist between reboots.

I’ve got almost everything working, but I’m struggling with two GNOME-specific settings:

  1. Bluetooth on/off state - Whether Bluetooth is enabled or disabled
  2. Screen brightness level - My preferred brightness setting

What I’ve Already Tried

I’m already persisting these directories/files:

  • /nix - Nix package store
  • /etc/nixos/ - System configuration
  • /etc/NetworkManager/ - Needed for WiFi/VPN connections in GNOME
  • /var/lib/nixos - Important system files like uid/gid mappings
  • /var/log
  • /var/tmp
  • /var/lib/AccountsService - Needed to show user profile pictures
  • /var/lib/NetworkManager/ - Additional network state
  • /var/lib/bluetooth - Persist bluetooth connections (saves paired devices but not power state)
  • /var/lib/systemd/timers - Persist system timers
  • /run/NetworkManager - Some additional network state
  • My entire home directory (/home/username)

The Bluetooth power state and screen brightness seem to be GNOME-specific settings that aren’t saved in the standard locations I’m persisting. When I reboot, Bluetooth reverts to its default state (on) and brightness goes back to a default level (max brightness).

For those familiar with GNOME’s internals, where does GNOME store:

  1. The Bluetooth power state (enabled/disabled toggle)?
  2. The screen brightness level?

I’m looking for the specific files or directories where GNOME saves these user preferences so I can add them to my persistence configuration.

Any help from GNOME power users who know where these settings live would be greatly appreciated :slight_smile:

Thanks in advance!

1 Like

Those are not stored by GNOME, but by systemd. The state should be in /var/lib/systemd/rfkill/ and /var/lib/systemd/backlight/.

It worked, thanks a lot! Seems like even though I asked in the wrong forum the right people were here :slight_smile:

This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.