3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/desktops/pantheon/desktop/elementary-gsettings-schemas/default.nix

52 lines
1.2 KiB
Nix
Raw Normal View History

{ lib
, runCommand
, mutter
, elementary-default-settings
, glib
, gala
, epiphany
, gnome-settings-daemon
, gtk3
, elementary-dock
, gsettings-desktop-schemas
2018-08-20 21:31:18 +01:00
, extraGSettingsOverrides ? ""
, extraGSettingsOverridePackages ? []
}:
let
gsettingsOverridePackages = [
elementary-dock
gnome-settings-daemon
epiphany
gala
gsettings-desktop-schemas
2018-08-20 21:31:18 +01:00
gtk3
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" {}
''
schema_dir=$out/share/gsettings-schemas/nixos-gsettings-overrides/glib-2.0/schemas
2018-08-20 21:31:18 +01:00
mkdir -p $schema_dir
cp -rf ${glib.getSchemaPath gala}/*.gschema.override $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
cp ${glib.getSchemaPath elementary-default-settings}/* $schema_dir
2018-08-20 21:31:18 +01:00
cat - > $schema_dir/nixos-defaults.gschema.override <<- EOF
2018-08-20 21:31:18 +01:00
${extraGSettingsOverrides}
EOF
${glib.dev}/bin/glib-compile-schemas $schema_dir
2018-08-20 21:31:18 +01:00
''