programs: prefer the gsettings backend over dconf backend
it's more easily human editable, and programs can write new settings without requiring dbus access
This commit is contained in:
@@ -279,7 +279,7 @@ in
|
|||||||
"alacritty" # terminal emulator
|
"alacritty" # terminal emulator
|
||||||
"calls" # gnome calls (dialer/handler)
|
"calls" # gnome calls (dialer/handler)
|
||||||
"dbus"
|
"dbus"
|
||||||
"dconf" # required by many packages, but not well-documented :(
|
"dconf" # required by many packages, but not well-documented. TODO: REMOVE (use gsettings instead)
|
||||||
# "delfin" # Jellyfin client
|
# "delfin" # Jellyfin client
|
||||||
"dialect" # language translation
|
"dialect" # language translation
|
||||||
"dino" # XMPP client
|
"dino" # XMPP client
|
||||||
@@ -305,6 +305,7 @@ in
|
|||||||
"gnome-screenshot" # libcamera-based screenshotter, for debugging; should be compatible with gc2145 camera on Pinephone
|
"gnome-screenshot" # libcamera-based screenshotter, for debugging; should be compatible with gc2145 camera on Pinephone
|
||||||
"gnome-weather"
|
"gnome-weather"
|
||||||
"gpodder"
|
"gpodder"
|
||||||
|
"gsettings"
|
||||||
"gst-device-monitor" # for debugging audio/video
|
"gst-device-monitor" # for debugging audio/video
|
||||||
"gst-launch" # for debugging audio/video
|
"gst-launch" # for debugging audio/video
|
||||||
# "gthumb"
|
# "gthumb"
|
||||||
|
@@ -82,6 +82,7 @@
|
|||||||
./gpsd.nix
|
./gpsd.nix
|
||||||
./gps-share.nix
|
./gps-share.nix
|
||||||
./grimshot.nix
|
./grimshot.nix
|
||||||
|
./gsettings.nix
|
||||||
./gst-device-monitor.nix
|
./gst-device-monitor.nix
|
||||||
./gst-launch.nix
|
./gst-launch.nix
|
||||||
./gthumb.nix
|
./gthumb.nix
|
||||||
|
28
hosts/common/programs/gsettings.nix
Normal file
28
hosts/common/programs/gsettings.nix
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
{ config, lib, pkgs, ... }:
|
||||||
|
let
|
||||||
|
# [ ProgramConfig ]
|
||||||
|
enabledPrograms = builtins.filter
|
||||||
|
(p: p.enabled && p.gsettings != {})
|
||||||
|
(builtins.attrValues config.sane.programs);
|
||||||
|
|
||||||
|
keyfileTexts = lib.map (p: lib.generators.toDconfINI p.gsettings) enabledPrograms;
|
||||||
|
|
||||||
|
cfg = config.sane.programs.gsettings;
|
||||||
|
in
|
||||||
|
{
|
||||||
|
sane.programs.gsettings = {
|
||||||
|
packageUnwrapped = pkgs.linkBinIntoOwnPackage pkgs.glib "gsettings";
|
||||||
|
env.GSETTINGS_BACKEND = "keyfile";
|
||||||
|
};
|
||||||
|
|
||||||
|
environment.etc."glib-2.0/settings/defaults" = lib.mkIf cfg.enabled {
|
||||||
|
# GKeyfileSettingsBackend slurps from just two files:
|
||||||
|
# - /etc/glib-2.0/settings/default (immutable)
|
||||||
|
# - ~/.config/glib-2.0/settings/keyfile (mutable, and overrides the above)
|
||||||
|
# it doesn't mind me just concatenating everything together though; it handles duplicate groups gracefully.
|
||||||
|
#
|
||||||
|
# for tighter control, /etc/glib-2.0/settings/locks can be used to restrict which values a glib program may write to ~/.config/glib-2.0/settings/keyfile,
|
||||||
|
# but this isn't so much needed for as long as i'm not persisting that keyfile
|
||||||
|
text = lib.mkMerge keyfileTexts;
|
||||||
|
};
|
||||||
|
}
|
Reference in New Issue
Block a user