users/foo-dogsquared/programs/dconf: add "A happy GNOME"-specific settings

This commit is contained in:
Gabriel Arazas 2025-04-13 14:31:05 +08:00
parent cb93a8b1b1
commit 6fd69b1005
No known key found for this signature in database
GPG Key ID: 62104B43D00AA360

View File

@ -1,4 +1,4 @@
{ config, lib, ... }:
{ config, lib, ... }@attrs:
let
inherit (config.xdg) userDirs;
@ -8,7 +8,8 @@ in {
options.users.foo-dogsquared.programs.dconf.enable =
lib.mkEnableOption "dconf configuration";
config = lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable (lib.mkMerge [
{
dconf.settings = {
# My GNOME Shell and programs configuration.
"org/gnome/shell" = {
@ -44,5 +45,49 @@ in {
"org/gnome/epiphany".homepage-url = lib.mkIf userCfg.programs.custom-homepage.enable "file://${config.xdg.dataHome}/foodogsquared/homepage/index.html";
};
};
}
(lib.mkIf (lib.elem "a-happy-gnome" attrs.nixosConfig.workflows.enable or []) {
dconf.settings = {
"org/gnome/shell/extensions/paperwm" = {
winprops =
let
winpropRules =
lib.optionals userCfg.setups.development.enable [{
wm_class = "org.wezfurlong.wezterm";
preferredWidth = "100%";
spaceIndex = 1;
}]
++ lib.optionals userCfg.programs.doom-emacs.enable [{
wm_class = "Emacs";
preferredWidth = "100%";
spaceIndex = 2;
}]
++ lib.optionals userCfg.setups.research.enable [
{
wm_class = "Zotero";
spaceIndex = 2;
}
{
wm_class = "Kiwix";
spaceIndex = 2;
}
]
++ lib.optionals userCfg.programs.browsers.firefox.enable [{
wm_class = "Firefox";
preferredWidth = "100%";
spaceIndex = 0;
}]
++ lib.optionals userCfg.setups.music.spotify.enable [{
wm_class = "Spotify";
preferredWidth = "100%";
spaceIndex = 0;
}];
in
lib.map lib.strings.toJSON winpropRules;
};
};
})
]);
}