From 53cbe5c8dabe5e41b012708e71a8c3b80d77d998 Mon Sep 17 00:00:00 2001 From: Colin Date: Tue, 20 Feb 2024 12:09:52 +0000 Subject: [PATCH] dconf: split into own `sane.programs` definition --- hosts/common/default.nix | 15 --------------- hosts/common/programs/dconf.nix | 26 ++++++++++++++++++++++++++ hosts/common/programs/default.nix | 1 + hosts/modules/gui/default.nix | 1 + 4 files changed, 28 insertions(+), 15 deletions(-) create mode 100644 hosts/common/programs/dconf.nix diff --git a/hosts/common/default.nix b/hosts/common/default.nix index 96d7c921b..a779cf679 100644 --- a/hosts/common/default.nix +++ b/hosts/common/default.nix @@ -120,21 +120,6 @@ ''; }; - # dconf docs: - # this lets programs temporarily write user-level dconf settings (aka gsettings). - # they're written to ~/.config/dconf/user, unless `DCONF_PROFILE` is set to something other than the default of /etc/dconf/profile/user - # find keys/values with `dconf dump /` - programs.dconf.enable = true; - programs.dconf.packages = [ - (pkgs.writeTextFile { - name = "dconf-user-profile"; - destination = "/etc/dconf/profile/user"; - text = '' - user-db:user - system-db:site - ''; - }) - ]; # sane.programs.glib.enableFor.user.colin = true; # for `gsettings` # link debug symbols into /run/current-system/sw/lib/debug diff --git a/hosts/common/programs/dconf.nix b/hosts/common/programs/dconf.nix new file mode 100644 index 000000000..c47ba7927 --- /dev/null +++ b/hosts/common/programs/dconf.nix @@ -0,0 +1,26 @@ +# dconf docs: +# this lets programs temporarily write user-level dconf settings (aka gsettings). +# they're written to ~/.config/dconf/user, unless `DCONF_PROFILE` is set to something other than the default of /etc/dconf/profile/user +# find keys/values with `dconf dump /` +{ config, lib, pkgs, ... }: + +let + cfg = config.sane.programs.dconf; +in +{ + programs.dconf = lib.mkIf cfg.enabled { + # TODO: sandbox. + # note that `programs.dconf` doesn't allow specifying the dconf package. + enable = true; + packages = [ + (pkgs.writeTextFile { + name = "dconf-user-profile"; + destination = "/etc/dconf/profile/user"; + text = '' + user-db:user + system-db:site + ''; + }) + ]; + }; +} diff --git a/hosts/common/programs/default.nix b/hosts/common/programs/default.nix index 8530d0d69..06471cc80 100644 --- a/hosts/common/programs/default.nix +++ b/hosts/common/programs/default.nix @@ -17,6 +17,7 @@ ./chatty.nix ./conky ./cozy.nix + ./dconf.nix ./dialect.nix ./dino.nix ./element-desktop.nix diff --git a/hosts/modules/gui/default.nix b/hosts/modules/gui/default.nix index c2c6c4c1a..6d33e601c 100644 --- a/hosts/modules/gui/default.nix +++ b/hosts/modules/gui/default.nix @@ -57,6 +57,7 @@ in sane.programs.guiBaseApps = declPackageSet [ # "abaddon" # discord client "alacritty" # terminal emulator + "dconf" # required by many packages, but not well-documented :( "delfin" # Jellyfin client "dialect" # language translation "dino" # XMPP client