2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2019-08-05 19:02:06 +01:00
|
|
|
, runCommand
|
|
|
|
, mutter
|
|
|
|
, elementary-default-settings
|
|
|
|
, glib
|
|
|
|
, gala
|
|
|
|
, epiphany
|
2021-07-26 04:01:45 +01:00
|
|
|
, gnome-settings-daemon
|
2019-08-05 19:02:06 +01:00
|
|
|
, gtk3
|
2020-09-04 02:46:19 +01:00
|
|
|
, elementary-dock
|
2019-08-05 19:02:06 +01:00
|
|
|
, gsettings-desktop-schemas
|
2018-08-20 21:31:18 +01:00
|
|
|
, extraGSettingsOverrides ? ""
|
|
|
|
, extraGSettingsOverridePackages ? []
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
gsettingsOverridePackages = [
|
2020-09-04 02:46:19 +01:00
|
|
|
elementary-dock
|
2021-07-26 04:01:45 +01:00
|
|
|
gnome-settings-daemon
|
2019-03-24 10:16:31 +00:00
|
|
|
epiphany
|
|
|
|
gala
|
|
|
|
gsettings-desktop-schemas
|
2018-08-20 21:31:18 +01:00
|
|
|
gtk3
|
2020-09-04 02:46:19 +01:00
|
|
|
mutter
|
2018-08-20 21:31:18 +01:00
|
|
|
] ++ extraGSettingsOverridePackages;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
2021-01-15 13:21:58 +00:00
|
|
|
with lib;
|
2018-08-20 21:31:18 +01:00
|
|
|
|
|
|
|
# TODO: Having https://github.com/NixOS/nixpkgs/issues/54150 would supersede this
|
|
|
|
runCommand "elementary-gsettings-desktop-schemas" {}
|
|
|
|
''
|
2019-08-26 08:44:25 +01:00
|
|
|
schema_dir=$out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas
|
2018-08-20 21:31:18 +01:00
|
|
|
|
2019-08-26 08:44:25 +01:00
|
|
|
mkdir -p $schema_dir
|
2019-11-11 02:12:18 +00:00
|
|
|
|
|
|
|
cp -rf ${glib.getSchemaPath gala}/*.gschema.override $schema_dir
|
2019-08-26 08:44:25 +01:00
|
|
|
|
|
|
|
${concatMapStrings (pkg: "cp -rf ${glib.getSchemaPath pkg}/*.xml $schema_dir\n") gsettingsOverridePackages}
|
2018-08-20 21:31:18 +01:00
|
|
|
|
|
|
|
chmod -R a+w $out/share/gsettings-schemas/nixos-gsettings-overrides
|
2019-10-05 06:17:01 +01:00
|
|
|
cp ${glib.getSchemaPath elementary-default-settings}/* $schema_dir
|
2018-08-20 21:31:18 +01:00
|
|
|
|
2019-08-26 08:44:25 +01:00
|
|
|
cat - > $schema_dir/nixos-defaults.gschema.override <<- EOF
|
2018-08-20 21:31:18 +01:00
|
|
|
${extraGSettingsOverrides}
|
|
|
|
EOF
|
|
|
|
|
2019-08-26 08:44:25 +01:00
|
|
|
${glib.dev}/bin/glib-compile-schemas $schema_dir
|
2018-08-20 21:31:18 +01:00
|
|
|
''
|