home/dconf: convert to proper module

This commit is contained in:
Max Headroom 2023-05-01 20:28:03 +02:00
parent 92099aeb60
commit 3ac815c58d
5 changed files with 248 additions and 231 deletions

View file

@ -14,7 +14,9 @@ let
isNixos = args ? isNixos; isNixos = args ? isNixos;
optionalDesktopModule = lib.optional (systemProfile == "desktop") { optionalDesktopModule = lib.optional (systemProfile == "desktop") {
imports = [
./home/dconf
];
# other files # other files
home.file.templates-directory = import ./home/templates.nix meta; home.file.templates-directory = import ./home/templates.nix meta;
home.file.steam-skins = { home.file.steam-skins = {
@ -46,7 +48,6 @@ let
gtk.enable = true; gtk.enable = true;
gtk.theme.name = "Adwaita-dark"; gtk.theme.name = "Adwaita-dark";
dconf.settings = import ./home/dconf { inherit meta config; };
}; };
in in

View file

@ -0,0 +1,70 @@
{ lib, ... }:
let
appFolders = {
Utilities = {
name = "X-GNOME-Utilities.directory";
translate = true;
categories = [ "X-GNOME-Utilities" ];
apps = [
"gnome-system-monitor.desktop"
"nm-connection-editor.desktop"
"org.gnome.baobab.desktop"
"org.gnome.Calculator.desktop"
"org.gnome.DejaDup.desktop"
"org.gnome.Dictionary.desktop"
"org.gnome.DiskUtility.desktop"
"org.gnome.eog.desktop"
"org.gnome.Evince.desktop"
"org.gnome.FileRoller.desktop"
"org.gnome.fonts.desktop"
"org.gnome.Screenshot.desktop"
"org.gnome.seahorse.Application.desktop"
"org.gnome.tweaks.desktop"
"org.gnome.Usage.desktop"
"simple-scan.desktop"
];
};
"Pro Audio" = {
apps = [
"com.github.wwmm.easyeffects.desktop"
"org.rncbc.qjackctl.desktop"
"calf.desktop"
"carla.desktop"
"helm.desktop"
"jack-rack.desktop"
];
};
Office = {
apps = [
"writer.desktop"
"calc.desktop"
"impress.desktop"
"draw.desktop"
"math.desktop"
"base.desktop"
];
};
Graphics = {
apps = [
"com.github.maoschanz.drawing.desktop"
"org.kde.krita.desktop"
"org.inkscape.Inkscape.desktop"
"gimp.desktop"
];
};
};
sanitizeName = name: "folder-${lib.strings.sanitizeDerivationName name}";
mkAppFolderDconfEntry = name: folder: lib.nameValuePair "org/gnome/desktop/app-folders/folders/${sanitizeName name}" ({
inherit name;
categories = [];
} // folder);
in
{
dconf.settings = lib.mkMerge [
{ "org/gnome/desktop/app-folders".folder-children = map sanitizeName (lib.attrNames appFolders); }
(lib.mapAttrs' mkAppFolderDconfEntry appFolders)
];
}

View file

@ -1,3 +1,7 @@
info: {
import ./gnome.nix info // imports = [
import ./tilix.nix info ./app-folders.nix
./gnome.nix
./tilix.nix
];
}

View file

@ -1,4 +1,5 @@
{ meta, config }: { {
dconf.settings = {
"org/gnome/desktop/interface" = { "org/gnome/desktop/interface" = {
font-name = "Arimo 11"; font-name = "Arimo 11";
gtk-im-module = "gtk-im-context-simple"; gtk-im-module = "gtk-im-context-simple";
@ -34,15 +35,20 @@
play = []; play = [];
window-screenshot-clip = ["<Super>Print"]; window-screenshot-clip = ["<Super>Print"];
custom-keybindings = map (x: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${x}/") custom-keybindings = map (x: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${x}/")
["tilix" "sysmon"]; ["tilix" "sysmon-de" "sysmon-en"];
}; };
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/tilix" = { "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/tilix" = {
binding = "<Super>Return"; binding = "<Super>Return";
command = "gapplication launch com.gexperts.Tilix"; command = "gapplication launch com.gexperts.Tilix";
name = "Launch Tilix"; name = "Launch Tilix";
}; };
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/sysmon" = { "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/sysmon-de" = {
binding = "<Super>" + (if config.services.xserver.layout == "de" then "y" else "z"); binding = "<Super>y";
command = "gtk-launch gnome-system-monitor";
name = "Launch System Monitor";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/sysmon-en" = {
binding = "<Super>z";
command = "gtk-launch gnome-system-monitor"; command = "gtk-launch gnome-system-monitor";
name = "Launch System Monitor"; name = "Launch System Monitor";
}; };
@ -63,70 +69,5 @@
# always reset app picker to default ordering # always reset app picker to default ordering
"org/gnome/shell".app-picker-layout = []; "org/gnome/shell".app-picker-layout = [];
"org/gnome/desktop/app-folders" = {
folder-children = [
"Utilities"
"ProAudio"
"Office"
"Graphics"
];
};
"org/gnome/desktop/app-folders/folders/Utilities" = {
name = "X-GNOME-Utilities.directory";
translate = true;
categories = [ "X-GNOME-Utilities" ];
apps = [
"gnome-system-monitor.desktop"
"nm-connection-editor.desktop"
"org.gnome.baobab.desktop"
"org.gnome.Calculator.desktop"
"org.gnome.DejaDup.desktop"
"org.gnome.Dictionary.desktop"
"org.gnome.DiskUtility.desktop"
"org.gnome.eog.desktop"
"org.gnome.Evince.desktop"
"org.gnome.FileRoller.desktop"
"org.gnome.fonts.desktop"
"org.gnome.Screenshot.desktop"
"org.gnome.seahorse.Application.desktop"
"org.gnome.tweaks.desktop"
"org.gnome.Usage.desktop"
"simple-scan.desktop"
];
};
"org/gnome/desktop/app-folders/folders/ProAudio" = {
name = "Pro Audio";
categories = [];
apps = [
"com.github.wwmm.easyeffects.desktop"
"org.rncbc.qjackctl.desktop"
"calf.desktop"
"carla.desktop"
"helm.desktop"
"jack-rack.desktop"
];
};
"org/gnome/desktop/app-folders/folders/Office" = {
name = "Office";
categories = [];
apps = [
"writer.desktop"
"calc.desktop"
"impress.desktop"
"draw.desktop"
"math.desktop"
"base.desktop"
];
};
"org/gnome/desktop/app-folders/folders/Graphics" = {
name = "Graphics";
categories = [];
apps = [
"com.github.maoschanz.drawing.desktop"
"org.kde.krita.desktop"
"org.inkscape.Inkscape.desktop"
"gimp.desktop"
];
}; };
} }

View file

@ -1,4 +1,5 @@
{ meta, config }: { {
dconf.settings = {
"com/gexperts/Tilix" = { "com/gexperts/Tilix" = {
auto-hide-mouse = true; auto-hide-mouse = true;
copy-on-select = true; copy-on-select = true;
@ -88,7 +89,6 @@
shortcut = "disabled"; shortcut = "disabled";
show-scrollbar = true; show-scrollbar = true;
terminal-bell = "icon-sound"; terminal-bell = "icon-sound";
#terminal-title = "${id}: ${title}";
text-blink-mode = "always"; text-blink-mode = "always";
triggers = []; triggers = [];
use-custom-command = false; use-custom-command = false;
@ -96,4 +96,5 @@
use-theme-colors = false; use-theme-colors = false;
visible-name = "Managed Default"; visible-name = "Managed Default";
}; };
};
} }