nixpkgs/pkgs/desktops/cinnamon/cinnamon-gsettings-overrides/default.nix
Bobby Rong 1528a7ca86
cinnamon.cinnamon-gsettings-overrides: Override gnome-terminal settings with Fedora's default
This fixes issues caused by vanilla gnome-terminal and mint-artwork:

- Grey text and black background, this makes text almost unreadable.
- Only one 'New Terminal' button in menu which means you cannot open tab and open window in the same menu.
2022-11-07 20:41:03 +08:00

73 lines
1.5 KiB
Nix

{ lib
, runCommand
, nixos-artwork
, glib
, gnome
, gtk3
, gsettings-desktop-schemas
, extraGSettingsOverrides ? ""
, extraGSettingsOverridePackages ? [ ]
, mint-artwork
, muffin
, nemo
, xapp
, cinnamon-desktop
, cinnamon-session
, cinnamon-settings-daemon
, cinnamon-common
, bulky
}:
let
inherit (lib) concatMapStringsSep;
gsettingsOverridePackages = [
# from
mint-artwork
# on
bulky
muffin
nemo
xapp
cinnamon-desktop
cinnamon-session
cinnamon-settings-daemon
cinnamon-common
gnome.gnome-terminal
gtk3
] ++ extraGSettingsOverridePackages;
gsettingsOverrides = ''
# Use Fedora's default to make text readable and
# restore ununified menu.
# https://github.com/NixOS/nixpkgs/issues/200017
[org.gnome.Terminal.Legacy.Settings]
theme-variant='dark'
unified-menu=false
${extraGSettingsOverrides}
'';
in
# TODO: Having https://github.com/NixOS/nixpkgs/issues/54150 would supersede this
runCommand "cinnamon-gsettings-overrides" { preferLocalBuild = true; }
''
data_dir="$out/share/gsettings-schemas/nixos-gsettings-overrides"
schema_dir="$data_dir/glib-2.0/schemas"
mkdir -p "$schema_dir"
${concatMapStringsSep "\n" (pkg: "cp -rf \"${glib.getSchemaPath pkg}\"/*.xml \"${glib.getSchemaPath pkg}\"/*.gschema.override \"$schema_dir\"") gsettingsOverridePackages}
chmod -R a+w "$data_dir"
cat - > "$schema_dir/nixos-defaults.gschema.override" <<- EOF
${gsettingsOverrides}
EOF
${glib.dev}/bin/glib-compile-schemas --strict "$schema_dir"
''