2019-08-05 19:02:06 +01:00
|
|
|
{ stdenv
|
|
|
|
, runCommand
|
|
|
|
, mutter
|
|
|
|
, elementary-default-settings
|
|
|
|
, nixos-artwork
|
|
|
|
, glib
|
|
|
|
, gala
|
|
|
|
, epiphany
|
|
|
|
, elementary-settings-daemon
|
|
|
|
, gtk3
|
|
|
|
, plank
|
|
|
|
, gsettings-desktop-schemas
|
2018-08-20 21:31:18 +01:00
|
|
|
, extraGSettingsOverrides ? ""
|
|
|
|
, extraGSettingsOverridePackages ? []
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
|
|
|
|
gsettingsOverridePackages = [
|
|
|
|
elementary-settings-daemon
|
2019-03-24 10:16:31 +00:00
|
|
|
epiphany
|
|
|
|
gala
|
2019-04-17 01:38:26 +01:00
|
|
|
mutter
|
2019-03-24 10:16:31 +00:00
|
|
|
gsettings-desktop-schemas
|
2018-08-20 21:31:18 +01:00
|
|
|
gtk3
|
|
|
|
plank
|
|
|
|
] ++ extraGSettingsOverridePackages;
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
# 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
|
|
|
|
cp -rf ${glib.getSchemaPath gsettings-desktop-schemas}/*.xml $schema_dir
|
|
|
|
|
|
|
|
${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
|
|
|
''
|