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,132 +1,73 @@
{ meta, config }: { {
"org/gnome/desktop/interface" = { dconf.settings = {
font-name = "Arimo 11"; "org/gnome/desktop/interface" = {
gtk-im-module = "gtk-im-context-simple"; font-name = "Arimo 11";
locate-pointer = false; gtk-im-module = "gtk-im-context-simple";
monospace-font-name = "Terminus Bold 10"; locate-pointer = false;
toolkit-accessibility = false; monospace-font-name = "Terminus Bold 10";
}; toolkit-accessibility = false;
"org/gnome/desktop/wm/keybindings" = { };
close = ["<Super>q"]; "org/gnome/desktop/wm/keybindings" = {
cycle-windows = []; close = ["<Super>q"];
cycle-windows-backward = []; cycle-windows = [];
minimize = []; cycle-windows-backward = [];
panel-main-menu = []; minimize = [];
panel-run-dialog = ["<Shift><Alt>space"]; panel-main-menu = [];
raise-or-lower = ["<Super>h"]; panel-run-dialog = ["<Shift><Alt>space"];
switch-group = ["<Alt>Escape"]; raise-or-lower = ["<Super>h"];
switch-group-backward = ["<Shift><Alt>Escape"]; switch-group = ["<Alt>Escape"];
switch-panels = []; switch-group-backward = ["<Shift><Alt>Escape"];
switch-panels-backward = []; switch-panels = [];
switch-windows = ["<Primary><Alt>Tab"]; switch-panels-backward = [];
switch-windows-backward = ["<Primary><Shift><Alt>Tab"]; switch-windows = ["<Primary><Alt>Tab"];
toggle-fullscreen = ["<Alt><Super>f"]; switch-windows-backward = ["<Primary><Shift><Alt>Tab"];
}; toggle-fullscreen = ["<Alt><Super>f"];
"org/gnome/settings-daemon/plugins/media-keys" = { };
control-center = ["<Alt><Super>Return"]; "org/gnome/settings-daemon/plugins/media-keys" = {
eject = ["<Shift><Alt>Return"]; control-center = ["<Alt><Super>Return"];
email = ["<Super>m"]; eject = ["<Shift><Alt>Return"];
home = ["<Super>f"]; email = ["<Super>m"];
www = ["<Super>w"]; home = ["<Super>f"];
media = ["<Super>AudioPlay"]; www = ["<Super>w"];
mic-mute = ["<Super>AudioMute"]; media = ["<Super>AudioPlay"];
on-screen-keyboard = ["<Alt><Super>k"]; mic-mute = ["<Super>AudioMute"];
play = []; on-screen-keyboard = ["<Alt><Super>k"];
window-screenshot-clip = ["<Super>Print"]; play = [];
custom-keybindings = map (x: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${x}/") window-screenshot-clip = ["<Super>Print"];
["tilix" "sysmon"]; custom-keybindings = map (x: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${x}/")
}; ["tilix" "sysmon-de" "sysmon-en"];
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/tilix" = { };
binding = "<Super>Return"; "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/tilix" = {
command = "gapplication launch com.gexperts.Tilix"; binding = "<Super>Return";
name = "Launch Tilix"; command = "gapplication launch com.gexperts.Tilix";
}; name = "Launch Tilix";
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/sysmon" = { };
binding = "<Super>" + (if config.services.xserver.layout == "de" then "y" else "z"); "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/sysmon-de" = {
command = "gtk-launch gnome-system-monitor"; binding = "<Super>y";
name = "Launch System Monitor"; command = "gtk-launch gnome-system-monitor";
}; name = "Launch System Monitor";
"org/gnome/nautilus/preferences" = { };
click-policy = "single"; "org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/sysmon-en" = {
default-folder-view = "icon-view"; binding = "<Super>z";
executable-text-activation = "ask"; command = "gtk-launch gnome-system-monitor";
show-create-link = true; name = "Launch System Monitor";
}; };
"org/gnome/desktop/input-sources" = { "org/gnome/nautilus/preferences" = {
xkb-options = [ click-policy = "single";
"terminate:ctrl_alt_bksp" default-folder-view = "icon-view";
"lv3:ralt_switch" executable-text-activation = "ask";
"shift:both_capslock_cancel" show-create-link = true;
"caps:ctrl_modifier" };
]; "org/gnome/desktop/input-sources" = {
}; xkb-options = [
"terminate:ctrl_alt_bksp"
"lv3:ralt_switch"
"shift:both_capslock_cancel"
"caps:ctrl_modifier"
];
};
# 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,99 +1,100 @@
{ meta, config }: { {
"com/gexperts/Tilix" = { dconf.settings = {
auto-hide-mouse = true; "com/gexperts/Tilix" = {
copy-on-select = true; auto-hide-mouse = true;
focus-follow-mouse = true; copy-on-select = true;
notify-on-process-complete = true; focus-follow-mouse = true;
terminal-tile-style = "small"; notify-on-process-complete = true;
terminal-title-show-when-single = false; terminal-tile-style = "small";
warn-vte-config-issue = false; terminal-title-show-when-single = false;
custom-hyperlinks = [ warn-vte-config-issue = false;
''"/ip[fn]s/[\\./A-Za-z0-9-_,:]*",xdg-open $0,false'' custom-hyperlinks = [
''"/nix/store/[\\.A-Za-z0-9-_]*",xdg-open $0,false'' ''"/ip[fn]s/[\\./A-Za-z0-9-_,:]*",xdg-open $0,false''
''github:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*)/([\\.A-Za-z0-9-_]*),xdg-open https://github.com/$1/tree/$2,false'' ''"/nix/store/[\\.A-Za-z0-9-_]*",xdg-open $0,false''
''github:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*),xdg-open https://github.com/$1,false'' ''github:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*)/([\\.A-Za-z0-9-_]*),xdg-open https://github.com/$1/tree/$2,false''
''gitlab:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*)/([\\.A-Za-z0-9-_]*)\?host=([\\.A-Za-z0-9-_]*),xdg-open https://$3/$1/-/tree/$2,false'' ''github:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*),xdg-open https://github.com/$1,false''
''gitlab:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*)/([\\.A-Za-z0-9-_]*),xdg-open https://gitlab.com/$1/-/tree/$2,false'' ''gitlab:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*)/([\\.A-Za-z0-9-_]*)\?host=([\\.A-Za-z0-9-_]*),xdg-open https://$3/$1/-/tree/$2,false''
''gitlab:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*)\?host=([\\.A-Za-z0-9-_]*),xdg-open https://$2/$1,false'' ''gitlab:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*)/([\\.A-Za-z0-9-_]*),xdg-open https://gitlab.com/$1/-/tree/$2,false''
''gitlab:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*),xdg-open https://gitlab.com/$1,false'' ''gitlab:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*)\?host=([\\.A-Za-z0-9-_]*),xdg-open https://$2/$1,false''
''git(lab)?@([\\.A-Za-z0-9-_]*):([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*),xdg-open https://$1/$2,false'' ''gitlab:([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*),xdg-open https://gitlab.com/$1,false''
]; ''git(lab)?@([\\.A-Za-z0-9-_]*):([\\.A-Za-z0-9-_]*/[\\.A-Za-z0-9-_]*),xdg-open https://$1/$2,false''
}; ];
"com/gexperts/Tilix/keybindings" = { };
app-new-session = "<Shift><Alt>s"; "com/gexperts/Tilix/keybindings" = {
terminal-add-bookmark = "<Shift><Alt>e"; app-new-session = "<Shift><Alt>s";
terminal-advanced-paste = "<Shift><Alt>v"; terminal-add-bookmark = "<Shift><Alt>e";
terminal-copy = "<Alt>c"; terminal-advanced-paste = "<Shift><Alt>v";
terminal-file-browser = "<Primary><Alt>b"; terminal-copy = "<Alt>c";
terminal-insert-number = "disabled"; terminal-file-browser = "<Primary><Alt>b";
terminal-insert-password = "<Alt>p"; terminal-insert-number = "disabled";
terminal-layout = "<Alt>l"; terminal-insert-password = "<Alt>p";
terminal-paste = "<Alt>v"; terminal-layout = "<Alt>l";
terminal-reset = "disabled"; terminal-paste = "<Alt>v";
terminal-reset-and-clear = "disabled"; terminal-reset = "disabled";
terminal-select-bookmark = "<Alt>e"; terminal-reset-and-clear = "disabled";
win-view-sidebar = "<Alt>s"; terminal-select-bookmark = "<Alt>e";
}; win-view-sidebar = "<Alt>s";
"com/gexperts/Tilix/profiles" = { };
default="a024a568-c23d-4dcf-98cd-1124167ea455"; "com/gexperts/Tilix/profiles" = {
list=["a024a568-c23d-4dcf-98cd-1124167ea455"]; default="a024a568-c23d-4dcf-98cd-1124167ea455";
}; list=["a024a568-c23d-4dcf-98cd-1124167ea455"];
"com/gexperts/Tilix/profiles/a024a568-c23d-4dcf-98cd-1124167ea455" = { };
allow-bold = true; "com/gexperts/Tilix/profiles/a024a568-c23d-4dcf-98cd-1124167ea455" = {
automatic-switch = []; allow-bold = true;
background-color = "#1A1A1A1A1A1A"; automatic-switch = [];
background-transparency-percent = 0; background-color = "#1A1A1A1A1A1A";
backspace-binding = "ascii-delete"; background-transparency-percent = 0;
badge-color = "#ffffff"; backspace-binding = "ascii-delete";
badge-color-set = false; badge-color = "#ffffff";
badge-font = "Monospace 14"; badge-color-set = false;
badge-position = "southeast"; badge-font = "Monospace 14";
badge-text = ""; badge-position = "southeast";
badge-use-system-font = false; badge-text = "";
bold-color = "#ffffff"; badge-use-system-font = false;
bold-color-set = false; bold-color = "#ffffff";
bold-is-bright = true; bold-color-set = false;
cell-height-scale = 1.0; bold-is-bright = true;
cell-width-scale = 1.0; cell-height-scale = 1.0;
cjk-utf8-ambiguous-width = "narrow"; cell-width-scale = 1.0;
cursor-background-color = "#000000"; cjk-utf8-ambiguous-width = "narrow";
cursor-blink-mode = "system"; cursor-background-color = "#000000";
cursor-colors-set = false; cursor-blink-mode = "system";
cursor-foreground-color = "#ffffff"; cursor-colors-set = false;
cursor-shape = "block"; cursor-foreground-color = "#ffffff";
custom-command = ""; cursor-shape = "block";
custom-hyperlinks = []; custom-command = "";
default-size-columns = 100; custom-hyperlinks = [];
default-size-rows = 34; default-size-columns = 100;
delete-binding = "delete-sequence"; default-size-rows = 34;
dim-transparency-percent = 0; delete-binding = "delete-sequence";
draw-margin = 80; dim-transparency-percent = 0;
encoding = "UTF-8"; draw-margin = 80;
exit-action = "close"; encoding = "UTF-8";
font = "Monospace 12"; exit-action = "close";
foreground-color = "#F8F8F2"; font = "Monospace 12";
highlight-background-color = "#000000"; foreground-color = "#F8F8F2";
highlight-colors-set = false; highlight-background-color = "#000000";
highlight-foreground-color = "#ffffff"; highlight-colors-set = false;
login-shell = false; highlight-foreground-color = "#ffffff";
notify-silence-enabled = true; login-shell = false;
notify-silence-threshold = 180; notify-silence-enabled = true;
palette = ["#272822" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F8F8F2" "#75715E" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F9F8F5"]; notify-silence-threshold = 180;
rewrap-on-resize = true; palette = ["#272822" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F8F8F2" "#75715E" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F9F8F5"];
scroll-on-keystroke = true; rewrap-on-resize = true;
scroll-on-output = false; scroll-on-keystroke = true;
scrollback-lines = 8192; scroll-on-output = false;
scrollback-unlimited = false; scrollback-lines = 8192;
select-by-word-chars = "-,./?%&#:_+"; scrollback-unlimited = false;
shortcut = "disabled"; select-by-word-chars = "-,./?%&#:_+";
show-scrollbar = true; shortcut = "disabled";
terminal-bell = "icon-sound"; show-scrollbar = true;
#terminal-title = "${id}: ${title}"; terminal-bell = "icon-sound";
text-blink-mode = "always"; text-blink-mode = "always";
triggers = []; triggers = [];
use-custom-command = false; use-custom-command = false;
use-system-font = true; use-system-font = true;
use-theme-colors = false; use-theme-colors = false;
visible-name = "Managed Default"; visible-name = "Managed Default";
};
}; };
} }