nixpkgs/pkgs/desktops/pantheon/desktop/elementary-gsettings-schemas/default.nix

53 lines
1.2 KiB
Nix
Raw Normal View History

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