about summary refs log tree commit diff
path: root/pkgs/desktops/budgie/budgie-gsettings-overrides/default.nix
blob: d853a584a7a4043dd332fba1a69b28d7a3062af0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{ lib
, runCommand
, budgie-desktop
, budgie-desktop-view
, glib
, gsettings-desktop-schemas
, gnome
, nixos-artwork
, nixos-background-light ? nixos-artwork.wallpapers.nineish
, nixos-background-dark ? nixos-artwork.wallpapers.nineish-dark-gray
, extraGSettingsOverrides ? ""
, extraGSettingsOverridePackages ? []
}:

let
  inherit (lib) concatMapStringsSep;

  gsettingsOverrides = ''
    [org.gnome.desktop.background:Budgie]
    picture-uri="file://${nixos-background-light.gnomeFilePath}"
    picture-uri-dark="file://${nixos-background-dark.gnomeFilePath}"

    [org.gnome.desktop.screensaver:Budgie]
    picture-uri="file://${nixos-background-dark.gnomeFilePath}"

    [org.gnome.desktop.interface:Budgie]
    gtk-theme="Qogir"
    icon-theme="Qogir"
    cursor-theme="Qogir"
    font-name="Noto Sans 10"
    document-font-name="Noto Sans 10"
    monospace-font-name="Hack 10"

    [org.gnome.desktop.peripherals.touchpad:Budgie]
    tap-to-click=true

    [org.gnome.desktop.wm.preferences:Budgie]
    titlebar-font="Noto Sans Bold 10"

    [org.gnome.mutter:Budgie]
    edge-tiling=true

    [com.solus-project.budgie-menu:Budgie]
    use-default-menu-icon=true

    [com.solus-project.budgie-panel:Budgie]
    dark-theme=false
    builtin-theme=false

    [com.solus-project.icon-tasklist:Budgie]
    pinned-launchers=["nemo.desktop", "firefox.desktop", "vlc.desktop"]

    [org.buddiesofbudgie.budgie-desktop-view:Budgie]
    show=true
    show-active-mounts=true

    ${extraGSettingsOverrides}
  '';

  gsettingsOverridePackages = [
      budgie-desktop
      budgie-desktop-view
      gsettings-desktop-schemas
      gnome.mutter
  ] ++ extraGSettingsOverridePackages;

in
  runCommand "budgie-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/zz-nixos-defaults.gschema.override" <<- EOF
    ${gsettingsOverrides}
    EOF

    ${glib.dev}/bin/glib-compile-schemas --strict "$schema_dir"
  ''