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;
optionalDesktopModule = lib.optional (systemProfile == "desktop") {
imports = [
./home/dconf
];
# other files
home.file.templates-directory = import ./home/templates.nix meta;
home.file.steam-skins = {
@ -46,7 +48,6 @@ let
gtk.enable = true;
gtk.theme.name = "Adwaita-dark";
dconf.settings = import ./home/dconf { inherit meta config; };
};
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 //
import ./tilix.nix info
{
imports = [
./app-folders.nix
./gnome.nix
./tilix.nix
];
}

View file

@ -1,132 +1,73 @@
{ meta, config }: {
"org/gnome/desktop/interface" = {
font-name = "Arimo 11";
gtk-im-module = "gtk-im-context-simple";
locate-pointer = false;
monospace-font-name = "Terminus Bold 10";
toolkit-accessibility = false;
};
"org/gnome/desktop/wm/keybindings" = {
close = ["<Super>q"];
cycle-windows = [];
cycle-windows-backward = [];
minimize = [];
panel-main-menu = [];
panel-run-dialog = ["<Shift><Alt>space"];
raise-or-lower = ["<Super>h"];
switch-group = ["<Alt>Escape"];
switch-group-backward = ["<Shift><Alt>Escape"];
switch-panels = [];
switch-panels-backward = [];
switch-windows = ["<Primary><Alt>Tab"];
switch-windows-backward = ["<Primary><Shift><Alt>Tab"];
toggle-fullscreen = ["<Alt><Super>f"];
};
"org/gnome/settings-daemon/plugins/media-keys" = {
control-center = ["<Alt><Super>Return"];
eject = ["<Shift><Alt>Return"];
email = ["<Super>m"];
home = ["<Super>f"];
www = ["<Super>w"];
media = ["<Super>AudioPlay"];
mic-mute = ["<Super>AudioMute"];
on-screen-keyboard = ["<Alt><Super>k"];
play = [];
window-screenshot-clip = ["<Super>Print"];
custom-keybindings = map (x: "/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/${x}/")
["tilix" "sysmon"];
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/tilix" = {
binding = "<Super>Return";
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");
command = "gtk-launch gnome-system-monitor";
name = "Launch System Monitor";
};
"org/gnome/nautilus/preferences" = {
click-policy = "single";
default-folder-view = "icon-view";
executable-text-activation = "ask";
show-create-link = true;
};
"org/gnome/desktop/input-sources" = {
xkb-options = [
"terminate:ctrl_alt_bksp"
"lv3:ralt_switch"
"shift:both_capslock_cancel"
"caps:ctrl_modifier"
];
};
{
dconf.settings = {
"org/gnome/desktop/interface" = {
font-name = "Arimo 11";
gtk-im-module = "gtk-im-context-simple";
locate-pointer = false;
monospace-font-name = "Terminus Bold 10";
toolkit-accessibility = false;
};
"org/gnome/desktop/wm/keybindings" = {
close = ["<Super>q"];
cycle-windows = [];
cycle-windows-backward = [];
minimize = [];
panel-main-menu = [];
panel-run-dialog = ["<Shift><Alt>space"];
raise-or-lower = ["<Super>h"];
switch-group = ["<Alt>Escape"];
switch-group-backward = ["<Shift><Alt>Escape"];
switch-panels = [];
switch-panels-backward = [];
switch-windows = ["<Primary><Alt>Tab"];
switch-windows-backward = ["<Primary><Shift><Alt>Tab"];
toggle-fullscreen = ["<Alt><Super>f"];
};
"org/gnome/settings-daemon/plugins/media-keys" = {
control-center = ["<Alt><Super>Return"];
eject = ["<Shift><Alt>Return"];
email = ["<Super>m"];
home = ["<Super>f"];
www = ["<Super>w"];
media = ["<Super>AudioPlay"];
mic-mute = ["<Super>AudioMute"];
on-screen-keyboard = ["<Alt><Super>k"];
play = [];
window-screenshot-clip = ["<Super>Print"];
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";
command = "gapplication launch com.gexperts.Tilix";
name = "Launch Tilix";
};
"org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/sysmon-de" = {
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";
name = "Launch System Monitor";
};
"org/gnome/nautilus/preferences" = {
click-policy = "single";
default-folder-view = "icon-view";
executable-text-activation = "ask";
show-create-link = true;
};
"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
"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"
];
# always reset app picker to default ordering
"org/gnome/shell".app-picker-layout = [];
};
}

View file

@ -1,99 +1,100 @@
{ meta, config }: {
"com/gexperts/Tilix" = {
auto-hide-mouse = true;
copy-on-select = true;
focus-follow-mouse = true;
notify-on-process-complete = true;
terminal-tile-style = "small";
terminal-title-show-when-single = false;
warn-vte-config-issue = false;
custom-hyperlinks = [
''"/ip[fn]s/[\\./A-Za-z0-9-_,:]*",xdg-open $0,false''
''"/nix/store/[\\.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''
''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-_]*)\?host=([\\.A-Za-z0-9-_]*),xdg-open https://$3/$1/-/tree/$2,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-_]*)\?host=([\\.A-Za-z0-9-_]*),xdg-open https://$2/$1,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";
terminal-add-bookmark = "<Shift><Alt>e";
terminal-advanced-paste = "<Shift><Alt>v";
terminal-copy = "<Alt>c";
terminal-file-browser = "<Primary><Alt>b";
terminal-insert-number = "disabled";
terminal-insert-password = "<Alt>p";
terminal-layout = "<Alt>l";
terminal-paste = "<Alt>v";
terminal-reset = "disabled";
terminal-reset-and-clear = "disabled";
terminal-select-bookmark = "<Alt>e";
win-view-sidebar = "<Alt>s";
};
"com/gexperts/Tilix/profiles" = {
default="a024a568-c23d-4dcf-98cd-1124167ea455";
list=["a024a568-c23d-4dcf-98cd-1124167ea455"];
};
"com/gexperts/Tilix/profiles/a024a568-c23d-4dcf-98cd-1124167ea455" = {
allow-bold = true;
automatic-switch = [];
background-color = "#1A1A1A1A1A1A";
background-transparency-percent = 0;
backspace-binding = "ascii-delete";
badge-color = "#ffffff";
badge-color-set = false;
badge-font = "Monospace 14";
badge-position = "southeast";
badge-text = "";
badge-use-system-font = false;
bold-color = "#ffffff";
bold-color-set = false;
bold-is-bright = true;
cell-height-scale = 1.0;
cell-width-scale = 1.0;
cjk-utf8-ambiguous-width = "narrow";
cursor-background-color = "#000000";
cursor-blink-mode = "system";
cursor-colors-set = false;
cursor-foreground-color = "#ffffff";
cursor-shape = "block";
custom-command = "";
custom-hyperlinks = [];
default-size-columns = 100;
default-size-rows = 34;
delete-binding = "delete-sequence";
dim-transparency-percent = 0;
draw-margin = 80;
encoding = "UTF-8";
exit-action = "close";
font = "Monospace 12";
foreground-color = "#F8F8F2";
highlight-background-color = "#000000";
highlight-colors-set = false;
highlight-foreground-color = "#ffffff";
login-shell = false;
notify-silence-enabled = true;
notify-silence-threshold = 180;
palette = ["#272822" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F8F8F2" "#75715E" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F9F8F5"];
rewrap-on-resize = true;
scroll-on-keystroke = true;
scroll-on-output = false;
scrollback-lines = 8192;
scrollback-unlimited = false;
select-by-word-chars = "-,./?%&#:_+";
shortcut = "disabled";
show-scrollbar = true;
terminal-bell = "icon-sound";
#terminal-title = "${id}: ${title}";
text-blink-mode = "always";
triggers = [];
use-custom-command = false;
use-system-font = true;
use-theme-colors = false;
visible-name = "Managed Default";
{
dconf.settings = {
"com/gexperts/Tilix" = {
auto-hide-mouse = true;
copy-on-select = true;
focus-follow-mouse = true;
notify-on-process-complete = true;
terminal-tile-style = "small";
terminal-title-show-when-single = false;
warn-vte-config-issue = false;
custom-hyperlinks = [
''"/ip[fn]s/[\\./A-Za-z0-9-_,:]*",xdg-open $0,false''
''"/nix/store/[\\.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''
''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-_]*)\?host=([\\.A-Za-z0-9-_]*),xdg-open https://$3/$1/-/tree/$2,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-_]*)\?host=([\\.A-Za-z0-9-_]*),xdg-open https://$2/$1,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";
terminal-add-bookmark = "<Shift><Alt>e";
terminal-advanced-paste = "<Shift><Alt>v";
terminal-copy = "<Alt>c";
terminal-file-browser = "<Primary><Alt>b";
terminal-insert-number = "disabled";
terminal-insert-password = "<Alt>p";
terminal-layout = "<Alt>l";
terminal-paste = "<Alt>v";
terminal-reset = "disabled";
terminal-reset-and-clear = "disabled";
terminal-select-bookmark = "<Alt>e";
win-view-sidebar = "<Alt>s";
};
"com/gexperts/Tilix/profiles" = {
default="a024a568-c23d-4dcf-98cd-1124167ea455";
list=["a024a568-c23d-4dcf-98cd-1124167ea455"];
};
"com/gexperts/Tilix/profiles/a024a568-c23d-4dcf-98cd-1124167ea455" = {
allow-bold = true;
automatic-switch = [];
background-color = "#1A1A1A1A1A1A";
background-transparency-percent = 0;
backspace-binding = "ascii-delete";
badge-color = "#ffffff";
badge-color-set = false;
badge-font = "Monospace 14";
badge-position = "southeast";
badge-text = "";
badge-use-system-font = false;
bold-color = "#ffffff";
bold-color-set = false;
bold-is-bright = true;
cell-height-scale = 1.0;
cell-width-scale = 1.0;
cjk-utf8-ambiguous-width = "narrow";
cursor-background-color = "#000000";
cursor-blink-mode = "system";
cursor-colors-set = false;
cursor-foreground-color = "#ffffff";
cursor-shape = "block";
custom-command = "";
custom-hyperlinks = [];
default-size-columns = 100;
default-size-rows = 34;
delete-binding = "delete-sequence";
dim-transparency-percent = 0;
draw-margin = 80;
encoding = "UTF-8";
exit-action = "close";
font = "Monospace 12";
foreground-color = "#F8F8F2";
highlight-background-color = "#000000";
highlight-colors-set = false;
highlight-foreground-color = "#ffffff";
login-shell = false;
notify-silence-enabled = true;
notify-silence-threshold = 180;
palette = ["#272822" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F8F8F2" "#75715E" "#F92672" "#A6E22E" "#F4BF75" "#66D9EF" "#AE81FF" "#A1EFE4" "#F9F8F5"];
rewrap-on-resize = true;
scroll-on-keystroke = true;
scroll-on-output = false;
scrollback-lines = 8192;
scrollback-unlimited = false;
select-by-word-chars = "-,./?%&#:_+";
shortcut = "disabled";
show-scrollbar = true;
terminal-bell = "icon-sound";
text-blink-mode = "always";
triggers = [];
use-custom-command = false;
use-system-font = true;
use-theme-colors = false;
visible-name = "Managed Default";
};
};
}