consolidate home-manager config to a module with one entrypoint

This commit is contained in:
Katherina Walshe-Grey 2024-07-30 13:02:11 +01:00
parent 230e93bbe7
commit 31bf48154c
15 changed files with 59 additions and 68 deletions

27
home/dconf/appearance.nix Normal file
View file

@ -0,0 +1,27 @@
{ config, lib, pkgs, ... }:
let inherit (lib) mkIf;
in {
dconf = {
settings =
let
backgroundOptions = {
color-shading-type = "solid";
picture-options = "zoom";
picture-uri = "${config.home.homeDirectory}/.background-image";
primary-color = "#3a4ba0";
secondary-color = "#2f302f";
};
in
{
"org/gnome/desktop/background" = backgroundOptions // {
picture-uri-dark = backgroundOptions.picture-uri;
};
"org/gnome/desktop/screensaver" = backgroundOptions;
"org/gnome/desktop/interface".color-scheme = "prefer-dark";
};
};
home.file.".background-image" = mkIf config.dconf.enable {
source = ./background-image.jpg;
};
}

BIN
home/dconf/background-image.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

30
home/dconf/default.nix Normal file
View file

@ -0,0 +1,30 @@
{ config, lib, pkgs, ... }:
# dconf is the configuration manager for GNOME.
# home-manager, in its infinite wisdom, sets `dconf.enable` to true by default.
# This is a problem because we don't want it to attempt to apply our settings on
# a system that doesn't actually have GNOME installed.
# To work around it, we create our own option `qenya.dconf.enable`, which
# defaults to false, and pass it to `dconf.enable`.
let
inherit (lib) mkIf mkEnableOption;
cfg = config.qenya.dconf;
in
{
options.qenya.dconf = {
enable = mkEnableOption "dconf";
};
config = {
dconf.enable = config.qenya.dconf.enable;
};
imports = [
# TODO: nix-ify other parts of GNOME config
./appearance.nix
./keyboard.nix
];
}

14
home/dconf/keyboard.nix Normal file
View file

@ -0,0 +1,14 @@
# { config, lib, pkgs, ... }:
{
dconf = {
settings = {
"org/gnome/desktop/wm/keybindings" = {
# These are largely useless on most normal systems
# and conflict with VS Code's default keybinds for "Copy Line Up/Down"
move-to-workspace-up = [ ];
move-to-workspace-down = [ ];
};
};
};
}