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